[wp-trac] [WordPress Trac] #35229: Stop generating `wp-admin.min.css`

WordPress Trac noreply at wordpress.org
Sat Dec 26 10:58:16 UTC 2015


#35229: Stop generating `wp-admin.min.css`
---------------------------+-----------------------------
 Reporter:  dd32           |       Owner:
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  4.5
Component:  Script Loader  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  has-patch      |     Focuses:  administration
---------------------------+-----------------------------
Description changed by dd32:

Old description:

> Currently WordPress generates and ships relatively large 235K `wp-
> admin.min.css` and `wp-admin-rtl.min.css` files which are created from
> source files which we also ship.
>
> I'd like to propose that we stop generating these files, and instead rely
> upon `load-styles.php` instead  to combine them.
>
> My main reason is that I'd love for commits such as [35896] not to cause
> 510KB of CSS to require be shipped to end users (That's the two 235K wp-
> admin files, plus dashboard.css/rtl). Instead, we'd only have to ship the
> 4 dashboard.css files which is around 72K.
>
> Package size for regular releases won't be changed significantly, full
> package sizes would increase by 40K as we'd no longer get the benefit of
> the CSS minification process combining some CSS rules which are currently
> in separate files. (Currently wp-admin/css is 2,240KB and would be
> 2,280KB after this proposal)
>
> We'd still need to generate `wp-admin.min.css` and friends I guess for
> those who include it directly.
>
> Attached is a patch which does:
>  * Alters the Gruntfile to just create minified versions of all wp-
> admin/css files
>  * Creates `wp-admin.min.css`, `wp-admin-rtl.css`, and `wp-admin-
> rtl.min.css` manually (ie. not through cssmin) as we only need to do
> string replacements on the contents.
>  * Adds all the individual `wp-admin.css` `@import`s to `script-
> loader.php`
>  * Allows for `load-styles.php` to accept `load[]` like `load-
> scripts.php` to work around long-query-string limitations on some servers
>
> The only real downside of doing this is that we're effectively shifting
> from pre-compute to on-demand concatenation, not a huge deal IMHO as we
> cache the output of `load-styles.php` for 1 year already.
> It also shows how much needless CSS we load on all admin pages.

New description:

 Currently WordPress generates and ships relatively large 235K `wp-
 admin.min.css` and `wp-admin-rtl.min.css` files which are created from
 source files which we also ship.

 I'd like to propose that we stop generating these files, and instead rely
 upon `load-styles.php` to combine them.

 My main reason is that I'd love for commits such as [35896] not to cause
 510KB of CSS to require be shipped to end users (That's the two 235K wp-
 admin files, plus dashboard.css/rtl). Instead, we'd only have to ship the
 4 dashboard.css files which is around 72K.

 Package size for regular releases won't be changed significantly, full
 package sizes would increase by 88K as we'd no longer get the benefit of
 the CSS minification process combining some CSS rules which are currently
 in separate files. (Currently wp-admin/css is 2,240KB and would be 2,328KB
 after this proposal)

 We'd still need to generate `wp-admin.min.css` and friends as back-compat
 for those who include it directly, although `script-loader.php`s
 dependencies will take care of `wp_enqueue_style( 'wp-admin' )`.

 Attached is a patch which does:
  * Alters the Gruntfile to just create minified versions of all wp-
 admin/css files
  * Creates `wp-admin.min.css`, `wp-admin-rtl.css`, and `wp-admin-
 rtl.min.css` manually (ie. not through cssmin) as we only need to do
 string replacements on the contents.
  * Adds all the individual `wp-admin.css` `@import`s to `script-
 loader.php`
  * Allows for `load-styles.php` to accept `load[]` like `load-scripts.php`
 to work around long-query-string limitations on some servers

 The only real downside of doing this is that we're effectively shifting
 from pre-compute to on-demand-on-millions-of-sites concatenation, not a
 huge deal IMHO as we set cache headers on`load-styles.php` for 1 year
 already.
 It also shows how much needless CSS we load on all admin pages.

--

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


More information about the wp-trac mailing list