Skip to content

Commit 4678b07

Browse files
committed
css-syntax-patches-for-csstree: fix relative color and clip
1 parent a9cc53e commit 4678b07

File tree

8 files changed

+122
-76
lines changed

8 files changed

+122
-76
lines changed

packages/css-syntax-patches-for-csstree/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changes to CSS Syntax Patches For CSSTree
22

3+
### Unreleased (patch)
4+
5+
- Patch `clip: rect()` to preserve legacy syntax
6+
- Patch color functions to support relative color component keywords
7+
8+
39
### 1.0.17
410

511
_November 21, 2025_

packages/css-syntax-patches-for-csstree/dist/index.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@
165165
"caret": "<'caret-color'> || <'caret-animation'> || <'caret-shape'>",
166166
"caret-animation": "auto | manual",
167167
"clear": "| block-start | block-end | top | bottom | both-inline | both-block",
168-
"clip": "rect( <top> , <right> , <bottom> , <left> ) | auto",
168+
"clip": "rect( <top> , <right> , <bottom> , <left> ) | rect( <top> <right> <bottom> <left> ) | auto",
169169
"color-adjust": "<'print-color-adjust'>",
170170
"color-interpolation": "auto | sRGB | linearRGB",
171171
"column-count": "auto | <integer [1,∞]>",
@@ -508,7 +508,7 @@
508508
"types": {
509509
"dashed-ident": "<custom-property-name>",
510510
"unicode-range-token": "<urange>",
511-
"alpha()": "alpha( [ from <color> ] [ / [ <alpha-value> | none ] ]? )",
511+
"alpha()": "alpha( [ from <color> ] [ / [ <alpha-value> | alpha | none ] ]? )",
512512
"anchor-size()": "anchor-size( [ <anchor-name> || <anchor-size> ]? , <length-percentage>? )",
513513
"anchor()": "anchor( <anchor-name>? && <anchor-side> , <length-percentage>? )",
514514
"anchored-feature": "fallback : <'position-try-fallbacks'>",
@@ -561,7 +561,7 @@
561561
"color-stop-angle": "[ <angle-percentage> | <zero> ]{1,2}",
562562
"color-stop-list": "<linear-color-stop> , [ <linear-color-hint>? , <linear-color-stop> ]#?",
563563
"color-stripe": "<color> && [ <length-percentage> | <flex> ]?",
564-
"color()": "color( [ from <color> ]? <colorspace-params> [ / [ <alpha-value> | none ] ]? )",
564+
"color()": "color( [ from <color> ]? [ <custom-params> | [ <predefined-rgb> [ <number> | <percentage> | r | g | b | alpha | none ]{3} [ / [ <alpha-value> | r | g | b | alpha | none ] ]? ] | [ <xyz-space> [ <number> | <percentage> | x | y | z | alpha | none ]{3} [ / [ <alpha-value> | x | y | z | alpha | none ] ]? ] ] )",
565565
"colorspace-params": "[ <custom-params> | <predefined-rgb-params> | <xyz-params> ]",
566566
"command-end-point": "[ to <position> | by <coordinate-pair> ]",
567567
"compat-special": "textfield | menulist-button",
@@ -632,7 +632,7 @@
632632
"hsl()": "[ <legacy-hsl-syntax> | <modern-hsl-syntax> ]",
633633
"hsla()": "[ <legacy-hsla-syntax> | <modern-hsla-syntax> ]",
634634
"hue-rotate()": "hue-rotate( [ <angle> | <zero> ]? )",
635-
"hwb()": "hwb( [ from <color> ]? [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
635+
"hwb()": "hwb( [ from <color> ]? [ <hue> | h | w | b | alpha | none ] [ <percentage> | <number> | h | w | b | alpha | none ] [ <percentage> | <number> | h | w | b | alpha | none ] [ / [ <alpha-value> | h | w | b | alpha | none ] ]? )",
636636
"ictcp()": "ictcp( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
637637
"ident-arg": "<string> | <integer> | <ident>",
638638
"ident()": "ident( <ident-arg>+ )",
@@ -658,9 +658,9 @@
658658
"jzazbz()": "jzazbz( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
659659
"jzczhz()": "jzczhz( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <hue> | none ] [ / [ <alpha-value> | none ] ]? )",
660660
"keyframe-selector": "from | to | <percentage [0,100]> | <timeline-range-name> <percentage>",
661-
"lab()": "lab( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
661+
"lab()": "lab( [ from <color> ]? [ <percentage> | <number> | l | a | b | alpha | none ] [ <percentage> | <number> | l | a | b | alpha | none ] [ <percentage> | <number> | l | a | b | alpha | none ] [ / [ <alpha-value> | l | a | b | alpha | none ] ]? )",
662662
"layout-box": "<visual-box> | margin-box",
663-
"lch()": "lch( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <hue> | none ] [ / [ <alpha-value> | none ] ]? )",
663+
"lch()": "lch( [ from <color> ]? [ <percentage> | <number> | l | c | h | alpha | none ] [ <percentage> | <number> | l | c | h | alpha | none ] [ <hue> | l | c | h | alpha | none ] [ / [ <alpha-value> | l | c | h | alpha | none ] ]? )",
664664
"legacy-border-radius-syntax": "<length-percentage [0,∞]>{1,2}",
665665
"legacy-hsl-syntax": "hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )",
666666
"legacy-hsla-syntax": "hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )",
@@ -691,15 +691,15 @@
691691
"mf-gt": "'>' '='?",
692692
"mf-lt": "'<' '='?",
693693
"mf-range": "<mf-name> <mf-comparison> <mf-value> | <mf-value> <mf-comparison> <mf-name> | <mf-value> <mf-lt> <mf-name> <mf-lt> <mf-value> | <mf-value> <mf-gt> <mf-name> <mf-gt> <mf-value>",
694-
"modern-hsl-syntax": "hsl( [ from <color> ]? [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
695-
"modern-hsla-syntax": "hsla( [ from <color> ]? [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
696-
"modern-rgb-syntax": "rgb( [ from <color> ]? [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )",
697-
"modern-rgba-syntax": "rgba( [ from <color> ]? [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )",
694+
"modern-hsl-syntax": "hsl( [ from <color> ]? [ <hue> | h | s | l | alpha | none ] [ <percentage> | <number> | h | s | l | alpha | none ] [ <percentage> | <number> | h | s | l | alpha | none ] [ / [ <alpha-value> | h | s | l | alpha | none ] ]? )",
695+
"modern-hsla-syntax": "hsla( [ from <color> ]? [ <hue> | h | s | l | alpha | none ] [ <percentage> | <number> | h | s | l | alpha | none ] [ <percentage> | <number> | h | s | l | alpha | none ] [ / [ <alpha-value> | h | s | l | alpha | none ] ]? )",
696+
"modern-rgb-syntax": "rgb( [ from <color> ]? [ <number> | <percentage> | r | g | b | alpha | none ]{3} [ / [ <alpha-value> | r | g | b | alpha | none ] ]? )",
697+
"modern-rgba-syntax": "rgba( [ from <color> ]? [ <number> | <percentage> | r | g | b | alpha | none ]{3} [ / [ <alpha-value> | r | g | b | alpha | none ] ]? )",
698698
"move-command": "move <command-end-point>",
699699
"mq-boolean": "<integer [0,1]>",
700700
"number-optional-number": "<number> <number>?",
701-
"oklab()": "oklab( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
702-
"oklch()": "oklch( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <hue> | none ] [ / [ <alpha-value> | none ] ]? )",
701+
"oklab()": "oklab( [ from <color> ]? [ <percentage> | <number> | l | a | b | alpha | none ] [ <percentage> | <number> | l | a | b | alpha | none ] [ <percentage> | <number> | l | a | b | alpha | none ] [ / [ <alpha-value> | l | a | b | alpha | none ] ]? )",
702+
"oklch()": "oklch( [ from <color> ]? [ <percentage> | <number> | l | c | h | alpha | none ] [ <percentage> | <number> | l | c | h | alpha | none ] [ <hue> | l | c | h | alpha | none ] [ / [ <alpha-value> | l | c | h | alpha | none ] ]? )",
703703
"opacity-value": "<number> | <percentage>",
704704
"opacity()": "opacity( [ <number> | <percentage> ]? )",
705705
"opentype-tag": "<string>",

packages/css-syntax-patches-for-csstree/patches/webref-over-csstree-properties.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1678,12 +1678,15 @@
16781678
"type": "modified",
16791679
"comment": "",
16801680
"syntax-b": "<shape> | auto",
1681-
"syntax-a": "rect( <top> , <right> , <bottom> , <left> ) | auto",
1682-
"syntax-m": "rect( <top> , <right> , <bottom> , <left> ) | auto",
1681+
"syntax-a": "rect( <top> , <right> , <bottom> , <left> ) | rect( <top> <right> <bottom> <left> ) | auto",
1682+
"syntax-m": "rect( <top> , <right> , <bottom> , <left> ) | rect( <top> <right> <bottom> <left> ) | auto",
16831683
"tests": {
16841684
"passing": [
16851685
{
16861686
"value": "rect(1px, 2px, 3px, 4px)"
1687+
},
1688+
{
1689+
"value": "rect(1px 2px 3px 4px)"
16871690
}
16881691
],
16891692
"failing": []

packages/css-syntax-patches-for-csstree/patches/webref-over-csstree-types.json

Lines changed: 95 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,28 @@
44
"comment": "",
55
"syntax-b": "",
66
"syntax-a": "alpha( [ from <color> ] [ / [ <alpha-value> | none ] ]? )",
7-
"syntax-m": "alpha( [ from <color> ] [ / [ <alpha-value> | none ] ]? )",
7+
"syntax-m": "alpha( [ from <color> ] [ / [ <alpha-value> | alpha | none ] ]? )",
88
"tests": {
9-
"passing": [],
10-
"failing": []
9+
"passing": [
10+
{
11+
"property": "color",
12+
"value": "alpha(from oklch(60% 0.25 315 / 0.3) / 80%)"
13+
},
14+
{
15+
"property": "color",
16+
"value": "alpha(from oklch(60% 0.25 315 / 0.3) / alpha)"
17+
},
18+
{
19+
"property": "color",
20+
"value": "alpha(from oklch(60% 0.25 315 / 0.3) / calc(alpha / 2))"
21+
}
22+
],
23+
"failing": [
24+
{
25+
"property": "color",
26+
"value": "alpha(from oklch(60% 0.25 315 / 0.3) / a)"
27+
}
28+
]
1129
}
1230
},
1331
"an+b": {
@@ -908,7 +926,7 @@
908926
"comment": "",
909927
"syntax-b": "color( <colorspace-params> [ / [ <alpha-value> | none ] ]? )",
910928
"syntax-a": "color( [ from <color> ]? <colorspace-params> [ / [ <alpha-value> | none ] ]? )",
911-
"syntax-m": "color( [ from <color> ]? <colorspace-params> [ / [ <alpha-value> | none ] ]? )",
929+
"syntax-m": "color( [ from <color> ]? [ <custom-params> | [ <predefined-rgb> [ <number> | <percentage> | r | g | b | alpha | none ]{3} [ / [ <alpha-value> | r | g | b | alpha | none ] ]? ] | [ <xyz-space> [ <number> | <percentage> | x | y | z | alpha | none ]{3} [ / [ <alpha-value> | x | y | z | alpha | none ] ]? ] ] )",
912930
"tests": {
913931
"passing": [
914932
{
@@ -918,12 +936,28 @@
918936
{
919937
"property": "color",
920938
"value": "color(from red xyz 0 0 0)"
939+
},
940+
{
941+
"property": "color",
942+
"value": "color(from red xyz x y z / alpha)"
943+
},
944+
{
945+
"property": "color",
946+
"value": "color(from red srgb r g b / alpha)"
921947
}
922948
],
923949
"failing": [
924950
{
925951
"property": "color",
926952
"value": "color(red from xyz 0 0 0)"
953+
},
954+
{
955+
"property": "color",
956+
"value": "color(from red xyz r g b)"
957+
},
958+
{
959+
"property": "color",
960+
"value": "color(from red srgb x y z)"
927961
}
928962
]
929963
}
@@ -1935,7 +1969,7 @@
19351969
"comment": "",
19361970
"syntax-b": "hwb( [ <hue> | none ] [ <percentage> | none ] [ <percentage> | none ] [ / [ <alpha-value> | none ] ]? )",
19371971
"syntax-a": "hwb( [ from <color> ]? [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
1938-
"syntax-m": "hwb( [ from <color> ]? [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
1972+
"syntax-m": "hwb( [ from <color> ]? [ <hue> | h | w | b | alpha | none ] [ <percentage> | <number> | h | w | b | alpha | none ] [ <percentage> | <number> | h | w | b | alpha | none ] [ / [ <alpha-value> | h | w | b | alpha | none ] ]? )",
19391973
"tests": {
19401974
"passing": [
19411975
{
@@ -2304,7 +2338,7 @@
23042338
"comment": "",
23052339
"syntax-b": "lab( [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
23062340
"syntax-a": "lab( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
2307-
"syntax-m": "lab( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
2341+
"syntax-m": "lab( [ from <color> ]? [ <percentage> | <number> | l | a | b | alpha | none ] [ <percentage> | <number> | l | a | b | alpha | none ] [ <percentage> | <number> | l | a | b | alpha | none ] [ / [ <alpha-value> | l | a | b | alpha | none ] ]? )",
23082342
"tests": {
23092343
"passing": [
23102344
{
@@ -2356,7 +2390,7 @@
23562390
"comment": "",
23572391
"syntax-b": "lch( [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <hue> | none ] [ / [ <alpha-value> | none ] ]? )",
23582392
"syntax-a": "lch( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <hue> | none ] [ / [ <alpha-value> | none ] ]? )",
2359-
"syntax-m": "lch( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <hue> | none ] [ / [ <alpha-value> | none ] ]? )",
2393+
"syntax-m": "lch( [ from <color> ]? [ <percentage> | <number> | l | c | h | alpha | none ] [ <percentage> | <number> | l | c | h | alpha | none ] [ <hue> | l | c | h | alpha | none ] [ / [ <alpha-value> | l | c | h | alpha | none ] ]? )",
23602394
"tests": {
23612395
"passing": [
23622396
{
@@ -2892,7 +2926,7 @@
28922926
"comment": "",
28932927
"syntax-b": "",
28942928
"syntax-a": "hsl( [ from <color> ]? [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
2895-
"syntax-m": "hsl( [ from <color> ]? [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
2929+
"syntax-m": "hsl( [ from <color> ]? [ <hue> | h | s | l | alpha | none ] [ <percentage> | <number> | h | s | l | alpha | none ] [ <percentage> | <number> | h | s | l | alpha | none ] [ / [ <alpha-value> | h | s | l | alpha | none ] ]? )",
28962930
"tests": {
28972931
"passing": [
28982932
{
@@ -2926,6 +2960,10 @@
29262960
{
29272961
"property": "color",
29282962
"value": "hsl(from hsl(0.5turn 5 10) 0.5turn 5 10)"
2963+
},
2964+
{
2965+
"property": "color",
2966+
"value": "hsl(from hsl(0.5turn 5 10) h s l / alpha)"
29292967
}
29302968
],
29312969
"failing": [
@@ -2941,7 +2979,7 @@
29412979
"comment": "",
29422980
"syntax-b": "",
29432981
"syntax-a": "hsla( [ from <color> ]? [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
2944-
"syntax-m": "hsla( [ from <color> ]? [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
2982+
"syntax-m": "hsla( [ from <color> ]? [ <hue> | h | s | l | alpha | none ] [ <percentage> | <number> | h | s | l | alpha | none ] [ <percentage> | <number> | h | s | l | alpha | none ] [ / [ <alpha-value> | h | s | l | alpha | none ] ]? )",
29452983
"tests": {
29462984
"passing": [
29472985
{
@@ -2975,6 +3013,10 @@
29753013
{
29763014
"property": "color",
29773015
"value": "hsla(from hsla(0.5turn 5 10) 0.5turn 5 10)"
3016+
},
3017+
{
3018+
"property": "color",
3019+
"value": "hsla(from hsla(0.5turn 5 10) h s l / alpha)"
29783020
}
29793021
],
29803022
"failing": [
@@ -2990,7 +3032,7 @@
29903032
"comment": "",
29913033
"syntax-b": "",
29923034
"syntax-a": "rgb( [ from <color> ]? [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )",
2993-
"syntax-m": "rgb( [ from <color> ]? [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )",
3035+
"syntax-m": "rgb( [ from <color> ]? [ <number> | <percentage> | r | g | b | alpha | none ]{3} [ / [ <alpha-value> | r | g | b | alpha | none ] ]? )",
29943036
"tests": {
29953037
"passing": [
29963038
{
@@ -3024,12 +3066,32 @@
30243066
{
30253067
"property": "color",
30263068
"value": "rgb(from rgb(20% 5 10) 20% 5 10)"
3069+
},
3070+
{
3071+
"property": "color",
3072+
"value": "rgb(from rgb(20% 5 10) r g b / alpha)"
3073+
},
3074+
{
3075+
"property": "color",
3076+
"value": "rgb(from rgb(20% 5 10) alpha alpha alpha / alpha)"
3077+
},
3078+
{
3079+
"property": "color",
3080+
"value": "rgb(from rgb(20% 5 10) r r r / r)"
3081+
},
3082+
{
3083+
"property": "color",
3084+
"value": "rgb(from rgb(20% 5 10) calc(r / 2) calc(g / 2) calc(b / 2) / calc(alpha / 2))"
30273085
}
30283086
],
30293087
"failing": [
30303088
{
30313089
"property": "color",
30323090
"value": "rgb(20% 10 5, 0.5)"
3091+
},
3092+
{
3093+
"property": "color",
3094+
"value": "rgb(from rgb(20% 5 10) red green blue / a)"
30333095
}
30343096
]
30353097
}
@@ -3039,7 +3101,7 @@
30393101
"comment": "",
30403102
"syntax-b": "",
30413103
"syntax-a": "rgba( [ from <color> ]? [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )",
3042-
"syntax-m": "rgba( [ from <color> ]? [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )",
3104+
"syntax-m": "rgba( [ from <color> ]? [ <number> | <percentage> | r | g | b | alpha | none ]{3} [ / [ <alpha-value> | r | g | b | alpha | none ] ]? )",
30433105
"tests": {
30443106
"passing": [
30453107
{
@@ -3073,12 +3135,32 @@
30733135
{
30743136
"property": "color",
30753137
"value": "rgba(from rgba(20% 5 10) 20% 5 10)"
3138+
},
3139+
{
3140+
"property": "color",
3141+
"value": "rgba(from rgb(20% 5 10) r g b / alpha)"
3142+
},
3143+
{
3144+
"property": "color",
3145+
"value": "rgba(from rgb(20% 5 10) alpha alpha alpha / alpha)"
3146+
},
3147+
{
3148+
"property": "color",
3149+
"value": "rgba(from rgb(20% 5 10) r r r / r)"
3150+
},
3151+
{
3152+
"property": "color",
3153+
"value": "rgba(from rgb(20% 5 10) calc(r / 2) calc(g / 2) calc(b / 2) / calc(alpha / 2))"
30763154
}
30773155
],
30783156
"failing": [
30793157
{
30803158
"property": "color",
30813159
"value": "rgba(20% 10 5, 0.5)"
3160+
},
3161+
{
3162+
"property": "color",
3163+
"value": "rgb(from rgb(20% 5 10) red green blue / a)"
30823164
}
30833165
]
30843166
}
@@ -3121,7 +3203,7 @@
31213203
"comment": "",
31223204
"syntax-b": "oklab( [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
31233205
"syntax-a": "oklab( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
3124-
"syntax-m": "oklab( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
3206+
"syntax-m": "oklab( [ from <color> ]? [ <percentage> | <number> | l | a | b | alpha | none ] [ <percentage> | <number> | l | a | b | alpha | none ] [ <percentage> | <number> | l | a | b | alpha | none ] [ / [ <alpha-value> | l | a | b | alpha | none ] ]? )",
31253207
"tests": {
31263208
"passing": [
31273209
{
@@ -3162,7 +3244,7 @@
31623244
"comment": "",
31633245
"syntax-b": "oklch( [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <hue> | none ] [ / [ <alpha-value> | none ] ]? )",
31643246
"syntax-a": "oklch( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <hue> | none ] [ / [ <alpha-value> | none ] ]? )",
3165-
"syntax-m": "oklch( [ from <color> ]? [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ <hue> | none ] [ / [ <alpha-value> | none ] ]? )",
3247+
"syntax-m": "oklch( [ from <color> ]? [ <percentage> | <number> | l | c | h | alpha | none ] [ <percentage> | <number> | l | c | h | alpha | none ] [ <hue> | l | c | h | alpha | none ] [ / [ <alpha-value> | l | c | h | alpha | none ] ]? )",
31663248
"tests": {
31673249
"passing": [
31683250
{

packages/css-syntax-patches-for-csstree/raw-data/webref-over-csstree-properties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@
632632
"clip": {
633633
"type": "modified",
634634
"syntax-b": "<shape> | auto",
635-
"syntax-a": "rect( <top> , <right> , <bottom> , <left> ) | auto",
635+
"syntax-a": "rect( <top> , <right> , <bottom> , <left> ) | rect( <top> <right> <bottom> <left> ) | auto",
636636
"comment": ""
637637
},
638638
"color-adjust": {

packages/css-syntax-patches-for-csstree/raw-data/webref-properties.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@
573573
"syntax": "inline-start | inline-end | block-start | block-end | left | right | top | bottom | both-inline | both-block | both | none"
574574
},
575575
"clip": {
576-
"syntax": "rect( <top> , <right> , <bottom> , <left> ) | auto"
576+
"syntax": "rect( <top> , <right> , <bottom> , <left> ) | rect( <top> <right> <bottom> <left> ) | auto"
577577
},
578578
"clip-path": {
579579
"syntax": "<clip-source> | [ <basic-shape> || <geometry-box> ] | none"

packages/css-syntax-patches-for-csstree/scripts/generate-webref-sets.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export async function generate_webref_sets() {
109109
}
110110

111111
if (property.name === 'clip') {
112-
property.syntax = 'rect( <top>, <right>, <bottom>, <left> ) | auto';
112+
property.syntax = 'rect( <top> , <right> , <bottom> , <left> ) | rect( <top> <right> <bottom> <left> ) | auto';
113113
}
114114

115115
if (!property.syntax) {

0 commit comments

Comments
 (0)