How Conflicts Are Resolved
When two classes set the same style property, Uniwind picks the winner the same way a browser does. It compares, in this order:- Importance -
!importantdeclarations beat normal ones - Cascade layer - rules outside any
@layerbeat rules inside a layer. Between layers, the layer declared later wins (reversed for!importantdeclarations) - Selector specificity - more specific selectors win. Every class, state variant (
active:,focus:,disabled:), and data attribute adds to specificity. Media queries, such as breakpoints and platform variants, don’t - Source order - the rule that comes later in the compiled CSS wins
className is never part of this comparison.
Cascade order on native requires Uniwind 1.13.0 or Uniwind Pro 1.9.0 or later. On web, the browser applies these rules in every version.
Class Name Conflicts
Uniwind does not automatically deduplicate classNames. If you pass conflicting utilities for the same style property, the one Tailwind emits later in the generated CSS wins:bg-red-500 after bg-blue-500 in the generated CSS. Tailwind decides that order, not your className string.
Use tailwind-merge when building className strings that may contain conflicts. It removes the earlier conflicting class, so the class you pass last wins:
State Variants
State variants add to selector specificity, so they override the base utility while the state is active, regardless of class order:Important Utilities
Use Tailwind’s important modifier (!) when a utility must override another utility for the same property.
bg-red-500! is generated with higher priority than bg-blue-500. When several important utilities conflict, specificity and source order decide between them, just like for normal utilities:
Custom CSS Classes
Tailwind generates utilities inside@layer utilities. Custom classes you write directly in global.css are outside any layer, so they win over utilities that set the same property:
global.css
@layer components, which Tailwind declares before utilities:
global.css
card bg-blue-500 now renders a blue background.