Alternatives to @apply when reducing Tailwind CSS class repetition
Tagged: css
To have a scrollable element scroll to the bottom by default (CSS only, without JavaScript), use display: flex; flex-direction: column-reverse
. Via StackOverflow.
Breakpoint-free fluid type and spacing with Tailwind and the utopia.fyi approach
CSS media feature: @media (hover|any-hover: hover) {…}
, useful for preventing annoying ghost hover states on touch devices. Via Sam Selikoff on Twitter.
rbenv-gem-migrate to migrate gems to a new version
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 AbortError
s I’ve been seeing on iOS.
: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.