Last active
February 2, 2021 19:28
-
-
Save joshblack/2356415d9b31062cdba8e0303287a201 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
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
@use 'sass:color'; | |
@use 'sass:list'; | |
@use 'sass:map'; | |
@mixin theme($theme, $rgb: ui-background) { | |
@each $key, $value in $theme { | |
--#{$key}: #{$value}; | |
@if list.index($rgb, $key) != null { | |
--#{$key}-rgb: #{color.red($value)}, #{color.green($value)}, #{color.blue($value)}; | |
} | |
} | |
} | |
$light: ( | |
ui-background: #f3f3f3, | |
text-color: black, | |
); | |
$dark: ( | |
ui-background: black, | |
text-color: white, | |
); | |
:root { | |
@include theme($light); | |
} | |
.dark { | |
@include theme($dark); | |
} | |
.full { | |
@include theme($light, $rgb: (ui-background, text-color)); | |
} |
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
:root { | |
--ui-background: #f3f3f3; | |
--ui-background-rgb: 243, 243, 243; | |
--text-color: black; | |
} | |
.dark { | |
--ui-background: black; | |
--ui-background-rgb: 0, 0, 0; | |
--text-color: white; | |
} | |
.full { | |
--ui-background: #f3f3f3; | |
--ui-background-rgb: 243, 243, 243; | |
--text-color: black; | |
--text-color-rgb: 0, 0, 0; | |
} |
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
{ | |
"sass": { | |
"compiler": "dart-sass/1.26.11", | |
"extensions": {}, | |
"syntax": "SCSS", | |
"outputStyle": "expanded" | |
}, | |
"autoprefixer": false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment