Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] SCSS Change Variable depending on parent class Reply To: SCSS Change Variable depending on parent class

#153453
Alen
Participant

Basically I’m trying to have sections with different colors, without writing the CSS twice. Using the same base code from the main section.

I don’t see the point of re-declaring variables. If you have 10 different colors you have to use, it’s better to have 10 variables, instead of changing the base value down the chain. What if you need to change all the colors? You would have to go trough the chain and figure out all the spots you’ve re-declared the variable and change it there. What you should be doing is just change the value the variable contains.

Can you explain your issue in greater detail, so that we can suggest possibly better alternatives. The path you’re about the embark on is very messy.