Skip to content

Instantly share code, notes, and snippets.

@HersonHN
Last active May 23, 2020 22:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HersonHN/9cb794ed4e28c770294eacf760369d86 to your computer and use it in GitHub Desktop.
Save HersonHN/9cb794ed4e28c770294eacf760369d86 to your computer and use it in GitHub Desktop.
Theme color configuration with SASS
$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