Commit b56b386
committed
Bundled Themes: Introduce stylesheet minification for core block themes.
This introduces a build process to provide minified stylesheets for the Twenty Twenty-Two and Twenty Twenty-Five themes. The built minified CSS is not committed to version control. When `SCRIPT_DEBUG` is disabled, the minified `style.min.css` file will be enqueued to improve performance, including reducing render-blocking resources as well as facilitating inlining. See #63007.
* Stylesheets are minified via the new core `cssmin:themes` Grunt task, which is automatically run as part of `build:css`.
* The same build process is added to the themes (via `package.json` and `package-lock.json`) with `build` and `watch` commands; the `postcss` and `cssnano` development dependencies are used to handle CSS minification.
* The `functions.php` in each theme is updated to enqueue `style.min.css` unless `SCRIPT_DEBUG` is enabled, in which case `style.css` is enqueued.
* A notice comment is added to `style.css` to warn against editing the stylesheet since the minified version will likely be served instead.
* A new `contributing.txt` file is added to each theme to document the build process for developers.
* The `test-and-zip-default-themes` GitHub workflow is updated to install npm dependencies and build the minified assets before packaging the themes.
* New PHPUnit tests are added to verify version number consistency across `style.css`, `readme.txt`, `package.json`, and `package-lock.json` files in default themes.
Developed in #10081.
Props b1ink0, westonruter, shyamgadde, jonsurrell, sabernhardt, jorbin, peterwilsoncc, poena.
Fixes #63012.
git-svn-id: https://develop.svn.wordpress.org/trunk@60934 602fd350-edb4-49c9-b593-d223f7449a821 parent 7447c82 commit b56b386
File tree
15 files changed
+3703
-13
lines changed- .github
- workflows
- src/wp-content/themes
- twentytwentyfive
- twentytwentytwo
- tests/phpunit/tests
15 files changed
+3703
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
132 | 154 | | |
133 | 155 | | |
134 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
29 | 31 | | |
30 | 32 | | |
31 | 33 | | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
| |||
120 | 124 | | |
121 | 125 | | |
122 | 126 | | |
| 127 | + | |
| 128 | + | |
123 | 129 | | |
124 | 130 | | |
125 | 131 | | |
| |||
221 | 227 | | |
222 | 228 | | |
223 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
224 | 248 | | |
225 | 249 | | |
226 | 250 | | |
227 | 251 | | |
228 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
229 | 255 | | |
230 | 256 | | |
231 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
567 | 567 | | |
568 | 568 | | |
569 | 569 | | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
570 | 580 | | |
571 | 581 | | |
572 | 582 | | |
| |||
1591 | 1601 | | |
1592 | 1602 | | |
1593 | 1603 | | |
| 1604 | + | |
1594 | 1605 | | |
1595 | 1606 | | |
1596 | 1607 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | | - | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
0 commit comments