[wp-trac] [WordPress Trac] #53070: Establish a Core CSS deprecation path

WordPress Trac noreply at wordpress.org
Wed May 12 21:12:15 UTC 2021


#53070: Establish a Core CSS deprecation path
---------------------------+-------------------------------
 Reporter:  isabel_brison  |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  General        |     Version:
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:  css, performance
---------------------------+-------------------------------

Comment (by ryelle):

 Linking this [https://css-tricks.com/css-ruleset-terminology/ CSS
 terminology reference], just to have a shared understanding of
 ruleset/selector/declarations etc - I know I get the terms mixed up
 sometimes :)

 --------

 I was looking through [https://core.trac.wordpress.org/browser/trunk/src
 /wp-admin/css/common.css#L608 common.css], and found quite a few instances
 of selector deprecation — we removed the `add-new-h2` class in favor of
 `page-title-action`, but need to keep the style on both. Would we split
 this up and duplicate the CSS into `deprecated.css`?

 {{{
 .wrap .add-new-h2, /* deprecated */
 .wrap .add-new-h2:active, /* deprecated */
 .wrap .page-title-action,
 .wrap .page-title-action:active {
         margin-left: 4px;
         padding: 4px 8px;
         position: relative;
 }}}

 Other parts of this file are easier to think about, like here, where
 [https://core.trac.wordpress.org/browser/trunk/src/wp-
 admin/css/common.css#L2282 an entire ruleset is deprecated].

 {{{
 /* Back-compat for plugins. Deprecated. Use .wp-clearfix instead. */
 .nav-tab-wrapper:not(.wp-clearfix):after {
         content: "";
         display: table;
         clear: both;
 }
 }}}

 ------

 I think the deprecated file is a good way to iteratively move forward - a
 way to improve the CSS without an entire redesign. It would need to always
 be enqueued though, to support the plugins that haven't been updated. So
 it won't really save any performance.

 When would we remove CSS from deprecated.css?

 We should also offer some tooling to plugin developers - like a stylelint
 config to run while building, or javascript that can be run on the site to
 highlight when deprecated selectors are used. That could help with the
 reduction of deprecated styles.

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


More information about the wp-trac mailing list