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: CSS
csscss-modulesscssstyling
Use :global() only in CSS Module files
The :global() selector is a CSS Modules feature; in a plain (non-module) stylesheet it has no effect, so either make the file a .module file or drop :global().
PR: hegnar-forum-web · org-mining-3rd-2026-06Created: Jun 18, 2026
Bad example
Old codescss
| 1 | /* styles.scss (not a CSS module) */ |
| 2 | :global(.foo) { color: red; } /* :global does nothing here */ |
Explanation (EN)
Objašnjenje (HR)
Good example
New codescss
| 1 | /* styles.module.scss */ |
| 2 | :global(.foo) { color: red; } /* now :global is meaningful */ |
Explanation (EN)
Objašnjenje (HR)