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
cssspecificityscopingimportant
Prefer a scoped class over :global and !important
Apply your own class to the wrapper element instead of reaching into library globals or forcing styles with !important.
PR: hegnar-components · org-mining-deep-2026-06Created: Jun 17, 2026
Bad example
Old codecss
| 1 | :global(.tableWrapper) { ... } |
| 2 | table :global(.selectedCell) { background: $grey-100 !important; } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codecss
| 1 | // add class via component config: HTMLAttributes: { class: 'editor-table' } |
| 2 | .editor-table { ... } // no :global, no !important |
Explanation (EN)
Objašnjenje (HR)