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 set both padding shorthand and longhand on the same rule
Specifying padding and then padding-left/padding-right on the same selector is redundant and confusing; use a single declaration.
Bad example
| 1 | .btn { padding: 0; padding-left: 10px; padding-right: 10px; } |
Explanation (EN)
A fully specified local padding pattern can be represented once without changing its computed sides.
Objašnjenje (HR)
Good example
| 1 | .btn { padding: 0 10px; } |
Explanation (EN)
Objašnjenje (HR)
Notes (EN)
Combine same-block padding declarations only when all four final sides, importance, logical/physical interactions and order remain equivalent.
Exceptions / Tradeoffs (EN)
Keep longhands that intentionally override just one axis without resetting the other. A partial set of longhands does not justify introducing a four-side shorthand.