Last updated on February 21, 2026
Style Specificity
Nativewind employs a specificity model that aligns with CSS rules, augmented to accommodate the inline-style nature of React Native.
How Specificity Works
When multiple classes target the same property, the last class in the stylesheet wins (following CSS source order), not the order in className:
Specificity Order
Styles are applied in the following order of precedence (lowest to highest):
- Base styles -- Regular utility classes (e.g.
text-red-500) - Modifier styles -- Styles with pseudo-class modifiers (e.g.
hover:text-blue-500) have higher specificity - Inline styles -- The
styleprop takes precedence overclassName - Important styles --
!importantoverrides everything, including inline styles
Important
The ! prefix (Tailwind's !important syntax) overrides both normal class styles and inline styles:
Merging className and style
Nativewind automatically merges className styles with the style prop. When the same property is set in both, the style prop wins (unless !important is used in the class):
When they target the same property, style takes precedence:
Component Composition
When building custom components that accept className, styles compose naturally through string concatenation: