Modern CSS Code Snippets

49 points by chamlis


ale

There's literally no point in using these snippets when most of them are "Newly available", meaning I will have to check in 2–3 years to actually use them.

polywolf

Very cool resource! TIL about:

Feels like a lot of these tricks are things I see on FrontendMasters or css-tricks.com, just packaged in bite-size snippets. This is a good thing!

My one gripe is that the headline example, the "how do you center a div in CSS" meme, is slightly inaccurate; there are absolutely reasons to prefer the position: absolute; method or display: flex; align-items: center; justify-content: center; over the provided display: grid; place-items: center; method. Granted, those reasons are very subtle and don't fit into a snippet, this is mostly a me problem :)

LesleyLai

This is very cool! It's unfortunate that so many features are still only available on Chromium-based browsers, though

dz4k

https://modern-css.com/smooth-height-auto-animations-without-javascript/

It shows interpolate-size as "newly available" when it doesn't work on Firefox and MDN shows it as "limited availability".