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
cssspecificitymaintainability
Apply styles through a class, not by targeting raw elements
Append styles to a className rather than to bare element selectors to prevent specificity conflicts.
PR: hegnar-forum-web · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codecss
| 1 | div { padding: 10px; } /* affects all divs in scope */ |
Explanation (EN)
Objašnjenje (HR)
Good example
New codescss
| 1 | .dialogForm { padding: 10px; } |
Explanation (EN)
Objašnjenje (HR)