4 ms·
Devs are certainly trying to make CSS not suck. It seems the number of CSS inline style, document.createElement('style'), etc libs are growing each month. Some
by vinnymac 10y ago
Devs are certainly trying to make CSS not suck. It seems the number of CSS inline style, document.createElement('style'), etc libs are growing each month. Some library will hopefully hit the nail on the head for this problem in the coming years.
The first project I worked on where I was able to isolate all my styles by component was eye opening. It becomes less like CSS and more like Androids XML styling.
- inostia 10y ago> "the number of CSS inline style, document.createElement('style')" Can you expand? Which libraries, I know BEM hopes to isolate CSS styles to "components" by using strict CSS rules, but are you speaking of inline styles as they relate to JavaScript libraries like React?
- vinnymac 10y agoI was referring to CSS-in-JS and what is coming out of it. https://speakerdeck.com/vjeux/react-css-in-js https://speakerdeck.com/vjeux/react-css-in-js Not all of them use inline styles and a lot are library agnostic. Here are just some of the ones I have played with, plenty more exist. https://github.com/rofrischmann/fela https://github.com/rofrischmann/fela https://github.com/FormidableLabs/radium https://github.com/FormidableLabs/radium https://github.com/Khan/aphrodite https://github.com/Khan/aphrodite https://github.com/threepointone/glamor https://github.com/threepointone/glamor https://github.com/MicheleBertoli/css-in-js https://github.com/MicheleBertoli/css-in-js https://github.com/styled-components/styled-components https://github.com/styled-components/styled-components https://github.com/css-modules/css-modules https://github.com/css-modules/css-modules https://github.com/cssinjs/jss https://github.com/cssinjs/jss https://github.com/smyte/jsxstyle https://github.com/smyte/jsxstyle https://github.com/rtsao/styletron https://github.com/rtsao/styletron
- deleted 10y ago[deleted]
- graphememes 10y agoDynamic styling with JavaScript seems to be the best approach, allowing the browser to interpret that opens the doors to multiple security vectors. Not that JavaScript / Cookies already don't. But there would be a lot more.