-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Typography: Theme defined font sizes are no longer working #57889
Comments
Can also confirm this is happening. |
Pinging @richtabor and @annezazu b/c IMO this is a pretty big deal (and breaking situation). |
To further illustrate what is happening, see below. Gutenberg trunk seems to exacerbate the problem with even more unexpected results and—in this case—breaking changes on the front end. What font sizes should be in my Powder theme: What is output with Gutenberg 17.5 active: |
Perhaps this is related (or has similar behavior) to #52200. Also pinging @carolinan as she was involved in the issue I mentioned. |
@bgardner @colorful-tones, thanks for adding more context. It'd be great if this issue gets fixed quickly. It blocks theme creations if you use the trunk :/ |
I'll escalate where I can too. Thank you for the ping and raising the alarm. |
Can’t wait to see what you come up with @ajlende, as Gutenberg 17.6 RC1 now has breaking changes on the front end with font sizes. |
Any progress on this? The first comparison images with TT4 might not have illustrated the issue very much because the difference was subtle 🔍 The extent of the disturbance depends on the design of the theme, and this example might illustrate the issue better. The left is how it should be and the right is the current. |
I am far from an expert in how those properties are handled in Gutenberg, but maybe changing the
I've tested that and, making that change, it seems to work for my case:
Is that what we want? If that should be the solution I can work on a pull request. EDIT: I ended up creating the pull request in case I'm not around and we need to merge this. Feel free to suggest/modify anything. |
@SantosGuillamot Thanks for taking a look! I've also been working on this and commented in the PR that caused the issue (#56661). It'll be helpful if you can review when I get it working.
|
Great to hear you are working on that 🙂
Oh, that's a pity. I can test whatever the solution is, although I'm not gonna be available until tomorrow. |
Noting that while the front end is better/fixed, the font sizes in the editor (Typography > Size) are still being hijacked by core sizes. In other words, the screenshots from my comment above are still an issue. cc: @annezazu for visibility and @iamtakashi to confirm if seeing the same thing. |
Just reopening if this is still an ongoing issue and not fully corrected with the latest change. |
@justintadlock I see that this exists: #52200 The problem is that in the editor, where there are font sizes names common with core/default themes and my Frost/Powder themes (Small, Medium, Large, and Extra Large in this case) the drop down menu shows the core values and not my theme values. With the revert in #58456, the issue is no longer on the front end out of the box—just when text is given any of those sizes listed above (in which case it becomes a front end problem.) In English: if a theme declares font sizes that are identical to the ones in core, core should defer altogether (front end, back end, site editor) to the theme. |
For me I have turned off every style, but with Gutenberg 6.4.3 (since 6.4.0 iirc) font size is back
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 2,
"settings": {
"appearanceTools": false,
"typography": {
"defaultFontSizes": false,
"customFontSize": false,
"lineHeight": false,
"dropCap": false,
"fluid": false,
"fontStyle": false,
"fontWeight": false,
"letterSpacing": false,
"textDecoration": false,
"textTransform": false,
"fontFamilies": [],
"fontSizes": []
}
}, The font size control is back, making the whole "Styles" tab appear: Which also brings back this broken-looking thing, under Advanced: Edit: Gutenberg 17.6.0 - it's still there. Edit: Adding: "blocks": {
"core/paragraph": {
"typography": {
"fontSizes": []
}
}
}, Produces empty styles tab with "Typography" label: |
Since this issue has been reopened, I will also change the project board status from "Done" to "ToDo". |
@bgardner Sorry for the delay in response. I was away. I can confirm that blocks now appear with the correct font sizes on both the editor and the front of the site, but the sizes with the same slugs as core are labelled incorrectly. |
Description
It looks like the font sizes a theme defines in its theme.json are no longer working.
For example, in the theme,
--wp--preset--font-size--medium
should be1.05rem
but with Gutenberg plugin, the size isclamp(14px, 0.875rem + ((1vw - 3.2px) * 0.625), 20px)
I can see this issue with other themes too.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
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: