Skip to content

Commit 0e2085e

Browse files
committed
Revert "Add CSS minification for Twenty Nineteen, Twenty Twenty, and Twenty Twenty-One themes"
This reverts commit d3beb63.
1 parent d2a352b commit 0e2085e

File tree

12 files changed

+638
-4474
lines changed

12 files changed

+638
-4474
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,6 @@ wp-tests-config.php
9292
/src/wp-content/themes/twentytwentyfive/node_modules
9393

9494
# Minified files in bundled themes
95-
/src/wp-content/themes/twentynineteen/*.min.css
96-
/src/wp-content/themes/twentytwenty/**/*.min.css
97-
/src/wp-content/themes/twentytwentyone/**/*.min.css
9895
/src/wp-content/themes/twentytwentytwo/*.min.css
9996
/src/wp-content/themes/twentytwentyfive/*.min.css
10097

Gruntfile.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -574,28 +574,7 @@ module.exports = function(grunt) {
574574
dest: WORKING_DIR,
575575
ext: '.min.css',
576576
src: [
577-
// Minify Twenty Nineteen stylesheet.
578-
'wp-content/themes/twentynineteen/style.css',
579-
'wp-content/themes/twentynineteen/style-rtl.css',
580-
'wp-content/themes/twentynineteen/print.css',
581-
582-
// Minify Twenty Twenty stylesheet.
583-
'wp-content/themes/twentytwenty/style.css',
584-
'wp-content/themes/twentytwenty/style-rtl.css',
585-
'wp-content/themes/twentytwenty/print.css',
586-
'wp-content/themes/twentytwenty/assets/css/font-inter.css',
587-
588-
// Minify Twenty Twenty-One stylesheets.
589-
'wp-content/themes/twentytwentyone/style.css',
590-
'wp-content/themes/twentytwentyone/style-rtl.css',
591-
'wp-content/themes/twentytwentyone/assets/css/print.css',
592-
'wp-content/themes/twentytwentyone/assets/css/style-dark-mode.css',
593-
'wp-content/themes/twentytwentyone/assets/css/style-dark-mode-rtl.css',
594-
595-
// Minify Twenty Twenty-Two stylesheet.
596577
'wp-content/themes/twentytwentytwo/style.css',
597-
598-
// Minify Twenty Twenty-Five stylesheet.
599578
'wp-content/themes/twentytwentyfive/style.css',
600579
]
601580
}

src/wp-content/themes/twentynineteen/functions.php

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -255,11 +255,9 @@ function twentynineteen_content_width() {
255255
* @since Twenty Nineteen 1.0
256256
*/
257257
function twentynineteen_scripts() {
258-
$url = twentynineteen_get_stylesheet_path( 'style.css' );
259-
if ( is_rtl() ) {
260-
$url = twentynineteen_get_stylesheet_path( 'style-rtl.css' );
261-
}
262-
wp_enqueue_style( 'twentynineteen-style', $url, array(), wp_get_theme()->get( 'Version' ) );
258+
wp_enqueue_style( 'twentynineteen-style', get_stylesheet_uri(), array(), wp_get_theme()->get( 'Version' ) );
259+
260+
wp_style_add_data( 'twentynineteen-style', 'rtl', 'replace' );
263261

264262
if ( has_nav_menu( 'menu-1' ) ) {
265263
wp_enqueue_script(
@@ -284,7 +282,7 @@ function twentynineteen_scripts() {
284282
);
285283
}
286284

287-
wp_enqueue_style( 'twentynineteen-print-style', twentynineteen_get_stylesheet_path( 'print.css' ), array(), wp_get_theme()->get( 'Version' ), 'print' );
285+
wp_enqueue_style( 'twentynineteen-print-style', get_template_directory_uri() . '/print.css', array(), wp_get_theme()->get( 'Version' ), 'print' );
288286

289287
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
290288
wp_enqueue_script( 'comment-reply' );
@@ -397,34 +395,3 @@ function twentynineteen_register_block_patterns() {
397395
}
398396

399397
add_action( 'init', 'twentynineteen_register_block_patterns' );
400-
401-
/**
402-
* Gets the path to a stylesheet file, minified if available and appropriate.
403-
*
404-
* @since Twenty Nineteen 3.2
405-
*
406-
* @param string $src_path Source path, relative to the theme root.
407-
* @return string URL to stylesheet.
408-
*/
409-
function twentynineteen_get_stylesheet_path( $src_path ) {
410-
$min_path = (string) preg_replace( '/(?=\.css$)/', '.min', $src_path );
411-
412-
$use_min = ! ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) && ! strpos( wp_get_wp_version(), '-src' );
413-
414-
if ( is_child_theme() ) {
415-
if ( $use_min && file_exists( get_stylesheet_directory() . '/' . $min_path ) ) {
416-
return get_stylesheet_directory_uri() . '/' . $min_path;
417-
}
418-
419-
if ( file_exists( get_stylesheet_directory() . '/' . $src_path ) ) {
420-
return get_stylesheet_directory_uri() . '/' . $src_path;
421-
}
422-
}
423-
424-
if ( $use_min && file_exists( get_template_directory() . '/' . $min_path ) ) {
425-
return get_template_directory_uri() . '/' . $min_path;
426-
}
427-
428-
return get_template_directory_uri() . '/' . $src_path;
429-
}
430-

0 commit comments

Comments
 (0)