Last active
May 23, 2020 22:16
-
-
Save HersonHN/9cb794ed4e28c770294eacf760369d86 to your computer and use it in GitHub Desktop.
Theme color configuration with SASS
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
$foreground: #16161d; // Eigengrau | |
$background: #FFFFFF; | |
@mixin color-theme($fg, $bg, $link, $link-hover) { | |
color: $fg !important; | |
background-color: $bg !important; | |
a[href] { color: $link !important }; | |
a[href]:hover { color: $link-hover !important }; | |
.fg-color { color: $fg !important } | |
.bg-color { background-color: $bg !important } | |
.fill-with-bg { fill: $bg !important } | |
.fg-color-i { color: $bg !important } | |
.bg-color-i { background-color: $fg !important } | |
} | |
@mixin light-theme { | |
@include color-theme($fg: $foreground, $bg: $background, $link: #1287d4, $link-hover: #0f74b6); | |
} | |
@mixin dark-theme { | |
@include color-theme($fg: $background, $bg: $foreground, $link: #3BAFFD, $link-hover: #5BCFFD); | |
} | |
@media (prefers-color-scheme: light) { .system-theme { @include light-theme; } } | |
@media (prefers-color-scheme: dark) { .system-theme { @include dark-theme; } } | |
.light-theme { @include light-theme; } | |
.dark-theme { @include dark-theme; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment