Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion skills/uniwind/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: >
Covers setup, Metro config, global.css, theming, className props, accent-* color
props, platform/data/state/responsive variants, CSS variables, custom utilities,
withUniwind for third-party components, cn/tailwind-merge, tailwind-variants,
safe area utilities, LayoutDirection, gradients, fonts, React Navigation,
safe area utilities, ScopedVariables, LayoutDirection, gradients, fonts, React Navigation,
UI kits, diagnostics, troubleshooting, and Uniwind Pro features. Does not
cover NativeWind migration.
---
Expand All @@ -19,6 +19,8 @@ If user has lower version, recommend updating to 1.7.0+ (free) / 1.2.1+ (Pro) fo

`LayoutDirection` is available from Uniwind 1.8.0+.

`ScopedVariables` scopes CSS variable overrides to a component subtree and is available from Uniwind 1.11.0+ / Uniwind Pro 1.6.0+.

Uniwind brings Tailwind CSS v4 to React Native. All core React Native components support the `className` prop out of the box. Styles are compiled at build time — no runtime overhead.

## Critical Rules
Expand Down
22 changes: 22 additions & 0 deletions skills/uniwind/references/theming.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,28 @@ import { ScopedTheme } from 'uniwind';
- `withUniwind`-wrapped components inside the scope also resolve scoped theme values
- Custom themes require registration in `extraThemes`

### ScopedVariables
Comment thread
Brentlok marked this conversation as resolved.

Override CSS variables for a subtree without changing the global or scoped theme:

```tsx
import { ScopedVariables } from 'uniwind';
Comment thread
Brentlok marked this conversation as resolved.

<View className="gap-3">
<PreviewCard /> {/* Uses --color-primary from the active theme */}

<ScopedVariables variables={{ '--color-primary': '#7c3aed' }}>
<PreviewCard /> {/* Its bg-primary now uses purple */}
</ScopedVariables>
</View>
```

- Variable names must start with `--`; invalid names are ignored.
- Values apply to `className`, `useCSSVariable`, `useResolveClassNames`, and `withUniwind`-wrapped components in the subtree.
- Nested scopes merge with their parents; the nearest value wins.
- On web, numeric values become pixel values (`20` becomes `20px`).
- Use it for local overrides such as previews, branded sections, or component-specific tokens. Use `Uniwind.updateCSSVariables` for global theme updates.

### LayoutDirection (v1.8.0+)

Scope RTL/LTR variants to a subtree without changing global device RTL state:
Expand Down