[wp-trac] [WordPress Trac] #47925: Twenty Nineteen: Size of style.css seems excessively large (225% as large as the next largest theme's CSS)

WordPress Trac noreply at wordpress.org
Wed Jul 31 16:27:05 UTC 2024


#47925: Twenty Nineteen: Size of style.css seems excessively large (225% as large
as the next largest theme's CSS)
---------------------------+-------------------------------
 Reporter:  westonruter    |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Future Release
Component:  Bundled Theme  |     Version:  5.0
 Severity:  normal         |  Resolution:
 Keywords:  needs-patch    |     Focuses:  css, performance
---------------------------+-------------------------------

Comment (by sabernhardt):

 Reducing or replacing the non-latin fonts section is a big opportunity but
 tricky, and it would require a lot of testing.

 I had thought the theme's use of `:lang()` would help when a page has
 multiple languages.
  - It adjusts the font for elements such as headings, inputs and buttons
 in another language. That could be important to continue supporting (in a
 different way?).
  - The font does not adjust for elements that I think are more likely to
 have their own `lang` attribute: `p`, `ul`, `li`, `div`, `span` and `i`.
  - Note: since the post editor canvas was moved inside an iframe without a
 `lang` attribute in WP6.3, these language styles do not apply there
 (GB52777 / GB54150).

 Less significant opportunies to reduce size:
 - Replace `/* */` comments syntax with `//` when they do not add value to
 the compiled stylesheets. For example, the mixins file prints comments out
 of context. I also think that the `_normalize` comments are not very
 helpful in the final CSS (except for the credit at the top). \\// -4.2KB
 from those two files //
 - #60408 may replace most of the `.entry .entry-content` selectors. \\//
 -3.1KB just in the block-related rulesets if using `:root .site`, up to
 21.5KB if both classes can be removed from about 1,000 selectors //
 - I think the WOFF fallback is unnecessary for the non-breaking space
 override now. The font affects (Apple) devices with Hoefler Text, and the
 override is (mainly) intended for Chrome. \\// -2.9KB //

 Maybe this ticket could take care of the comments and WOFF changes, and
 then another ticket could address the non-latin font fallbacks/overrides
 if someone discovers a good strategy for that.

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


More information about the wp-trac mailing list