gutenberg
gutenberg copied to clipboard
Responsive styles: When enabled and a font-size is setting, the corresponding CSS variable remains undefined.
Description
As described in the title.
theme.json setting(settings.typography.fontSizes)
{
"fluid": {
"min": "1.8rem",
"max": "2rem"
},
"name": "3XL",
"slug": "3xl",
"size": "2rem"
},
Defined CSS variables
--wp--preset--font-size--3-xl
Output CSS font-size property (tablet or mobile only styling)
font-size: var(--wp--preset--font-size--3xl) !important;
Step-by-step reproduction instructions
- Responsive styles ON
- Select [Style tablet only] or [Style mobile only]
- Create paragraph block
- Setting paragraph block FONT SIZE 3XL:(theme.json custom fontSizes)
- Preview in new tab
Screenshots, screen recording, code snippet
Environment info
- WP 7.1-RC4
- Google Chrome 151.0.7922.138, Firefox 153.0.4
Please confirm that you have searched existing issues in the repo.
- [x] Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- [x] Yes
Please confirm which theme type you used for testing.
- [x] Block
- [ ] Classic
- [ ] Hybrid (e.g. classic with theme.json)
- [ ] Not sure
Thanks for the report.
Strictly speaking, similar problems have existed for a long time. See #53695.
Although issue #80583 resolved the fundamental problems, I believe we overlooked addressing responsive styling.
As a temporary workaround, you can add hyphens before and after the numbers in the preset slugs.
{
"fluid": {
"min": "1.8rem",
"max": "2rem"
},
"name": "3XL",
"slug": "3-xl",
"size": "2rem"
},
cc @jorgefilipecosta @ramonjd @tellthemachines
Thanks as always for showing me how to fix it!
I added it to the 7.2 iteration
- https://github.com/WordPress/gutenberg/issues/80388
Thanks for the report.