@@ -33,6 +33,19 @@ ruleTester.run("no-invalid-at-rules", rule, {
3333 '@charset "UTF-8";' ,
3434 '@charset "UTF-8"; @import url("foo.css");' ,
3535 "@media screen and (max-width: 600px) { body { font-size: 12px; } }" ,
36+ ".foo { @media (max-width: 800px) { color: red; } }" ,
37+ ".foo { @media (max-width: 800px) { color: red; background: blue; font-size: 16px; } }" ,
38+ ".foo { @supports (display: grid) { display: grid; grid-template-columns: 1fr 1fr; } }" ,
39+ // TODO: Uncomment once https://github.com/eslint/csstree/issues/106 is fixed
40+ // ".foo { @layer base { color: red; } }",
41+ ".foo { @scope (.card) { color: red; } }" ,
42+ ".foo { @container (min-width: 700px) { color: red; } }" ,
43+ ".foo { @starting-style { opacity: 0; transform: translateY(-10px); } }" ,
44+ ".foo { @media (min-width: 768px) { color: red; @media (orientation: landscape) { background: blue; @supports (display: flex) { display: flex; } } } }" ,
45+ "@property --my-color { syntax: '<color>'; inherits: false; initial-value: #c0ffee; }" ,
46+ "@media (max-width: 800px) { .foo { color: red; } }" ,
47+ ".foo { @media (max-width: 800px) { & .bar { color: red; } &:hover { background: blue; } } }" ,
48+ "@layer base { .foo { color: red; } }" ,
3649 {
3750 code : "@foobar url(foo.css) { body { font-size: 12px } }" ,
3851 languageOptions : {
@@ -173,6 +186,19 @@ ruleTester.run("no-invalid-at-rules", rule, {
173186 } ,
174187 ] ,
175188 } ,
189+ {
190+ code : "@font-face { color: red; }" ,
191+ errors : [
192+ {
193+ messageId : "unknownDescriptor" ,
194+ data : { name : "font-face" , descriptor : "color" } ,
195+ line : 1 ,
196+ column : 14 ,
197+ endLine : 1 ,
198+ endColumn : 19 ,
199+ } ,
200+ ] ,
201+ } ,
176202 {
177203 code : "@property --foo { syntax: red; }" ,
178204 errors : [
0 commit comments