Skip to content

Add support for modern colour formats #2

@unikitty37

Description

@unikitty37

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions