4 ms·
> inherited style structures can also be passed from a global theme, or higher order components. Correct me if I am wrong, but isn't this the whole point of Ca
by quantummkv 8y ago
> inherited style structures can also be passed from a global theme, or higher order components.
Correct me if I am wrong, but isn't this the whole point of Cascading Style Sheets?
> It's much harder to generate different global values for $primaryColor and related in scss for different deployment targets. More so if you want to swap out themes, or certain options via application configuration in the application.
Isn't this exact problem solved by custom css properties/css variables? Why recreate CSS in JavaScript with all of the compile-time and run-time overhead when you can write a small function to manipulate css variables?
- tracker1 8y agoOkay, so you want a global setting for buttons... button {...} Now you have a component where there's a variation on the button... .foo button {...} Now you want all buttons to have that variation... button {...new...} Now you change button defaults... button {...new...} Oh crap, `.foo button` is broken.
- tracker1 8y agoAs to the last part... lets say there's an application default for $someVariable, a per-client optional override, an application configurable (runtime database) override, and a user-level override. Are you suggesting that I setup a complicated system to do SCSS generation across the source of the entire application at each one of those layers? (including runtime, on-demand). Sending JSON, and merging JSON is FAR easier.