Skip to content

Commit

Permalink
feat(css): Add missing css color() function (#858)
Browse files Browse the repository at this point in the history
feat(css): Add missing css `color()` function

Co-authored-by: Brian Smith <brian@smith.berlin>
  • Loading branch information
skyclouds2001 and bsmth authored Jan 8, 2025
1 parent 0435f3a commit 397906c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
8 changes: 8 additions & 0 deletions css/functions.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,14 @@
"status": "standard",
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/clamp"
},
"color()": {
"syntax": "color( [from <color>]? <colorspace-params> [ / [ <alpha-value> | none ] ]? )",
"groups": [
"CSS Color"
],
"status": "standard",
"mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/color"
},
"conic-gradient()": {
"syntax": "conic-gradient( [ from <angle> ]? [ at <position> ]?, <angular-color-stop-list> )",
"groups": [
Expand Down
21 changes: 21 additions & 0 deletions css/syntaxes.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@
"color": {
"syntax": "<rgb()> | <rgba()> | <hsl()> | <hsla()> | <hwb()> | <lab()> | <lch()> | <oklab()> | <oklch()> | <color()> | <hex-color> | <named-color> | <system-color> | <deprecated-system-color> | currentcolor | transparent"
},
"color()": {
"syntax": "color( [from <color>]? <colorspace-params> [ / [ <alpha-value> | none ] ]? )"
},
"color-interpolation-method": {
"syntax": "in [ <rectangular-color-space> | <polar-color-space> <hue-interpolation-method>? ]"
},
Expand All @@ -161,6 +164,9 @@
"color-stop-list": {
"syntax": "[ <linear-color-stop> [, <linear-color-hint>]? ]# , <linear-color-stop>"
},
"colorspace-params": {
"syntax": "[<custom-params> | <predefined-rgb-params> | <xyz-params>]"
},
"combinator": {
"syntax": "'>' | '+' | '~' | [ '||' ]"
},
Expand Down Expand Up @@ -239,6 +245,9 @@
"cubic-bezier-timing-function": {
"syntax": "ease | ease-in | ease-out | ease-in-out | cubic-bezier(<number [0,1]>, <number>, <number [0,1]>, <number>)"
},
"custom-params": {
"syntax": "<dashed-ident> [ <number> | <percentage> | none ]+"
},
"dasharray": {
"syntax": "[ [ <length-percentage> | <number> ]+ ]#"
},
Expand Down Expand Up @@ -674,6 +683,12 @@
"pow()": {
"syntax": "pow( <calc-sum>, <calc-sum> )"
},
"predefined-rgb": {
"syntax": "srgb | srgb-linear | display-p3 | a98-rgb | prophoto-rgb | rec2020"
},
"predefined-rgb-params": {
"syntax": "<predefined-rgb> [ <number> | <percentage> | none ]{3}"
},
"pseudo-class-selector": {
"syntax": "':' <ident-token> | ':' <function-token> <any-value> ')'"
},
Expand Down Expand Up @@ -976,5 +991,11 @@
},
"wq-name": {
"syntax": "<ns-prefix>? <ident-token>"
},
"xyz": {
"syntax": "xyz | xyz-d50 | xyz-d65"
},
"xyz-params": {
"syntax": "<xyz> [ <number> | <percentage> | none ]{3}"
}
}

0 comments on commit 397906c

Please sign in to comment.