rtsao | 9 years ago | on: Show HN: Styletron – Virtual CSS
rtsao's comments
rtsao | 9 years ago | on: Show HN: Styletron – Virtual CSS
The implementation of a UI widget is ultimately a combination of CSS, HTML, and JS which are coupled to some degree, so by colocating them together, the component is easier to manage. But to do this effectively, you need some way to get around the global nature of CSS. CSS modules and CSS-in-JS are means of achieving this.
A good blog post about this topic is: https://medium.com/seek-developers/the-end-of-global-css-90d...
rtsao | 9 years ago | on: Open-Sourcing CloudFlare’s UI Framework
rtsao | 10 years ago | on: State of the Art JavaScript in 2016
1) Can be used without any tooling whatsoever. It's just plain JS.
2) Doesn't reinvent the wheel. You can use regular CSS (normal syntax, pseudo classes, media queries) and regular JS (variables, modules) together, allowing you to use the best of both worlds.
I loved the ideas behind CSS Modules but wasn't sure about the complexity of re-implementing a new module/variable syntax into CSS. Why not just use what is already provided in JavaScript?
[1] https://github.com/rtsao/styletron/tree/master/packages/benc...
[2] https://github.com/paulirish/pwmetrics