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

Complete support of the hsl() and hsla() specs #19

Open
meduzen opened this issue Aug 15, 2019 · 1 comment
Open

Complete support of the hsl() and hsla() specs #19

meduzen opened this issue Aug 15, 2019 · 1 comment

Comments

@meduzen
Copy link

meduzen commented Aug 15, 2019

Hi!

hsl() and hsla() are very permissive. Here are all the formats allowed and their current support in this wonderful ❤️ ColorHighlight plugin.

Supported

.my-class {
  color: hsl(222, 28%, 84%) // unitless hue
  color: hsl(222deg, 28%, 84%) // hue in degrees
  color: hsla(222, 28%, 84%, .5) // opacity
}

Not supported

.my-class {

  /* hue formats in angles */

  color: hsl(3rad, 28%, 84%); // hue in radiants (rad)
  color: hsl(-21grad, 28%, 84%); // hue in degrees (grad)
  color: hsl(0.75turn, 28%, 84%, .5); // hue in turns (turn)

  /* opacity or absence of opacity: hsla() is an alias for hsl()  */

  color: hsl(222, 28%, 84%, .5); // hsl() accepts opacity
  color: hsla(222, 28%, 84%); // hsla() is valid without opacity

  /* space as separator */

  color: hsl(222 28% 84%); // coma isn’t the only valid separator
  color: hsla(222 28% 84% / .5); // when space is separator, opacity is behind `/`
}

I’d love if ColorHighlight could implement all of these. I have no Python knowledge, so unfortunately I can’t help with the implementation.

Resources

@meduzen meduzen changed the title Support of space separator in hsl() and hsla() Complete support of the hsl() and hsla() specs Aug 15, 2019
@stdedos
Copy link

stdedos commented Oct 29, 2022

This seems to help 12763d3

@meduzen meduzen changed the title Complete support of the hsl() and hsla() specs Complete support of the hsl() and hsla() specs Dec 1, 2022
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

2 participants