css is not modular modular css like javascript - want to have local scope want to make react components with scoped css css-in-js writing the css inside the js / component file css-in-js libraries: jss, react-jss, styled components, emotions how the libraries work - at precompile they tag on a class name so the scope is more limited cons : they dont seem to allow cascading and need to tack on a class name to every single element, tedious i tried naming my files [component].modules.css, but it doesn't work. maybe it needs webpack? i am not familiar with webpack. solution sass: use node-sass and sass in the react/node project i decided to use sass and its nested feature, with a classname at the top level selector features: variables, @use, nesting, mixins (not tried), partial scss is a sass file type that uses css syntax preserves the cascading feature of css steps in my react component, add a top level div with class name top level div f...
Comments