:root {
/* Base color using HSL */
--hue: 207;
--saturation: 64%;
--light: 44%;
/* Base color in variable */
--primary-color: hsl(var(--hue), var(--saturation), var(--light));
/* Base color lighten using calc */
--primary-color-lighten: hsl(var(--hue), var(--saturation), calc(var(--light) + 10%));
/* Base color darken using calc */
--primary-color-darken: hsl(var(--hue), var(--saturation), calc(var(--light) - 10%));
}
-
-
Save diogocapela/4a47c5068d0426216a9dfca4ecead31b to your computer and use it in GitHub Desktop.
Darken & Lighten colors in pure CSS using variables.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment