-
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
Big styling / specifity problems with WP 6.0 #41760
Comments
Hi!
Would that be enough? You would need to replace all the column styles for the front, not only the breakpoint. I'd like to know more about "columns by default do not stack on mobile anymore" because I am not able to reproduce it. |
Those inline styles get added because of options and selections you have made in the editor. |
Hi @carolinan , thank you for your reply. As I stated in the first comment, I already dequeue all gutenberg/block editor stylesheets :-)
For me it's not. When I have the "Stack on mobile" switch active, the inline css for the specific element (
without media queries. So columns are always in a row (see the Anyway, even if this is going to be fixed, in general, I think it would be a good practice to let developers easilly override / opt out from inline styling, without at the same time letting them be able to correctly style the blocks (see the problem with the button block when using EDIT: I've seen that if I DO NOT deregister gutenberg style sheet, there's a rule which lets the columns wrap.
And
But still is made with 2 (!!) important rules, where non actually should be there... |
Hi @aristath , thank you for your reply :-)
I just would like to override the styles of gutenberg wihtout having to use too many !important directives, and still have the ability to style all the blocks (see the problem with the button block when using remove_filter( 'render_block', 'wp_render_layout_support_flag', 10, 2 );) :-) |
You are right, I apologize, then I don't think I can be of much help. |
The classnames were added back to the likes of buttons with this PR, which will hopefully make it into the next minor WP release. In the mean time this filter should achieve the same thing: |
Hi @glendaviesnz, thank you for your reply
I'll try it out! |
@glendaviesnz I've tried the solution and it worked :-) thank you very much |
Description
Hi, I'm a developer, and I've been very happy to ditch pagebuilders to use gutenberg and build custom blocks for my themes.
I just dequeue all gutenberg frontend css, and style everything according the project design in the theme css (sometime using a theme.json).
With the the latest WP release there's a lot of inline and so not easilly overridden CSS which gets injected into the head.
For example all the columns are now styled like this:
So all the columns by default do not stack on mobile anymore , and this inline style is so specific that it overrides my old styles, and to override it I need to
and use 3
!important
, which is quite ugly.I know that I can stop outputting the inline styles completely
remove_filter( 'render_block', 'wp_render_layout_support_flag', 10, 2 );
But then at this point, since wp-block-buttons do not output alignment classes anymore, I can't align buttons😕
Is there a solution to this, so that I can simply style a website without having to override this very opinionated inline styles?
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
Environment info
WP 6.0 / Custom theme
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: