3 ms·
Nice project! The Cascade in CSS can be a real maintenance nightmare, and people seem to have very different ideas on how to handle encapsulation and modulariz
by jacobr 12y ago
Nice project!
The Cascade in CSS can be a real maintenance nightmare, and people seem to have very different ideas on how to handle encapsulation and modularization.
After a while with React, I thought it would be nice to define all styles for a component in the same location (inside my Component JavaScript). Setting the `top` property of a popup in JavaScript, but `width` or whatever in a CSS file just feels weird.
There's been some discussion about making this easier in React[1], but also resistance, so while waiting I wrote my own little library[2] (not React-specific), but it's not as feature rich as JSS.
I think that the fact that many projects[3] like this are popping up is validating the idea.
[1] https://github.com/reactjs/react-future/blob/master/04%20-%20Layout/04%20-%20Inline%20Styles.md
[2] https://github.com/jacobrask/marcssist
[3] https://github.com/js-next/react-style
https://github.com/tenphi/jcss
https://github.com/chenglou/RCSS
- colinramsay 12y agoYou can set top in CSS.
- lhorie 12y agoHe means "top" as in "top-relative-to-scroll-position-when-the-modal-is-taller-than-the-screen-in-IE8"
- colinramsay 12y agoAh, well you'd still need something more powerful for that kind of thing to work. A constraints engine for example: http://gridstylesheets.org/ http://gridstylesheets.org/ If you're going to go to the trouble of writing a CSS processor, you could at least add in some really interesting ideas.
- talmand 12y agoWhy is setting width of a popup in CSS weird?