Hard Edge

Has Selector, Two Years On

posted by Olu Mensah
July 8, 2026
CSS
Photograph for “Has Selector, Two Years On”

:has() lets a card style itself based on what it contains.

Patterns we use

Our rule of thumb: if we cannot explain a choice in one sentence to a client, we probably should not ship it.

  • Cards without images get a taller title
  • Forms highlight the field with an error
  • Lists change layout when they hold one item

Borders do a lot of quiet work. They separate content, show what can be clicked and give the eye somewhere to rest.

We waited fifteen years for a parent selector and it was worth it.

Performance was not the goal, but it came along anyway. Fewer styles, fewer scripts and fewer images add up quickly.

The first version looked plain. The second version looked busy. The third version, with half the details removed, is the one we kept.

We asked a few readers to try it with a keyboard only. Two of them found problems in under a minute, which is exactly why we asked.

8 thoughts on “Has Selector, Two Years On”

Leave a Reply

Your email address will not be published. Required fields are marked *