mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 10:12:42 +03:00
test(css/minifier): Add tests for layer (#6221)
This commit is contained in:
parent
1186c52ea4
commit
055bdcd997
@ -0,0 +1,68 @@
|
||||
@layer default, theme, components;
|
||||
@layer foo.bar;
|
||||
@layer foo.bar, baz;
|
||||
|
||||
@layer framework {
|
||||
@layer layout {
|
||||
@layer base {
|
||||
}
|
||||
}
|
||||
}
|
||||
@layer a{
|
||||
@layer b {
|
||||
div {color: yellow; margin: 0px;}
|
||||
}
|
||||
}
|
||||
|
||||
@layer framework {
|
||||
@layer base {
|
||||
p { margin-block: 0.75em; }
|
||||
}
|
||||
|
||||
@layer theme {
|
||||
p { color: #222; }
|
||||
}
|
||||
}
|
||||
|
||||
@layer framework.theme {
|
||||
/* These styles will be added to the theme layer inside the framework layer */
|
||||
blockquote { color: rebeccapurple; }
|
||||
}
|
||||
|
||||
@layer {
|
||||
@layer foo {
|
||||
color: red;
|
||||
}
|
||||
@layer foo {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
@layer {
|
||||
@layer foo { color: red; }
|
||||
}
|
||||
@layer {
|
||||
@layer foo { color: red; }
|
||||
}
|
||||
|
||||
@layer framework {
|
||||
h1, h2 { color: maroon; background: white;}
|
||||
|
||||
@media (prefers-color-scheme: dark) {
|
||||
h1, h2 { color: red; background: black; }
|
||||
}
|
||||
}
|
||||
|
||||
@layer foo {
|
||||
.foo {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
@layer foo {
|
||||
.foo {
|
||||
background: #fff;
|
||||
}
|
||||
.baz {
|
||||
color: #fff;
|
||||
}
|
||||
}
|
1
crates/swc_css_minifier/tests/fixture/compress-at-rule/layer/output.min.css
vendored
Normal file
1
crates/swc_css_minifier/tests/fixture/compress-at-rule/layer/output.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
@layer default,theme,components;@layer foo.bar;@layer foo.bar,baz;@layer framework{}@layer a{@layer b{div{color:yellow;margin:0}}}@layer framework{@layer base{p{margin-block:.75em}}@layer theme{p{color:#222}}}@layer framework.theme{blockquote{color:rebeccapurple}}@layer{@layer foo{color: red;}@layer foo{color: red;}}@layer{@layer foo{color: red;}}@layer{@layer foo{color: red;}}@layer framework{h1,h2{color:maroon;background:white}@media(prefers-color-scheme:dark){h1,h2{color:red;background:black}}}@layer foo{.foo{color:red}}@layer foo{.foo{background:#fff}.baz{color:#fff}}
|
Loading…
Reference in New Issue
Block a user