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
cssstylenitpick
Omit the unit on a zero length in CSS
Write `0`, not `0px`/`0rem`/`0em`, for zero lengths. Zero is unitless in CSS and the unit adds noise. (Keep the unit only where a unit is required, e.g. some `calc()` operands and angle/time zeros.)
PR: profico-org-corpus batch2 (all stacks/products)Created: Jul 26, 2026
Bad example
Old codescss
| 1 | .box { margin: 0px; padding: 0rem 12px; } |
Explanation (EN)
The units on the zeros are redundant.
Objašnjenje (HR)
Good example
New codescss
| 1 | .box { margin: 0; padding: 0 12px; } |
Explanation (EN)
Bare 0 is shorter and idiomatic.
Objašnjenje (HR)