Created
April 3, 2020 12:47
-
-
Save autr/41484ae9b172d6211e16cc9a3c590adf to your computer and use it in GitHub Desktop.
SASS - subtle dark mode
This file contains 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
// dark mode options... | |
$invert: true | |
// differences between dark grays are more visible when inverted into light grays... | |
$pushInvertedBrightness: 0.01 | |
// color functions... | |
@function mono($l) | |
@return hsl(0,0%,$l) | |
// this exponential function will "push" light grays toward white... | |
@function getMono($l) | |
@if $invert | |
@return hsl( 0, 0%, 100 - ($l * ( 1 - ( (100-$l) * $pushInvertedBrightness ) ) ) ) | |
@else | |
@return hsl( 0, 0%, $l ) | |
// theme... | |
$color: #EE3987 | |
$darkest: getMono(10) | |
$dark: getMono(30) | |
$midGray: getMono(60) | |
$midGray2: getMono(70) | |
$light: getMono(90) | |
$lightest: getMono(96) | |
$white: getMono( 100 ) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment