Skip to content

Feature Request: Support default border color via CSS variable (--default-border-color) #491

Description

@SouhailKrs

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions