tailwindlabs / tailwindcss-intellisense

Intelligent Tailwind CSS tooling for Visual Studio Code
2.75k stars 183 forks source link

[Color previewer]: No support for oklch (DaisyUI v4) #887

Closed bastiaanv closed 3 months ago

bastiaanv commented 6 months ago

What version of VS Code are you using?

v1.85.1

What version of Tailwind CSS IntelliSense are you using?

v0.10.3

What version of Tailwind CSS are you using?

v3.3.6

What package manager are you using?

npm

What DaisyUI version are you using?

v4.4.19 (dev dependency)

What operating system are you using?

MacOS

Tailwind config

/** @type {import('tailwindcss').Config} */
module.exports = {
    content: ["./src/**/*.{html,js}"],
    plugins: [require("daisyui")],
};

Describe your issue

The color previewer in VSCode does not show the oklch-colors correctly. Actual color: https://oklch.com/#49.12,0.3096,275.75,100

Screenshot 2023-12-19 at 16 09 58
thecrypticace commented 3 months ago

VSCode (and the language server protocol) only supports showing RGB colors. We could probably parse out newer color formats and convert them to their closest RGB counterpart but that means you'll only ever see an approximation.

I plan to look into this soon.

thecrypticace commented 3 months ago

Support for this is now in the pre-release version of the extension. We're now able to display color decorators for colors using lab, lch, oklab, and oklch. Given that these are wide-gamut color spaces the behaviors here are a bit different: