Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
bastiaanv opened this issue Dec 19, 2023 · 2 comments · Fixed by #936
Closed

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

bastiaanv opened this issue Dec 19, 2023 · 2 comments · Fixed by #936
Assignees

Comments

@bastiaanv
Copy link

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
Copy link
Contributor

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
Copy link
Contributor

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:

  • Color decorators display the closest sRGB approximation of the color — until VSCode adds support for wide-gamut colors this is the best we can do
  • Color equivalent hex values only appear when the color is displayable within the sRGB color space
  • Color presentations / pickers are not supported. Given that VSCode does not yet support wide-gamut colors allowing modifications and interactions in this way would be lossy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants