Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Nest SCSS and shorten child class names under their parent
Use concise scoped child class names where ownership stays clear; add SCSS nesting only when the ancestor relationship is part of the style contract.
Bad example
| 1 | .instrument {} |
| 2 | .instrumentInfo {} |
Explanation (EN)
A repeated parent prefix can be noise inside an already clear local styling scope.
Objašnjenje (HR)
Good example
| 1 | .instrument { .info {} } |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
Within the project's scoping convention, shorten a child class only when ownership remains clear and the added ancestor selector is intentionally required.
Exceptions / Tradeoffs (EN)
CSS Modules already scope classes; adding a parent dependency can increase specificity and couple styles to DOM shape. Do not apply this as a blanket requirement to nest.