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: react
muistylingdesign-systemprops
Use a component library's size prop instead of hardcoding dimensions
When a UI library component exposes a size prop, prefer it over manually overriding width/height in CSS so you stay aligned with the design system.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codescss
| 1 | // CSS |
| 2 | .button { width: 40px; height: 40px; } |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | <Button size="large">…</Button> // use the library prop; override only what's truly missing |
Explanation (EN)
Objašnjenje (HR)