3 ms·
Yes, this is kinda like the "lodash" for writing styles in JavaScript. The main goal with writing styles in JavaScript is to make CSS work in the context of co
by mxstbr 10y ago
Yes, this is kinda like the "lodash" for writing styles in JavaScript.
The main goal with writing styles in JavaScript is to make CSS work in the context of component-based systems. The language is magnificent, but it was made in an age where the web consisted of documents.
These days we're building rich, interactive, client-side user interfaces with the same language, but it's standing in our way. That's why there has been a lot of exploration, especially in the React ecosystem, around putting styles in JavaScript.
I'd encourage you to take a look at these magnificent resources which I cannot do justice in a single comment:
- The talk that kicked it all off: "CSS in JS" by vjeux[0] (made React Native, works at Facebook)
- "Rendering Khan Academys Learn Menu Whereever I Please" [1]
- "Scale FUD and style components" [2]
and a bunch of other talks and articles if you google "CSS in JS".
[0]: https://speakerdeck.com/vjeux/react-css-in-js https://speakerdeck.com/vjeux/react-css-in-js
[1]: https://medium.com/@jdan/rendering-khan-academys-learn-menu-wherever-i-please-4b58d4a9432d#.w9nshye05 https://medium.com/@jdan/rendering-khan-academys-learn-menu-...
[2]: https://medium.learnreact.com/scale-fud-and-style-components-c0ce87ec9772#.kzjba8lcg https://medium.learnreact.com/scale-fud-and-style-components...
- onli 10y agoThe idea of writing CSS in JS is horrible to me. But I'm coming from a completely different developer camp, and find the vjeux talk completely unconvincing, so that does not mean much :) And with your comment it is clearer now where this might be useful. Maybe add a "How to use this" section describing possible workflows to the Readme? Also I run into situations where my js produces inline css, and a lodash style lib for that could be useful. Thanks for the answer, congratz for launching!
- mxstbr 10y agoThanks for the kind words, totally understand that this isn't for everybody. Definitely will work on improving the README, just needed to finally get this out of the door ;) Cheers!