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).
Remove cargo-culted CSS you can't justify
Don't keep CSS classes copied from elsewhere without understanding them; remove a class unless you can explain why this component needs it.
Bad example
| 1 | // min-w-0 carried over from another component; nobody knows why |
| 2 | <div className={clsx('min-w-0', centerClassName)}>{children}</div> |
Explanation (EN)
An unexplained class copied from elsewhere lingers as noise and obscures which styles actually matter for this component.
Objašnjenje (HR)
Neobjašnjena klasa kopirana odnekud ostaje kao šum i zamagljuje koji stilovi zapravo nešto znače za ovu komponentu.
Good example
| 1 | // keep only the classes this layout genuinely needs |
| 2 | <div className="mx-auto max-w-[--content-width]">{children}</div> |
Explanation (EN)
Only the classes with a clear purpose remain, so the styling reflects this component's actual intent.
Objašnjenje (HR)
Ostaju samo klase s jasnom svrhom, pa stiliziranje odražava stvarnu namjeru ove komponente.
Exceptions / Tradeoffs (EN)
If you can demonstrate the class is actually needed (e.g. it prevents flex/grid overflow), keep it and ideally note why.
Iznimke / Tradeoffi (HR)
Ako možeš pokazati da je klasa zaista potrebna (npr. sprječava overflow u flexu/gridu), zadrži je i po mogućnosti objasni zašto.