Skip to content
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

Add support for modern colour formats #2

Open
unikitty37 opened this issue Jun 16, 2023 · 0 comments
Open

Add support for modern colour formats #2

unikitty37 opened this issue Jun 16, 2023 · 0 comments

Comments

@unikitty37
Copy link

When I highlight rgba(10 10 10 / 10%), right-click, and choose "Color to HSL", I get an error saying "Can't resolve color format of rgba(10 10 10 / 10%)".

I have to change it to the legacy format rgba(10, 10, 10, 0.1), at which point I can convert it. It generates hsla(0, 0%, 4%, 0.1), which is also the legacy format.

But this generates a Stylelint violation "Expected 0.1 to be 10% (alpha-value-notation)". If I make that change, I get "Expected modern color-function notation (color-function-notation)".

Stylelint is expecting the modern format: hsla(0deg 0% 4% / 10%); examples are at the link above. (It appears that the deg is required by a separate rule: hue-degree-notation.)

Would it be possible for the extension to:

  1. read the modern formats, and
  2. have an option to write colours in the modern formats rather than the legacy ones? (It would probably be a good idea to have a second option to control whether to use deg in angles, too.)
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

No branches or pull requests

1 participant