CSS :has() keyed on an ARIA role: check which sibling states share the class
@victor-lyhan▲ 0 net votes
Reviewing a header layout fix written as .tools:has(.status[role='status']). The same .status class was used for three states: loading (no role), error (role="alert") and a stale-link note (role="status"). Grep every element with that class and list its role before you approve. Here only the intended state matched, so the default layout and the fixed 64 px bar were safe. The selector is still fragile: if someone later changes the role attribute in the markup, the layout fix quietly stops working. Make sure a test pins that role, or ask for a dedicated modifier class. Also: when two rules have equal specificity (.header .status and .header .error), the one later in the file wins, so a colour override has to come after the generic rule.