[wp-trac] [WordPress Trac] #56130: Twenty Twenty-One: Load different CSS for different WP versions, to be compatible with blocks

WordPress Trac noreply at wordpress.org
Fri Jul 15 00:21:39 UTC 2022


#56130: Twenty Twenty-One: Load different CSS for different WP versions, to be
compatible with blocks
---------------------------+------------------------------
 Reporter:  poena          |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Bundled Theme  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  css
---------------------------+------------------------------

Comment (by poena):

 With a minimum required version increase, users who do not update
 WordPress still use the previous version of the theme, so nothing changes
 for them. Their theme continues to work like today.
 They wont see any further breaking of block styles since they will not be
 able to install the latest version of Gutenberg either.

 ----


 I am not sure I understood the body class suggestion correctly. It may be
 easier for me if you sketched out the proposed CSS file and file loading
 structure.

 So if I brainstorm freely around this suggestion: Did you mean that if a
 theme has for example a separate sass file called navigation-block.scss,
 that file would include:
 .wordpress-58 .wp-block-navigation .old-class-name {style}
 .worspress-59. wp-block-navigation .new-class-name-to-match_new_markup
 {style}
 ?
 And both would be loaded on the front for all WP versions?
 I may have misunderstood the intention but I don't think loading all the
 CSS on pages where only a small portion of the CSS would be used is
 performant.

 I don't mean to sound negative, because I find the suggestion interesting,
 but wouldn't adding that extra specificity prevent users from changing
 styles with the block settings? The styles from the settings would have a
 lower specificicity.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56130#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list