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


Hey @Alen, thanks for the sugestion. That would work great.

For now what I did was create 2 .scss files and on each load a different partial with a set of variables. Then I just compiled two different files for each template. The reason that works for me better is because the code is all written already and this would minimize the workload(the color variable is used on all kinds of elemtns ). I can still use the same base, for all the templates and just compile using different variables into different global files. I realise this creates 2 different files and kind defeats the purpose of the whole thing. I know its not elegant, but I think that for a project that is more than 70% done, this is the easiest and maintainable approach.

That said, Im going to try to implement your technique on other projects and see how that works. Thank you very much for taking time to check this out and write the PENs, its been a lot of help and I’ve learned a lot today. Cheers