- sass variables as fallback
- creating a theme map
- generating css custom properties from theme map
- crating a mixing to use theme values as css properties
- retrieving user data and applying user theme to current style
Sass variables as fallback
$background: #663399; $background-darken-10: mix(black, $background, 10%); $background-lighten-10: mix(white, $background, 10%); $text: white;
I use sass'
mix() function instead of
darken(), because they behave diffrently in some cases. So I made this a habit. See this Pen by Josh McCarty.
Creating a theme map
I am using Sass maps to keep the theme organized and for later iteration when generating