-
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
Classic.css overrides styles.elements.button styles in hybrid themes #48750
Comments
@eric-michel I have not been able to reproduce this problem. As far as I know, in WordPress 6.1, even with the classic theme, it should not enqueue the The commit in this core shows that Furthermore, in WordPress 6.2, this commit introduces the However, the Gutenberg plugin still checks if it is a block theme, so I think this style is enqueued even for classic themes with I have discovered that you are attempting to fix the above problem in #45063. What do you think if we merge this PR the problem will be fixed? |
edit: I wrote my whole reply while missing this note:
If this is a problem specific to the plugin, then that's no problem on my end. My main concern is that my sites will break when WP actually updates. Hi @t-hamano thanks for the quick response! I am able to replicate this issue via the following method:
Here is the theme.json I'm using (from https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json/):
Ironically, the Is it possible there is something wrong with my |
I think that #45063 will solve this. |
Since this patch has landed in core I think we can close this issue. |
Description
In 14.3,
classic.css
was introduced to provide button styles to classic themes. However, due to how when this stylesheet is output (after the global styles generated bytheme.json
) it overrides border radius settings (and I assume any other style attribute defined inclassic.css
) for buttons intheme.json
. This will break many sites for me that work on our hybrid theme. I can and will of course dequeueclassic-theme-styles
but this feels like a very wrong implementation.Does
classic.css
even need to be output at all on any theme with atheme.json
? It seems like it would only be needed on fully classic themes.Step-by-step reproduction instructions
Any hybrid theme will show this. Unfortunately, none of the Twenty Twenty-* themes are hybrid, which is my normal go-to for testing. The closest testing environment I could find would be to add a
theme.json
to Twenty Twenty-One and manually remove button-oriented styles from the theme's stylesheet such thattheme.json
controls the button border radius. Then install the Gutenberg plugin and you will see the issue.Screenshots, screen recording, code snippet
A button with a
theme.json
defined 20px border radius on current production WP;The same button with the only change being the current version of the Gutenberg plugin active:
The same styles are applied in the editor
Environment info
WP version 6.1.1 with and without the Gutenberg plugin active.
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: