4 ms·
I strongly disagree with the CSS in JS movement, because philosophically it gives false hope about isolation. The thing is, no matter how you try to isolate a s
by btown 8y ago
I strongly disagree with the CSS in JS movement, because philosophically it gives false hope about isolation. The thing is, no matter how you try to isolate a scope, things are going to cascade! You could have someone above you change the font weight and not visually QA all your code paths, and now your subcomponent's entire layout could be messed up. BEM, SCSS, and standardized namespacing get you 90% of the way there, and force you to think about the cascade when writing.
- gambler 8y agoI disagree with it for another reason. I'm tired of developers solving language design problems by piling on more and more complexity, tools and libraries. This is a self-defeating approach, because those tools and libraries often have their own issues, and instead of fixing those, people pile on even more tools and libraries. The process goes on and on. It may feel like progress, but it doesn't really go anywhere. Java was a good example of this. Instead of fixing core language issues, people used increasingly sophisticated IDEs and put more and more things into XML. Instead of adding essential functionality to the standard library, everyone said "just download this great third-party JAR". At the time Java community said the workarounds were good enough. Right now it's obvious that they were completely wrong, the pileup of complex tools wasn't sustainable and that the language itself needed improvements.
- tracker1 8y agoThe DOM has styling primatives... many CSS in JS libraries use them... others compute CSS from the JS object structure used to define (based on JS DOM interfaces for styles).
- tracker1 8y agoYou can definitely handle potentially cascading issues with styling... const styles = theme => ({ myComponent: { ...theme.typography.body1 }, });