Rules Hub
Coding Rules Library
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Do not comment idiomatic CSS like minmax(0, 1fr)
Skip explanatory comments for well-known, idiomatic CSS. minmax(0, 1fr) is standard grid track sizing that any CSS Grid user recognizes, not an obscure hack, so it does not need a comment explaining what it does. If a CSS comment is genuinely kept, use precise layout terminology (say the grid would 'overflow', not 'stretch').
Bad example
| 1 | // minmax(0, 1fr) so the header's min-width can't stretch the whole grid. |
| 2 | grid-template-columns: repeat(6, minmax(0, 1fr)); |
Explanation (EN)
Comments a standard CSS Grid idiom everyone recognizes, and uses imprecise wording ('stretch').
Objašnjenje (HR)
Good example
| 1 | grid-template-columns: repeat(6, minmax(0, 1fr)); |
Explanation (EN)
No comment needed; minmax(0, 1fr) is idiomatic. If a comment is kept, say it prevents 'overflow'.
Objašnjenje (HR)
Notes (EN)
minmax(0, 1fr) stops a track from growing past its share when an item has a large min-content; it is common knowledge, effectively the default expectation. Reserve comments for genuinely non-obvious intent, and when you comment CSS use the correct term (overflow, not stretch).
Exceptions / Tradeoffs (EN)
A short comment is fine when the reason is genuinely surprising, not when it just restates a standard idiom.