Switchable custom bootstrap themes with sass

I was able to find many different approaches on how to make a switchable themes in SASS I wasn't able to figure out how can I apply that approach to bootstrap overrides. Let's say I want to have light and dark theme and both themes would override bootstraps colors differently.

// Light-theme
$theme-colors: (
    "primary": #8A2F4F
);

// Dark-theme
$theme-colors: (
“primary”: #fff
);

In the example above are overrides for primary of theme-colors. How can I conditionally set them based on theme the user has selected?

#css #sass #bootstrap

5 Likes5.20 GEEK