Rules Hub
Code Ruleset
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)
A syntax tutorial next to an ordinary grid declaration can distract from the actual layout intent.
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)
Remove comments that merely restate familiar grid syntax while preserving concise rationale for a non-obvious overflow constraint.
Exceptions / Tradeoffs (EN)
A short comment is fine when the reason is genuinely surprising, not when it just restates a standard idiom. minmax(0,1fr) changes the track minimum; it does not guarantee that an overflowing child will be clipped or shrink. Keep a useful constraint explanation when the reason is not evident.