0

Hey guys im making a calculator app and im trying to add a class for a "main". So basically i made a working script in JS which allows me to switch between several "main" classes (depends on what color theme i click). Unfortunately it does not see variables inside a class ".dark" (and probably other ones as well). When i put them in global scope it obviously works but not inside theme classes. Themes are placed inside additional scss file. Im probably making a stupid mistake but cant figure it out.

live site: https://adrian397.github.io/frontEndMentorChallenges/calculator-app-main/index.html

Have a look at my github repo to view the files:
https://github.com/Adrian397/frontEndMentorChallenges/tree/master/calculator-app-main

The problem is between style.scss and _themes.scss

Adrian
  • 71
  • 7
  • You approach will not work, variables are set at compile-time, when the Sass is being turned into CSS. So there is no way for `$mainBackground` to have 2 different values. Have a look at `mixin`. https://stackoverflow.com/questions/18112238/set-a-variable-in-sass-depending-on-the-selector – Pan Vi Jun 15 '21 at 08:13
  • You posted the same question a few hours ago. Don't just duplicate your question when you did not get an answer to the first. – Martin Jun 15 '21 at 09:49

0 Answers0