The Future of CSS

49 points by typesanitizer 15 hours ago on lobsters | 6 comments

bramh | 11 hours ago

You can use PostCSS with plugins to polyfill some of these features in a way should be future proof when browsers do add support (provided the drafts don't change the syntax of these features).

Mixins aren't mentioned in this post, but I find them to be a very neat QoL improvement for writing tidy and reusable CSS. There's no browser support for them yet, but you can already polyfill them with @csstools/postcss-mixins

Diana | 10 hours ago

This. I have been yelling for mixins for so long. I am so happy and glad that members of the CSS WG (gosh i am bad at names) have been raising the flag and doing the massive work to bring it to life!

Thank you all!

Pomax | 5 hours ago

Functions actually confuse me greatly: it feels like they're just "incorrectly named TeX style macros" as they just get expanded until there's nothing left to expand, rather than "running" anything. Which also makes the need for an explicit "result" keyword super. The "function" body is by definition the result because there's no code execution happening, just substitution via macro expansion.

schuelermine | 5 hours ago

It's disheartening to see that literally every feature in this list that has any browser support at all is only supported by Chrom{e,ium}

Following the link to his post discussing subgrid, and I'm always amazed that my brain still somehow, after all these years, goes "okay but this is how I could do this in HTML4 with tables..."

chrismorgan | 8 hours ago

Grid is significantly more capable than HTML tables, for layout. Most obviously, you can change the layout based on available space, which is essentially impossible with tables.

Subgrid adds even more stuff that is quite impossible in HTML tables. Take the main example and think about even things like the backgrounds and borders, even apart from sizing.