fix(css/minifier): Don't touch @supports (#6199)

This commit is contained in:
Alexander Akait 2022-10-19 05:51:49 +03:00 committed by GitHub
parent 287c2f2941
commit ac7cfa13b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View File

@ -213,7 +213,11 @@ impl VisitMut for Compressor {
..self.ctx
}));
self.compress_calc_sum(n);
// Don't touch `@supports`, it can be used to check a browser's support for one
// or more specific CSS features
if !self.in_supports_conidition {
self.compress_calc_sum(n);
}
}
fn visit_mut_component_value(&mut self, n: &mut ComponentValue) {

View File

@ -21,3 +21,9 @@
background: red;
}
}
@supports (width: calc(100px * sqrt(9))) {
div {
background: red;
}
}

View File

@ -1 +1 @@
@supports(width:200px){div{background:red}}@supports(width:200px){div{background:red}}@supports(width:0){div{background:red}}@supports(width:0){div{background:red}}
@supports(width:calc(100px + 100px)){div{background:red}}@supports(width:calc(100px + 100px)){div{background:red}}@supports(width:calc(0px*100)){div{background:red}}@supports(width:calc(0px + 0px)){div{background:red}}@supports(width:calc(100px*sqrt(9))){div{background:red}}