Skip to content

Commit adcd980

Browse files
committed
Calculate swatches for HSL colors with angular units
1 parent 1c77f60 commit adcd980

File tree

1 file changed

+1
-1
lines changed
  • packages/tailwindcss-language-service/src/util

1 file changed

+1
-1
lines changed

packages/tailwindcss-language-service/src/util/color.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function getKeywordColor(value: unknown): KeywordColor | null {
5050

5151
// https://github.com/khalilgharbaoui/coloregex
5252
const colorRegex = new RegExp(
53-
`(?:^|\\s|\\(|,)(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgba?|hsla?|(?:ok)?(?:lab|lch))\\(\\s*(-?[\\d.]+%?(\\s*[,/]\\s*|\\s+)+){2,3}\\s*([\\d.]+%?|var\\([^)]+\\))?\\)|transparent|currentColor|${Object.keys(
53+
`(?:^|\\s|\\(|,)(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgba?|hsla?|(?:ok)?(?:lab|lch))\\(\\s*(-?[\\d.]+(%|deg|rad|grad|turn)?(\\s*[,/]\\s*|\\s+)+){2,3}\\s*([\\d.]+%?|var\\([^)]+\\))?\\)|transparent|currentColor|${Object.keys(
5454
namedColors,
5555
).join('|')})(?:$|\\s|\\)|,)`,
5656
'gi',

0 commit comments

Comments
 (0)