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 ruleP2universalStack: Tailwind
tailwindclsxreadability
Merge paired conditional classes into a single expression
Combine two clsx branches that key off the same condition into one branch with both classes.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codetsx
| 1 | product === 'kapital' ? 'bg-gray-900/50' : 'bg-blue-500', |
| 2 | product === 'kapital' ? 'hover:bg-gray-900/60' : 'hover:bg-blue-400' |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | product === 'kapital' ? 'bg-gray-900/50 hover:bg-gray-900/60' : 'bg-blue-500 hover:bg-blue-400' |
Explanation (EN)
Objašnjenje (HR)