You can do something like this
div { --h: 209; --s: 28%; --l: 30%; --a: 1; } div:hover { --l: 60%; } div { background: hsl(var(--h), var(--s), var(--l), var(--a)); }
Now when you hover over a div the lightness value will change, alternatively, you could do something like this.
div
div { --h: 209; --s: 28%; --l: 30%; --a: 1; } div:hover { background: hsl(var(--h), var(--s), calc(var(--l)*2), var(--a)); } div { background: hsl(var(--h), var(--s), var(--l), var(--a)); }
This will achieve the same result but calculates the new lightness meaning you can use classes to have different values.
Here it is in action jsfiddle
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You can do something like this
Now when you hover over a
div
the lightness value will change, alternatively, you could do something like this.This will achieve the same result but calculates the new lightness meaning you can use classes to have different values.
Here it is in action jsfiddle