Skip to content

OKLCH Colors not displayed when units are used #1435

@dcbroad3

Description

@dcbroad3

What version of VS Code are you using?
v1.103.1

What version of Tailwind CSS IntelliSense are you using?
v0.14.26

What version of Tailwind CSS are you using?
v4.1.11

What package manager are you using?
npm

What operating system are you using?
Windows

Tailwind CSS Stylesheet (v4) or config file (v3)

Stylesheet (v4)

@theme inline {
  --color-test: oklch(63.4% 0.206 256deg);
}

VS Code settings

Can provide if necessary

Reproduction URL

Can provide if necessary

Describe your issue

When using OKLCH colors in the CSS theme declaration, the Tailwind CSS Intellisense plugin will only display color swatches if they are declared without units, e.g. oklch(.634 0.206 256). If they are declared with units (as Stylelint requires), they are not recognized at all, e.g. oklch(63.4% 0.206 256deg).

Image Image

(Red errors on the second screenshot are from Stylelint, which expects units to be specified)

I can disable this Stylelint rule, but it does seem like there is a parsing issue here for OKLCH colors.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions