[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:46:16 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 peterwilsoncc):

 @poena Don't worry about sounding negative: you have questions and I am
 happy to answer them.

 > 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.

 That's true.

 However, there have been security issues in default themes in the past
 (fixed in WP 4.4.2) so been able to update the themes for users on older
 versions of WP can be helpful.

 > 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}

 Yes, that is what I was thinking.

 If it's only a few selectors that require special treatment then the
 performance hit would be negligible.

 If it's a significant number of selectors and blocks that require
 different treatment per version of WordPress then separate files would
 probably be worth it.

 You have a much better understanding of the problem than I, so happy for
 you to tell me that the answer to my question is "no, the class based
 approach would introduce other problems and is unacceptable". It's not
 negative; it's working out the best solution :)

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


More information about the wp-trac mailing list