3 ms·
css in js does NOT put JS in css... there have been other efforts to do things like that. CSS in JS generates the styling from JS at a component level. This h
by tracker1 8y ago
css in js does NOT put JS in css... there have been other efforts to do things like that.
CSS in JS generates the styling from JS at a component level. This has advantages of centralized theme/style and configuration values at build/deploy/runtime over other CSS generation options, while being every bit as flexible. There are many libraries with varied approaches. styled-compenents and react-jss are probably the two most commonly used.
Maybe learn a little about the subject at hand before spouting off and showing your own ignorance.
- preommr 8y ago1) I never said css in js puts js in css. I don't even know what this means. 2) You can still have component level css files without using some kind of framework that puts css into js. I've written projects where there was an implicit organization of components where css rules would target components by having more specific rules. Like I said, there are reasons to have css in js. If the project doesn't require it, there's an argument to be made for keeping things simple by not including js dependencies for styling. Especially because in those situations it's not difficult to refactor the css into js. > Maybe learn a little about the subject at hand before spouting off and showing your own ignorance. ironic
- tracker1 8y agoOkay... now add in the ability to have a Default color... add in the option for that color to be overriden for a given deployment. Now add in options to have a style setting configurable application wide in the application. Now add in the option to have a configuration option per-user. You can either create some rube-goldberg configuration/generation for the entire application with complexity at multiple layers... OR ...deepMerge some JSON to deliver and have the theme/components use that.