10LOC

#selectors

Web Platformintermediate

CSS :has() for parent-based styling logic

.empty-state {
  display: none;
}

.results:not(:has(li)) + .empty-state {

Style a table row from its checkbox and swap in an empty-state message when a list has no items, with zero JavaScript.