Skip to content

Commit ef61928

Browse files
committed
Skip whitespace in media queries
1 parent 91912ee commit ef61928

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,4 +1159,9 @@ mod tests {
11591159
minify_test(".foo { box-shadow: 12px 12px 0px 0px rgba(0,0,0,0.4) }", ".foo{box-shadow:12px 12px #0006}");
11601160
minify_test(".foo { box-shadow: 64px 64px 12px 40px rgba(0,0,0,0.4), 12px 12px 0px 8px rgba(0,0,0,0.4) inset }", ".foo{box-shadow:64px 64px 12px 40px #0006,inset 12px 12px 0 8px #0006}");
11611161
}
1162+
1163+
#[test]
1164+
fn test_media() {
1165+
minify_test("@media (min-width: 240px) { .foo { color: chartreuse }}", "@media (min-width:240px){.foo{color:#7fff00}}")
1166+
}
11621167
}

src/media_query.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ impl MediaFeatureExpression {
432432
// err.location
433433
// .new_custom_error(StyleParseErrorKind::MediaQueryExpectedFeatureValue)
434434
// })?;
435+
input.skip_whitespace();
435436
let value = exhaust(input);
436437

437438
Ok(MediaFeatureExpression {

0 commit comments

Comments
 (0)