Problem
Currently in Uniwind, using border or border-2 alone falls back to currentColor
(Tailwind v4's default), making it impossible to set a global default border color.
On web, this can be worked around with:
@layer base {
* {
border-color: var(--color-border);
}
}
But this has no effect in React Native since there is no DOM cascade.
Expected Behavior
Uniwind should support a --default-border-color CSS variable (similar to how Tailwind v4
already handles --default-ring-color) so that border or border-2 alone automatically
resolves to the theme's border color.
@theme {
--default-border-color: var(--color-border);
}
{/* border-2 alone should use --default-border-color */}
<View className="border-2 rounded-xl" />
Current Behavior
border-2 renders with currentColor (black or white depending on text color).
The only workaround is to always write border-2 border-border explicitly,
or wrap every bordered component in a helper that injects border-border:
export function Box({ className, ...props }: ViewProps) {
return <View className={cn('border-border', className)} {...props} />
}
References
Problem
Currently in Uniwind, using
borderorborder-2alone falls back tocurrentColor(Tailwind v4's default), making it impossible to set a global default border color.
On web, this can be worked around with:
But this has no effect in React Native since there is no DOM cascade.
Expected Behavior
Uniwind should support a
--default-border-colorCSS variable (similar to how Tailwind v4already handles
--default-ring-color) so thatborderorborder-2alone automaticallyresolves to the theme's border color.
Current Behavior
border-2renders withcurrentColor(black or white depending on text color).The only workaround is to always write
border-2 border-borderexplicitly,or wrap every bordered component in a helper that injects
border-border:References