File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1468,6 +1468,11 @@ describe('CSS grammar - semantic', () => {
1468
1468
1469
1469
style {}
1470
1470
color: red;
1471
+ override-colors: 0 currentcolor;
1472
+ override-colors: 0 AccentColor;
1473
+ override-colors: 0 light-dark(red, red);
1474
+ override-colors: 0 contrast-color(red);
1475
+ override-colors: 0 device-cmyk(0 0 0 0);
1471
1476
1472
1477
base-palette: initial;
1473
1478
base-palette: inherit(--custom);
Original file line number Diff line number Diff line change @@ -250,6 +250,25 @@ function postParseCalcValue(value) {
250
250
return value . types [ 0 ] === '<simple-block>' ? value . value : value
251
251
}
252
252
253
+ /**
254
+ * @param {object } color
255
+ * @param {object } node
256
+ * @returns {SyntaxError|object }
257
+ * @see {@link https://drafts.csswg.org/css-fonts-4/#descdef-font-palette-values-override-colors }
258
+ *
259
+ * It aborts parsing when the color is not an absolute color for override-colors
260
+ * in @font-palette-values.
261
+ */
262
+ function postParseColor ( color , node ) {
263
+ if (
264
+ node . context . declaration ?. definition . name === 'override-colors'
265
+ && ! color . types . includes ( '<color-base>' )
266
+ ) {
267
+ return error ( node )
268
+ }
269
+ return color
270
+ }
271
+
253
272
/**
254
273
* @param {object|object[] } schemes
255
274
* @param {object } node
You can’t perform that action at this time.
0 commit comments