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 ruleP2project specificStack: css
muinamingstyling
Name component style-override slots by their standard slot names
When overriding a UI library's style slots, name your class for the standard slot (e.g. `root`) rather than a custom redundant name.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetypescript
| 1 | <Typography classes={{ root: styles.editedBadgeRoot }} /> |
| 2 |
|
| 3 | // scss |
| 4 | .editedBadgeRoot { /* ... */ } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetypescript
| 1 | <Typography classes={{ root: styles.root }} /> |
| 2 |
|
| 3 | // scss |
| 4 | .root { /* ... */ } |
Explanation (EN)
Objašnjenje (HR)