Dom Christie

Tagged: css

📚 til

To have a scrollable element scroll to the bottom by default (CSS only, without JavaScript), use display: flex; flex-direction: column-reverse. Via StackOverflow.

📚 til

Didn’t strictly learn this today, but needed to note it down so I remember. scroll-padding applies to scroll containers; scroll-margin applies to scroll items.


Calling load() before play() on a media element is recommended when switching the src. Hopefully this fixes the occasional AbortErrors I’ve been seeing on iOS.

📚 til

:placeholder-shown CSS pseudo selector: could be really useful for conditionally displaying adjacent/sibling depending on whether the input has a value.


Customise how Ruby destructures an object by defining a deconstruct_keys method.