WordPress inline custom css specified for block even if block doesn't include on the page #49559
Labels
CSS Styling
Related to editor and front end styles, CSS-specific issues.
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
Needs Technical Feedback
Needs testing from a developer perspective.
[Type] Enhancement
A suggestion for improvement.
Description
If I add some custom css for specific block I expect that this css will be included to page only if that block also included. But currently, it seems block-specific css always included, no mater is actually block itself used on page or not.
Step-by-step reproduction instructions
templates/index.html
andtheme.json
like so:index.html
template..wp-block-button .wp-block-button__link{color: red}
but I expect expected it not to beScreenshots, screen recording, code snippet
No response
Environment info
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: