4 ms·
I think the better question is, "Will front end development ever move away from CSS?" In all honesty though, with ES6/7 writing programs in Javascript is a joy
by inostia 10y ago
I think the better question is, "Will front end development ever move away from CSS?"
In all honesty though, with ES6/7 writing programs in Javascript is a joy. CSS still sucks...
- vinnymac 10y agoDevs 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.
- coldtea 10y agoIt's not just CSS that sucks, it's the whole, totally arbitrary, web UI stack. Unlike with desktop apps, everybody pretty much builds everything in the UI for themselves, with the exception of a handful of primitive items (button, radio-button, text-field, etc) that people still re-implement anyway. If there was a set of rich widgets to just take, configure and use in your JS app, like you can in Cocoa, Windows Forms, etc, it would be great. And no, React is not that.
- graphememes 10y agoHave you ever sat down and read the reasoning for why things are the way they are? Why the accessors can't / don't go traversing through it's parents and only goes down? It feels like many people who argue against these things are only the ones using them not the ones developing them or actively interacting with the repercussions of those developments. It's a completely different world when you're creating something and using something. One person might use that thing vastly different than how you would and the repercussions of their implementation can do a lot of damage to others. Something to keep in mind.
- coldtea 10y agoYou say it as it is some huge mystery, but we've had good UI platforms for ages, that have been way better to work with than the web ui stack. The web implementations doesn't follow some inherent constraints of UIs, they are designed this (bad) way because they need to work with the pile-up of hacks upon hacks, and design by committee that is the web stack. JS, for example, is not bad because there were some great domain constraints -- it's bad because as it's creator says, he had a tight deadline to go create it, alone, in a couple of weeks -- and had a design spec to make it look like Java as much as possible too. CSS is not bad because layout is inherently difficult. It's bad because it started like a pure styling solution, and all kinds of hacks were piled to make it useful for layout (abusing the floating functionality, which was not meant as a layout solution). It took 20+ years to get to CSS Flex and Grid layout -- features that have been in desktop UI libs since forever... And if forms have seen any love from the beginning, we'd have things like inter-changable re-usable components 20+ years ago, without the BS that is Web Components and the extra hacks like Shadow Dom etc. But they didn't even bother to add a few standard widgets like calendar in all those decades.