DEV Community

Discussion on: What is the future of CSS?

Collapse
 
mnussbaumer profile image
Micael Nussbaumer

Personally I'm not a fan of css-in-js or utility based approaches to styling, for different reasons. I think some amount of utility classes for styling is always needed and useful, but basing entire layouts on classes doesn't lead to dry nor re-usable styling. I think pre-processors are - still - somewhat essential though, to give you a programmatic of generating those necessary utility classes in a clean way (generating variations for buttons/colors/etc).

In terms of CSS although it has improved a lot, I think vertical alignment in some situations is still not solved, flexbox does solve almost everything else.

One thing I miss is when text needs to fit a certain rectangle (single or multi-line) I would like to be able to specify that "no matter how many characters use the biggest font-size up to X that makes this text fit into this rectangle" and it would automatically set the font-size to that - I would be ok if verylongstringsthatdonthappennaturally would be botched or illegible but that the common case would just be solved by the browser layout engine.

On the same vein, but probably not a common use case, would be neat to be able to specify flex elements and say, these elements have this height and width, start with that, if the total elements don't fit with those dimensions, make them smaller proportionally (keeping their original ratio) up to the minimum of X. If they still don't fit, then make the container overflow.