Created
January 17, 2024 10:22
-
-
Save MatthewWilkes/71d7a68f3af96fc1f36287e5e11bf8ff to your computer and use it in GitHub Desktop.
Semitransparent equivalents
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compiled result | |
:root { | |
--colour-soft1-0: #eadbea; | |
--colour-soft1-25: #efe4ef; | |
--colour-soft1-50: #f5edf5; | |
--colour-soft1-75: #faf6fa; | |
--colour-soft2-0: #ead2d5; | |
--colour-soft2-25: #efdde0; | |
--colour-soft2-50: #f5e9ea; | |
--colour-soft2-75: #faf4f5; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$opacities: ( | |
0: 0%, | |
25: 25%, | |
50: 50%, | |
75: 75%, | |
); | |
$colours: ( | |
soft1: #eadbea, | |
soft2: #ead2d5 | |
); | |
:root { | |
@each $colkey, $colval in $colours { | |
@each $opakey, $opaval in $opacities { | |
--colour-#{$colkey}-#{$opakey}: mix(#ffffff, $colval, $opaval); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment