DEV Community

Discussion on: What is the future of CSS?

Collapse
 
auroratide profile image
Timothy Foster • Edited

Sometimes I feel like CSS is basically the Assembly language of styling, writing lots of code to achieve small "ideas" such as overlap, gridding, theming, and whatnot. Flexbox, Grid, etc I think have gotten us closer to this more-or-less declarative approach, where our code better reflects what the design really wants rather than just serve as a means to achieve that design.

Collapse
 
leob profile image
leob

Good observation, sometimes CSS feels incredibly low level and a lot of non-intuitive hocus pocus is needed to achieve the simplest things ... a lot of that is due to its origins as a page/text styling language, it was never designed with application development in mind ... but (as you already noticed) recent developments like Flexbox and CSS Grid have indeed tried to improve on this situation!

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Old-school CSS was very much about compiling esoteric idioms for simple design concepts into actual designs (float et al.), but these days the language has idioms for most of the common design patterns, so writing CSS is much more about actually describing the design and less about fighting the available paradigms.

Collapse
 
auroratide profile image
Timothy Foster • Edited

Yep, exactly! Another example I thought of is aspect-ratio which is a great idiom for ideas like "I want a square", and superior to 100% bottom padding jank.

I do still find myself occasionally wishing for a better idiom (such as for overlap where you have to choose between absolute positioning, negative margins, or things sharing a grid space), but it's way better than it was a decade ago, and why I think it'll keep getting better.

Thread Thread
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Yes, a content-overlap property would be pretty nice.

Collapse
 
fjones profile image
FJones

I think it's worth noting that CSS was, initially, effectively a language for print-style layouting. No one really intended for it to work with viewport-covering areas or boxed layouts in the sense we're used to now. We abused the living hell out of it by exploiting the underlying rendering algorithms, e.g. using float to create column layouts, or using table layouts. The rest was what HTML and framesets were meant to take care of.