/* Avoid using the document root as the subject for component state. */ body:has(.notice-card__badge--warning) .notice-card { border-color: #c2410c; } /* Scope the match to the component that receives the style. */ .notice-card:has(:where(.notice-card__badge--warning)) { border-color: #c2410c; }