-
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
Theme editor font-size with number creates mismatch between font-size slug and block class #31629
Comments
related #26940 |
@ntsekouras might you be able to share some context here? |
Thanks for the report @justintadlock Going to consolidate this into #32347 as the issue is a bit larger than numbers (also affects camelCased slugs). |
There's a fix at #32352 |
Just confirming that #32352 fixed this. |
Formally noting that this issue is no longer fixed as of #32742 and #32766. The first ticket reverted the fix. The second ticket changed this in a way that does not respect valid, theme-defined slugs. I have further proposed a compromise that would allow theme authors to address this in their themes: #32347 (comment) |
issue for include this in documentation #19285 |
@justintadlock can you confirm this has been fixed in the current version of Gutenberg; should have been fixed in #35751 ? |
I'm no longer able to reproduce this as you instructed; the CSS outputs are all now |
Noticing issue mentioned here: #34509. I have |
The only way I have found to handle this across the board is to name them in This will make sure it's consistent everywhere. |
@justintadlock yeah, that makes sense. But right now we use them for utility classes, like |
When registering a custom font-size that begins with a number in
theme.json
, the CSS output doesn't match the class name. I tested this with a slug of2xl
.The CSS that Gutenberg outputs is:
However, when applying it to a block via the Font Size control under the Typography tab, it adds a hyphen between the
2
andxl
. The block CSS class becomeshas-font-size-2-xl
like so:theme.json
code:The text was updated successfully, but these errors were encountered: