[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
Thu Aug 1 17:55:39 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: has-patch | Focuses: css, performance
---------------------------+-------------------------------
Changes (by sabernhardt):
* keywords: needs-patch => has-patch
Comment:
I'm wary of increasing specificity of element selectors by grouping them
with class and/or id selectors in `:is()`. In this case, it might only
annoy a few people who took the effort to override those font styles
(instead of replacing the stylesheet), but it would be a problem with a
property such as `color`. Besides, I do not know how to group the list of
selectors inside `:is()` with Sass.
I was able to group the similar `:lang()` selectors, and I removed the
locales from the language codes.
- That results in 12 rulesets instead of 31.
- 6 of them are identical to what they have been.
- Hebrew and Korean would not include their locales but are otherwise
identical to the current CSS.
The patch could reduce `style.css` by about 50KB with low risk. 172KB
still would be larger than any other Core theme's stylesheet, but it's a
big improvement.
For the comments that are printed out of context, I was able to move some
valuable comments to a better position (instead of reformatting them to
show only in Sass).
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47925#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list