6 ms·
Yep yep. CSS in JS removes some of the pain points but still, fundamentally, CSS cannot communicate with JS in a universal, elegant way. Honestly, CSS in genera
by _hardwaregeek 8y ago
Yep yep. CSS in JS removes some of the pain points but still, fundamentally, CSS cannot communicate with JS in a universal, elegant way. Honestly, CSS in general is awful. How did we only just get decent centering with flexbox? How is flexbox still inconsistent across browsers? (Try setting a child of a flexbox container to 100% height.) The days of needing separate constructs because of bandwidth are over. We need something to unify CSS and HTML and JS into a UI builder that doesn't make you want to tear your hair out when you have to center a div over another div and give it an animation.
- VonGuard 8y agoThe thing i hate about CSS is how unstructured it can be. You just sorta list whatever you want and it's suddenly a style sheet. No headers, no footers, no must includes.... DO I use quotes around this value? Do I not? Does white space matter? It's the most intimidating language I've ever used just because it feels so open and uncontrolled and nonsensical... I always thought CSS was some leftover abomination from the days of Netscape.
- devwastaken 8y agoLESS is more how CSS should look like for styling. It's amazing we don't have embedding of rules yet. parent { child { } } is just so much more development friendly than parent { } parent child { }
- bsheir74 8y agoAgreed, and hoping that scss or less influences future versions of css!
- mjevans 8y agoI believe the why is that as soon as you have any invalid syntax everything else is ignored. I forget the level of scope, I think it's until the next complete rule?
- gsnedders 8y agoThe CSS WG earlier this year resolved to take on a spec defining this, and there's implementer interest, so it's highly likely to happen. (This is https://github.com/w3c/csswg-drafts/issues/2701 https://github.com/w3c/csswg-drafts/issues/2701 .)
- _hardwaregeek 8y agoPlus the error handling is abysmal.
- scns 8y agowith PostCSS and the postcss-nested you can nest loads of stuff like mediaqueries, which makes it bearable IMHO.
- combatentropy 8y ago> Try setting a child of a flexbox container to 100% height. Isn't this the default? align-items: stretch --- https://css-tricks.com/snippets/css/a-guide-to-flexbox/ https://css-tricks.com/snippets/css/a-guide-to-flexbox/ > The days of needing separate constructs because of bandwidth are over That wasn't the reason for stylesheets. It was for ease of changes. For example, to change the color of the headings on all of your HTML pages, you would change just the stylesheet. This was when each web page was a static HTML file. Few websites used programming languages to render pages. So the benefit today is less. But I guess if you don't care about that nor bandwidth then you can use inline style attributes.
- _hardwaregeek 8y agohttps://stackoverflow.com/questions/33636796/chrome-safari-not-filling-100-height-of-flex-parent https://stackoverflow.com/questions/33636796/chrome-safari-n... I'm referring to this. Got bitten by it recently. > That wasn't the reason for stylesheets. It was for ease of changes. For example, to change the color of the headings on all of your HTML pages, you would change just the stylesheet. This was when each web page was a static HTML file. Few websites used programming languages to render pages. So the benefit today is less. Interesting, I didn't know that. Still, CSS doesn't make a whole lot of sense to me. Here's a bunch of global state, some of which is hidden in gigantic minified files, now edit it!
- irrational 8y ago>Here's a bunch of global state, some of which is hidden in gigantic minified files, now edit it! Well, there's your problem. I'd recommend reading about things like atomic css, BEM, OMACSS, etc.
- _hardwaregeek 8y agoThat's why I use CSS in JS :D. But we're just putting abstractions/stopgaps over a fundamentally flawed design. Not to mention, since everybody uses a different standard for isolation, CSS in JS is not compatible with BEM is not compatible with SASS, etc.