Rules Hub
Code Ruleset
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Don't hardcode pixel values in styles; use the rem conversion helper or system sizes
Convert hardcoded pixels to rems via the project's pxToRem/rem-calc helper or use system size tokens.
Bad example
| 1 | .title { margin-top: 12px; padding: 8px; } |
Explanation (EN)
An unexplained pixel literal can bypass the shared responsive/accessibility sizing system.
Objašnjenje (HR)
Good example
| 1 | .title { margin-top: rem-calc(12); padding: rem-calc(8); } |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
Use the repository's design tokens and rem conversion convention where sizing should scale with the root font, after verifying the helper's conversion base.
Exceptions / Tradeoffs (EN)
Pixels remain appropriate for some borders, raster/canvas geometry and intentionally fixed values. Converting units changes scaling behavior and is not always a pure cleanup.