logoalt Hacker News

dleeftinktoday at 4:54 AM1 replyview on HN

Good use case for @container, @scope and :has(), where you forgo class definitions and use --custom-properties on the parent scope/container which are inherited downwards based on the existence of a scoped DOM pattern/container query, or 'upwards' by using a :has(child-selector) on the parent.

Although be sure to avoid too many :has(:nth-child(n of complex selector)) in case of frequent DOM updates.


Replies

MarcelOlsztoday at 8:01 AM

Backend developers of HN downvoting this smh.