Skip to content

Commit de4cb54

Browse files
authored
fix (optimize css): mobile styles can override tablet styles (#3346)
Happens if the very first style encountered in the editor is a mobile style. fixes #3345 Co-authored-by: [email protected] <>
1 parent 8e29e60 commit de4cb54

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/css-optimize.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ public static function generate_css( $styles ) {
396396

397397
foreach ( $style_matches[1] as $i => $media_query ) {
398398
$media_query = ! empty( $media_query ) ? substr( $media_query, 0, -1 ) : $media_query;
399+
$media_query = str_replace( 'width: ', 'width:', $media_query ); // Ensure that the media query is consistent.
399400
$selector = $style_matches[2][ $i ];
400401
$style_rule = $style_matches[3][ $i ];
401402

0 commit comments

Comments
 (0)