DEV Community

Discussion on: Angular 6: Dynamic Themes Without a Library

Collapse
 
briancodes profile image
Brian • Edited

This is a very good approach - I had a look at caniuse and css variables seem to be very well supported now, which is great! It's really helpful seeing a live demo too on StackBlitz ⚡

I have a question about the SCSS var funciton. When we are setting a value like: background-color: var(--navBackground);, the var(--navBackground) SCSS function is returning var(--navBackground). Is this step necessary do you think? If the colors are mapped 1 to 1, we might be able to skip this step? I might be missing something with this bit

Collapse
 
adamaso profile image
Angela Damaso

Hi Brian, sorry for getting back so late to your comment! YES, var can be omitted, I am actually planning to update this article with an updated implementation that is a bit cleaner. Thanks for reading :)