-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Minify stylesheets for twentytwentyone theme. #10860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Changes from 11 commits
6361788
d10d52e
7257263
7f3dc41
ab5bf66
30b41a8
d1286f9
efc129c
1f381d8
c7dff92
44a60ee
8cef9dd
af45d63
185ea2c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,3 +16,10 @@ Tags: one-column, accessibility-ready, custom-colors, custom-menu, custom-logo, | |||||||||||||||||
| Twenty Twenty-One WordPress Theme, (C) 2020 WordPress.org | ||||||||||||||||||
| Twenty Twenty-One is distributed under the terms of the GNU GPL. | ||||||||||||||||||
| */ | ||||||||||||||||||
|
|
||||||||||||||||||
| /* | ||||||||||||||||||
| * IMPORTANT: This file is only served on the frontend when `SCRIPT_DEBUG` is enabled; | ||||||||||||||||||
| * in production, when `SCRIPT_DEBUG` is not enabled, the minified .css file will be served. This theme uses SCSS for styles. | ||||||||||||||||||
| * After making changes to SCSS files, run `npm run build` in the theme directory to compile | ||||||||||||||||||
| * SCSS to CSS and regenerate the minified version. | ||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "In production" can start a new sentence, and the lines can wrap better.
Suggested change
|
||||||||||||||||||
| */ | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -387,8 +387,12 @@ function twenty_twenty_one_content_width() { | |
| * @return void | ||
| */ | ||
| function twenty_twenty_one_scripts() { | ||
| $theme_version = wp_get_theme()->get( 'Version' ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now, the |
||
|
|
||
| $suffix = ( ! SCRIPT_DEBUG ) ? '.min' : ''; | ||
|
|
||
| // The standard stylesheet. | ||
| wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/style.css', array(), wp_get_theme()->get( 'Version' ) ); | ||
| wp_enqueue_style( 'twenty-twenty-one-style', get_template_directory_uri() . '/style' . $suffix . '.css', array(), $theme_version ); | ||
|
|
||
| // RTL styles. | ||
| wp_style_add_data( 'twenty-twenty-one-style', 'rtl', 'replace' ); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The RTL 'replace' would make sites in right-to-left languages try to fetch a And then fetch the minified dark mode stylesheets like this: |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I purposely did not delete files such as
ie.cssandie.css.mapin case something still points to them (for example, in a child theme). Please restore the small files.