mirror of
https://github.com/swc-project/swc.git
synced 2024-10-04 20:28:43 +03:00
fix(css/minifier): Don't touch @supports
(#6199)
This commit is contained in:
parent
287c2f2941
commit
ac7cfa13b6
@ -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) {
|
||||
|
@ -21,3 +21,9 @@
|
||||
background: red;
|
||||
}
|
||||
}
|
||||
|
||||
@supports (width: calc(100px * sqrt(9))) {
|
||||
div {
|
||||
background: red;
|
||||
}
|
||||
}
|
||||
|
@ -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}}
|
||||
|
Loading…
Reference in New Issue
Block a user