vrimar / construct-ui

A Mithril.js UI library
https://vrimar.github.io/construct-ui
MIT License
287 stars 23 forks source link

Runtime Customization by CSS Variables #46

Open shekharsom opened 3 years ago

shekharsom commented 3 years ago

Is there a possibility of introducing CSS Variables for the library? SCSS & its customizatoin works great but that requires compiling. If we want to introduce darkmode on runtime or custom themes at runtime, a css variable will be a great solution.

panoply commented 3 years ago

For what it's worth, you can adjust styles by overwriting variables. If you got a little deeper you'll notice that the stylings are quite logical and very easy to adjust and everything else is prepended using cui- so you can overwrite.

shekharsom commented 3 years ago

As I mentioned, SCSS is compiled at runtime before the app is pushed to server. It cannot be modified at runtime. This is where CSS Variables shine! They can be changed at runtime also and have cascading effect.