2 ms·
> All targeting is via BEM, so no inheritance even for nested components. If you use (S)CSS modules, then you don't even need to worry about BEM.
by nicoburns 6y ago
> All targeting is via BEM, so no inheritance even for nested components.
If you use (S)CSS modules, then you don't even need to worry about BEM.
- j-krieger 6y agoIf you use CSS Modules, you can not target an elements children with another css module class name. You can‘t know the hash beforehand
- nicoburns 6y agoYou could import the parent CSS module in the child. It might not be a bad idea to make the dependency explicit like that if the components are so tightly coupled.
- fgkramer 6y agoSeconded, when you have a large codebase, BEM selectors end up taking a considerable amount of kB on your final bundles. Moving to CSS modules and running a css class minifier and deduplicator is the best thing you can do if you work in a project where performance is critical. Anecdotical, but the best improvement I've achieved doing this is shaving off ~30% of our final bundles, gzipped!)