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 ruleP2stack specificStack: css
cssscssmixinsmaintainability
Set value-specific style properties on the rule, not hard-coded in a shared mixin
A shared mixin should hold only common properties; values that vary per usage belong on the consuming rule so the cascade doesn't apply two competing values.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codescss
| 1 | @mixin button { padding: 0; /* baked-in */ } |
| 2 | .btn { @include button; padding: 8px; } // two padding values, order decides |
Explanation (EN)
Objašnjenje (HR)
Good example
New codescss
| 1 | @mixin button { /* only shared props */ } |
| 2 | .btn { @include button; padding: 8px; } |
Explanation (EN)
Objašnjenje (HR)