CSS
The cascade can be tamed, not ignored
Understand the cascade before reaching for stronger selectors or important declarations.
CSS resolves competing declarations through the cascade. Specificity is only one part of that process.
Compare the right declarations
Origin, importance and cascade layers are considered before specificity. When relevant priorities match, specificity helps choose a declaration; scoping proximity and source order resolve later ties.
Inheritance supplies values for inherited properties when the element has no overriding specified value. It is not a competing specificity score.
Keep selectors understandable
Use small selectors and deliberate layers. Inspect the browser's computed styles when a declaration loses. Adding !important without understanding the winner can make the next override harder.
Utilities still use CSS
A utility class is a selector, not an inline style. The order of tokens in an HTML class attribute does not determine which conflicting utility wins.
Tailwind 4 detects classes in source files and generates the corresponding utilities. Keep complete class names visible in source; a separate PurgeCSS step is not required for this project.