[wp-trac] [WordPress Trac] #49665: Twenty Twenty: Minify style.css

WordPress Trac noreply at wordpress.org
Mon Feb 24 05:00:15 UTC 2025


#49665: Twenty Twenty: Minify style.css
----------------------------+----------------------
 Reporter:  beenni09052005  |       Owner:  (none)
     Type:  enhancement     |      Status:  closed
 Priority:  normal          |   Milestone:
Component:  Bundled Theme   |     Version:
 Severity:  normal          |  Resolution:  wontfix
 Keywords:  close           |     Focuses:  css
----------------------------+----------------------

Comment (by westonruter):

 @audrasjb I realize that this ticket is about runtime minification after
 editing a CSS file in the theme file editor, but I wanted to raise a
 related point:

 Since core has CSS minification as part of the build process, shouldn't
 this be used by themes as well? This would help address things like
 #47925, where the stylesheet for T19 is 224K but after going through
 cssmin it is reduced to 196K. It doesn't really make sense for themes to
 serve the WP theme metadata CSS comment block to browsers. I should think
 that all `.css` files in a theme should also have a corresponding
 `.min.css` file. Maybe minification has been discouraged in the past to
 facilitate authors forking a theme and making changes to the CSS, with
 there being an unexpected result where the minified CSS wouldn't also be
 updated. Nevertheless, themes like T19, T20, and T21 are already using a
 build step for the CSS so authors shouldn't be directly modifying the
 `style.css` file directly anyway. They should be using the build process
 to re-generate the CSS instead.

 Minifying the CSS will facilitate allowing the stylesheets to be inlined,
 for example in #63007. Without minification, enqueued CSS will more
 quickly reach the `styles_inline_size_limit`.

 This ticket was the only one I could find related to minification of theme
 CSS files, so this is why I'm raising this here. Can you direct me to
 anywhere that this has been discussed before?

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


More information about the wp-trac mailing list