@@ -164,6 +164,12 @@ ruleTester.run("no-invalid-properties", rule, {
164164 code : ":root { --a: var(--c); --b: var(--a); }\na { color: var(--b); }" ,
165165 options : [ { allowUnknownVariables : true } ] ,
166166 } ,
167+ "@supports (color: color(display-p3 1 1 1)) { a { --my-color: oklch(73.5% 0.1192 254.8); } }" ,
168+ "@supports not (color: color(display-p3 1 1 1)) { a { --my-color: rgb(31 120 50); } }" ,
169+ "@supports selector(:is(a)) { a { color: red; } }" ,
170+ "@media (color-gamut: srgb) { a { --my-color: #f4ae8a; } }" ,
171+ "@supports (color: color(display-p3 1 1 1)) { @media (color-gamut: p3) { a { --c: oklch(50% 0.1 120); } } }" ,
172+ "@import 'x.css' layer(theme);" ,
167173
168174 /*
169175 * CSSTree doesn't currently support custom functions properly, so leaving
@@ -427,6 +433,21 @@ ruleTester.run("no-invalid-properties", rule, {
427433 } ,
428434 ] ,
429435 } ,
436+ {
437+ code : "@supports (color: color(display-p3 1 1 1)) { a { color: var(--my-color); } }" ,
438+ errors : [
439+ {
440+ messageId : "unknownVar" ,
441+ data : {
442+ var : "--my-color" ,
443+ } ,
444+ line : 1 ,
445+ column : 61 ,
446+ endLine : 1 ,
447+ endColumn : 71 ,
448+ } ,
449+ ] ,
450+ } ,
430451 {
431452 code : "a { color: var(--MY-COLOR, var(--FALLBACK-COLOR)); }" ,
432453 errors : [
@@ -566,6 +587,23 @@ ruleTester.run("no-invalid-properties", rule, {
566587 } ,
567588 ] ,
568589 } ,
590+ {
591+ code : ":root { --color: foo }\n@supports (color: color(display-p3 1 1 1)) { a { color: var(--color); } }" ,
592+ errors : [
593+ {
594+ messageId : "invalidPropertyValue" ,
595+ data : {
596+ property : "color" ,
597+ value : "foo" ,
598+ expected : "<color>" ,
599+ } ,
600+ line : 2 ,
601+ column : 57 ,
602+ endLine : 2 ,
603+ endColumn : 69 ,
604+ } ,
605+ ] ,
606+ } ,
569607 {
570608 code : "a { colorr: var(--my-color); }" ,
571609 options : [ { allowUnknownVariables : true } ] ,
@@ -1103,6 +1141,23 @@ ruleTester.run("no-invalid-properties", rule, {
11031141 } ,
11041142 ] ,
11051143 } ,
1144+ {
1145+ code : "@supports (color: color(display-p3 1 1 1)) { a { color: foo } }" ,
1146+ errors : [
1147+ {
1148+ messageId : "invalidPropertyValue" ,
1149+ data : {
1150+ property : "color" ,
1151+ value : "foo" ,
1152+ expected : "<color>" ,
1153+ } ,
1154+ line : 1 ,
1155+ column : 57 ,
1156+ endLine : 1 ,
1157+ endColumn : 60 ,
1158+ } ,
1159+ ] ,
1160+ } ,
11061161 {
11071162 code : "a { padding: calc(var(--padding-top, 1px) + 1px) 2px calc(var(--padding-bottom) + 1px); }" ,
11081163 errors : [
0 commit comments