Gutenberg Plugin: Unable to override block theme styles #54783
Labels
Gutenberg Plugin
Issues or PRs related to Gutenberg Plugin management related efforts
[Package] Block library
/packages/block-library
[Type] Enhancement
A suggestion for improvement.
Description
If the theme opts in to
wp-block-styles
, a style with the handlewp-block-library-theme
will be output in the front end.Also, if
should_load_separate_core_block_assets
is set totrue
, or if the CSS file size exceeds the threshold, a theme style with the handlewp-block-{block-name}-theme-inline-css
will be output separately after the main style sheet with the handlewp-block-{block-name}-inline-css
.If you enable the Gutenberg plugin, this theme style will also be added to the end of the main stylesheet.
Therefore, even if you change the style in the
theme.scss
file on the Gutenberg plugin, if the same style exists in the core, it will be overwritten by the core style and you will not be able to debug the style.I think this problem is probably caused by this location:
gutenberg/lib/blocks.php
Lines 293 to 297 in dc2517e
Step-by-step reproduction instructions
Let's take a table block as an example and explain the steps to reproduce this problem.
wp-block-table-inline-css
wp-block-table-theme-inline-css
Screenshots, screen recording, code snippet
Environment info
No response
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: