3 ms·
And when the variables are configurable in the application? then the options are... a) setup the entire build toolchain for SCSS in the application b
by tracker1 8y ago
And when the variables are configurable in the application? then the options are...
a) setup the entire build toolchain for SCSS in the application
b) deepmerge some JSON, and have the app use that.
I've had to do it both ways... B is far easier to manage.
- jf- 8y agoSo when you have user configurable sass variables, css in js might make things easier. That seems like a fairly narrow use case, I’m not willing to sacrifice separation of styling everywhere in every component in every react app because it makes user defined style variables somewhat easier. Indeed, I’d be willing to put in the extra work to keep it if I did require such functionality - probably this is as simple as loading the scss variables from json, so I doubt there’s a significant workload involved.
- tracker1 8y agoYou can still inherit baseline styles via a common theme that gets injected... See material-ui[1] which uses react-jss[2] configured with appropriate plugins, being able to customize components using said theme is far easier than any SCSS setup I've used. It's really, really nice to use in practice. It's just a slightly different syntax, and if you REALLY want to, you can still put your styling config in a different file from your component rendering. [1] https://material-ui.com/ https://material-ui.com/ [2] https://www.npmjs.com/package/react-jss https://www.npmjs.com/package/react-jss