Changelog v3.3.0
🎨 New Feature: Uniwind Styling Option
This release adds Uniwind as a third styling option alongside NativeWind and Unistyles.
What is Uniwind?
Uniwind is a Tailwind CSS solution for React Native that offers:
- Tailwind v4 support with CSS-first configuration
- Type-safe styling with automatic TypeScript generation
- Live theme switching with
Uniwind.setTheme() - CSS variables for dynamic theming
- 3-theme system (light/dark/premium) out of the box
Styling Options
When running the CLI, you now have 3 choices:
- NativeWind - Tailwind CSS v3 for React Native (2-theme: light/dark)
- Unistyles - Type-safe styling with breakpoints (3-theme: light/dark/premium)
- Uniwind - Tailwind CSS v4 with live theming (3-theme: light/dark/premium) ✨ NEW
🔧 Technical Changes
Uniwind Configuration
Dependencies Added
{
"uniwind": "1.2.4",
"tailwindcss": "4.1.16",
"postcss": "8.5.6",
"lightningcss": "1.30.2",
"react-native-gesture-handler": "2.28.0",
"react-native-keyboard-controller": "1.18.5"
}Metro Config
const { withUniwindConfig } = require('uniwind/metro');
module.exports = withUniwindConfig(config, {
cssEntryFile: './app/global.css',
extraThemes: ['premium'],
});Theme System
- Uses
@layer themewith@variant light/dark/premiumblocks in CSS Uniwind.setTheme()for live theme switchinguseUniwind()hook for accessing current theme- MMKV persistence for theme preference
File Structure
app/
├── global.css # Tailwind v4 CSS with theme variants
├── _layout.tsx # Imports global.css, uses withUniwind HOC
└── (tabs)/
├── _layout.tsx # Uses useUniwindTheme for navigation colors
├── index.tsx # Styled with Tailwind classes
└── settings.tsx # Theme toggle button
components/
├── container.tsx # SafeAreaView wrapped with withUniwind
└── theme-toggle.tsx # 3-theme cycle with haptic feedback
lib/
├── mmkvStorage.ts # MMKV storage instance
└── use-uniwind-theme.ts # Theme hook with persistence
constants/
├── themes.ts # Theme icons and config
└── uniwind-themes.ts # Color definitions per theme
🐛 Bug Fixes
Uniwind Serialization Error
- Fixed "Failed to serialize javascript object" error
- Caused by Tailwind scanning
node_modulesand native iOS files - Solution:
@sourcedirectives in CSS to limit scan scope
Theme Not Updating Live
- Fixed by using
Uniwind.setTheme()instead ofupdateCSSVariables() - Added
extraThemes: ['premium']in metro config for custom themes - Proper
@variantblocks in@layer themefor CSS variables
📦 Migration from v3.1.x
If you have an existing project, generate a new one with Uniwind to see the correct configuration, then:
-
Install new dependencies:
bun add uniwind@1.2.4 tailwindcss@4 postcss lightningcss
-
Update
metro.config.jsto usewithUniwindConfig -
Move
global.csstoapp/global.csswith proper@layer themesyntax -
Update
_layout.tsxto import./global.cssand useUniwind.setTheme()
📚 Documentation
Full Changelog: v3.1.0...v3.2.0