Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TwentyTwenty font sizes & colors #2130

Closed
wants to merge 3 commits into from
Closed

Fix TwentyTwenty font sizes & colors #2130

wants to merge 3 commits into from

Conversation

oandregal
Copy link
Member

@oandregal oandregal commented Jan 10, 2022

Trac ticket https://core.trac.wordpress.org/ticket/54782
Depends on #2129 and https://core.trac.wordpress.org/ticket/54781

How to test

Font sizes

  • Apply on this branch the PR at The global stylesheet should be enqueued for all themes #2129
  • Use the TwentyTwenty theme.
  • Create a post that contains 5 paragraphs with the following content:
    • Small (18)
    • Normal (21)
    • Default
    • Large (26.25)
    • Larger (32)
  • To each paragraph apply the font size that corresponds to its content: apply small to the 1st paragraph, normal to the 2nd, nothing to the third, large to the 4th, and larger to the 5th.

The expected result is that the font size for each paragraph has the assigned value, both in the editor and front-end.

Colors

  • Apply on this branch the PR at The global stylesheet should be enqueued for all themes #2129
  • Use the TwentyTwenty theme.
  • Create a post.
  • Create a paragraph and apply custom color classes by pasting this text has-white-background-color has-black-color into the "Additional classes" text field of the "Advanced" section of the block sidebar.
  • Create a new paragraph and apply custom color classes by pasting this text has-black-background-color has-white-color into the "Additional classes" text field of the "Advanced" section of the block sidebar.

Via the browser devtools make sure that the first paragraph's color is rgb(0,0,0) and its background is rgb(255,255,255). The second paragraph should be the opposite.

For themes without theme.json support we only enqueue the default
styles provided by WordPress, such as the preset classes
(font sizes, colors, etc). These should be always present
as they may be used by old content and patterns.

For themes with theme.json support, we also enqueue the theme styles.
To set the value of the WordPress core clasess we should set the
corresponding CSS Custom Property of the font size.
Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked well on my tests 👍

@oandregal
Copy link
Member Author

Merged as of 2aff2a6

@oandregal oandregal closed this Jan 10, 2022
@oandregal oandregal deleted the fix/twenty-twenty-default-presets branch January 10, 2022 18:35
pento pushed a commit that referenced this pull request Sep 9, 2023
…nts.

Note: This is enforced by WPCS 3.0.0:

1. There should be no space between an increment/decrement operator and the variable it applies to.
2. Pre-increment/decrement should be favoured over post-increment/decrement for stand-alone statements. “Pre” will in/decrement and then return, “post” will return and then in/decrement. Using the “pre” version is slightly more performant and can prevent future bugs when code gets moved around.

References:
* [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#increment-decrement-operators WordPress PHP Coding Standards: Increment/decrement operators]
* [WordPress/WordPress-Coding-Standards#2130 WPCS: PR #2130 Core: add sniffs to check formatting of increment/decrement operators]

Props jrf.
See #59161, #58831.

git-svn-id: https://develop.svn.wordpress.org/trunk@56549 602fd350-edb4-49c9-b593-d223f7449a82
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants