[wp-trac] [WordPress Trac] #53494: Styles not applied to block using theme.json with seperate assets loading enabled
WordPress Trac
noreply at wordpress.org
Fri Jun 25 13:39:03 UTC 2021
#53494: Styles not applied to block using theme.json with seperate assets loading
enabled
--------------------------+---------------------
Reporter: walbo | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 5.8
Component: Editor | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses:
--------------------------+---------------------
Comment (by aristath):
can we make it so that the `post_content` is pre-rendered for classic
themes that have `should_load_separate_core_block_assets` enabled so we
can enqueue the block styles in the `<head>`?
That would be the ideal solution, and IMO something that should happen
regardless of how styles get loaded... Ideally all blocks would be parsed
before the `<head>` like we do in block themes and there's an older ticket
for that in #46004.
by changing the place block styles are enqueued to, we may run into other
conflicts with plugins and theme styles. In other words, third parties
need to be aware of this logic as well. If they want to override block &
global styles they can only do it by enqueuing to the footer with higher
priority than the default.
True... which is why it's disabled by default in classic themes ;)
Changing the priority wouldn't be the only way for themes/plugins to
override the CSS when needed btw, they could also just tweak the CSS
selectors to make them more specific (though admitedly, changing them to
load in the footer is the easier solution)
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53494#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list