-
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
Code block: Font size does not work for TwentyTwentyOne #27827
Comments
No, Twenty Twenty-One does not have built in support for features created after the theme was released. Does it work if the |
@carolinan Yes, if the class is removed it works as expected. @nosolosw How should a theme specify a default value, that still allows for user override? (and works with/without Gutenberg plugin) |
@nosolosw Thanks for the quick fix, I left a review and comment on the PR, but I don't think it fixes it because the theme still hard codes the font size for the code block. I think there's still an issue on allowing the theme to provide a default value and then the user to override. |
My thinking is that this is one of those cases where the theme needs to account for user styles. For example, the issue you refer here with TwentyTwentyOne could be fixed by only applying the font-size declaration to the block if it doesn't have the font-styles applied, something like |
It is not realistic to expect theme and plugin developers to keep up with the frequent changes to the editor. They are not being fixed because it is not effective use of the contributors time. This is also bothersome when the theme adjusts for a change that is then reverted and the theme needs to be updated again. We are going to see this problem for a long transition period, even after global styles are out of the experimental phase, and, there is also no contributor that keeps track of all changes to Gutenberg and open trac tickets saying that something needs to be updated in the bundled themes. |
@carolinan Thank you, you raise many good questions, many of which still need to be worked out for sure. The In this case I think there is a slightly different issue at hand. The TwentyTwentyOne theme is explicitly setting a font size for So the open question, how should a theme specify a default style that allows for a block to override on a global and/or an individual post or block basis. Also, who should get the final say on how something is styled, the theme or the user/editor? For a large publication, I can see them wanting the theme to get the final say, while an individual personal blog maybe the user. Either way we need to figure out how to design the system in a way that works for both, and then create themes (and document how) that allow both. In this case, the theme specified to use Plus please note, as you stated earlier this is an experimental feature at an early stage - this bug report is intended to highlight an issue and start a discussion, it was not intended as a high priority bug that all themes must fix right now. I think it only occurs if you have the plugin enabled, so the impact is still low. |
I am not debating whether the theme should support the feature. You would need to create a Trac ticket and with some effort support would be added by the time the font size feature for the code block is added to Core. |
This was closed automatically by #27862 but happy to re-open and help fix whatever issue remains in Gutenberg.
If the user has the tools to change a property, that change has preference over the theme's or core's style preferences ― this is for themes with or without theme.json support and my understanding is that it has been like that since the beginning. As to how to make sure theme & user styles play well, my view is that it's a delicate CSS dance and this needs to be adjusted over time as the blocks get support for new style properties. Personally, I think it's ok that themes are not updated bi-weekly to account for all new changes in the Gutenberg plugin, the struggle to keep up with everything is real for many of us. From the Gutenberg point of view, I'm not sure what else is to be done other than communicating what's new and adding dev notes when these kinds of things are released in a WordPress version. Happy to consider any other alternatives. A related topic is when a user should be presented with design tools and when not and whether this is something themes should control. So far, the mechanism Gutenberg had was |
Trac ticket created |
Describe the bug
Setting the font size for the code block will add the class
has-large-font-size
to the outerpre
block but does not set the class for the innercode
block. So for the theme TwentyTwentyOne the code block size appears to not work.Markup ends up being:
The CSS from the theme:
Is it only a theme issue? If the class is attached to the
code
tag then it would work too.The text was updated successfully, but these errors were encountered: