:has()

Parent Selector

div.parent:has(#unique-descendent) {
  background: pink;
}

Sibling Selector

hover over element to select all siblings after itself in the document flow

.parent li:nth-child(5n):hover, .parent li:nth-child(5n):hover ~ li:nth-child(5n) 

Previous Sibling Selector

hover over element to select all previous siblings before itself

.parent li:nth-child(5n):hover, .parent li:nth-child(5n):has(~ li:nth-child(5n):hover)

Examples

Ceiling light button

hover over element to select parent and siblings

Sarasa Gothic Mono: Human Language Support

commit: add previous sibling selector support with css :has() · picaq/picaq.github.io@be1657d

demo: picaq.github.io/sarasa/#human-language-support