[wp-trac] [WordPress Trac] #54975: Allow filtering global styles

WordPress Trac noreply at wordpress.org
Wed Feb 9 09:09:57 UTC 2022

#54975: Allow filtering global styles
 Reporter:  webmandesign  |       Owner:  (none)
     Type:  enhancement   |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:  5.9
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:  css

Comment (by oandregal):

 Hi, we've discussed filters for global styles code a couple of times,
 including in the WordPress  5.9 cycle at
 https://github.com/WordPress/gutenberg/pull/36909 When we do filters for
 this code, I'd think we do it much earlier in the processing chain: we
 want consumers to have structured data to work with and not a blob string
 difficult to parse and modify.

 We've heard the conversation in the issue you point to and we'll be
 shipping in 5.9.1 a fix for classic themes that modify the defaults
 https://github.com/WordPress/wordpress-develop/pull/2233 The editor styles
 and the front will be the same.

 If themes want to do further modifications (editor & front using different
 styles), they can tap into the CSS hooks in place: using the existing CSS
 Custom Properties. See this devnote for an example

 If the goal is to stop enqueuing the default styles (colors, font sizes,
 etc), there's an existing API for that: wp_dequeue_styles. As I mentioned
 in other places this can have unintended side-effects as there're pieces
 that use the defaults (patterns, existing content, etc).

 Does this help clarify? Is there a need not covered by the existing

Ticket URL: <https://core.trac.wordpress.org/ticket/54975#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list