Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP2universalStack: CSS
csscolorinheritancetheming
Set inherited text color on the element that sets the background
Put text color on the container that defines the background (since links/children inherit color) rather than repeating it on each child or relying on hover overrides.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codecss
| 1 | .item:hover { color: #151719; } /* patching color per state */ |
Explanation (EN)
Objašnjenje (HR)
Good example
New codecss
| 1 | .panel { background: #fff; color: #151719; } /* children inherit */ |
Explanation (EN)
Objašnjenje (HR)