Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Group link pseudo-states instead of using !important
Set color once across &, :active, :focus, :hover, :visited rather than forcing it with !important, which is hard to override later.
Bad example
| 1 | .share { color: #1877f2 !important; } |
Explanation (EN)
An important color override can make later component variants harder to control.
Objašnjenje (HR)
Good example
| 1 | .share, .share:active, .share:focus, .share:hover, .share:visited { color: color(social, facebook); } |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
When a verified link-style override applies to several states, target those specific states through the existing cascade strategy instead of adding an unexplained important flag.
Exceptions / Tradeoffs (EN)
Grouping states does not automatically beat another important declaration. Preserve focus/hover affordances and do not add visited/active styling the design did not require.