-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
"Larger" Font size showing up incorrectly in editor view with Twenty Twenty theme #37617
Comments
I gave this a quick test and it seems the CSS Custom Properties for the font sizes provided by the theme are not being generated (they should), hence, the values fall back to the ones provided by core. I've also noticed that the |
I'm working on a custom theme and the 'normal' and 'large' CSS Custom Properties are being generated but are being overwritten by the editor.scss as it has a higher specificity. |
@neilorangepeel #37526 appears to lower the specificity and correct the issue you're seeing. |
Hi, @oandregal Should we fix this for 5.9, or can it be punted to a minor release? |
Related to this issue, I've found this other one and prepared a fix #37819 |
Also related to this issue: WordPress/wordpress-develop#2129 Apparently, this piece of logic wasn't backported. |
The final PR I've prepared to fix this issue is this WordPress/wordpress-develop#2130 |
With the 3 PRs above this would be fixed. Let me unwrap what happened. The issue here is that TwentyTwentyTwenty hasn't been updated to set the default presets via CSS Custom Properties (in lieu of having a So:
|
It looks like we can close this as all three of those PRs have been merged. |
Description
The Twenty Twenty theme has opted into the block editor font sizes and styling. Despite this, the "large" font option shows up as bigger than the "larger" font size when selecting between options in the editor. It renders correctly on the front end. Feel free to redirect me if there is a better spot for this :) I tested the same experience with the Twenty Nineteen theme, which has no problem rendering correctly. From what I can gather, the theme is doing everything right to opt into the editor styles and to set the editor font sizes.
To fix this, I found that if I changed the slug for the "larger" option in twenty twenty to "huge", it worked correctly! This tells me that these font size controls might need to look for more than just "huge" since those options aren't standardized as far as I know. This is just a guess!
Twenty twenty theme:
Twenty Nineteen theme:
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Video:
font.size.2020.mov
Twenty Twenty Editor view:
Twenty TwentyFront end view:
For fun, I tried changing around the front size to see if something was acting up there and noticed if I changed the font size to just 26, it showed up differently in the sidebar, listing out each number:
I noticed that rather than showing the actual numbers too, the options show up as "1, 2, 3, 4" - wasn't sure if that was intentional and wanted to note as a result:
Here's Twenty Twenty working correctly after setting the "larger" font size slug to "huge":
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: