I’ve been enjoying these little “You want…” style posts. Post titles like that are a little more… forceful for my normal taste, but I like the spirit of sharing a best practice that perhaps isn’t well-known-enough.
- Killian started it with “You want overflow: auto, not overflow: scroll.”
- I followed up with “You want minmax(10px, 1fr) not 1fr.”
- Bramus wrote “You want
:not(:focus):invalid
, not:invalid
.” - Andy didn’t use the title, but this fits the bill: “Add scroll margin to all elements which can be targeted.”
Got an idea along these lines? You should blog it! Here or elsewhere.
I just published a post that could be suited for this list: https://www.silvestar.codes/articles/you-want-a-single-enabling-selector-not-the-one-that-disables-the-rule-of-the-previous-one/.