Skip to content

Is there a way to customize the default border color resolved by the border class? #427

@ciacka

Description

@ciacka

What happened?

When using the border class, the resolved styles always include borderColor: "#000000" style:

const styles = useResolveClassNames("border");
console.log(styles);

> {"borderColor": "#000000", "borderStyle": "solid", "borderWidth": 1}

I'm not sure whether this is hardcoded or derived from somewhere else, but I couldn't find a way to override it via global.css.

On the web, it can be customized at the project level via global.css:

@layer base {
  * {
    border-color: #d1d5db; /* gray-300 */
  }
}

I've tried the above with Uniwind, however it had no effect on the resolved value.

Expected behavior

It would be great if the default borderColor applied by the border class were customizable via global.css, consistent with how Tailwind v4 works on the web. For example, a @layer base rule targeting * with border-color could be respected.

Current behaviour

border always resolves borderColor to #000000 regardless of any overrides in global.css.

I'm aware that I could define --color-border in the theme and then use border-border as an explicit color class, but the resulting name repetition feels off to me. I'd rather keep that as a last resort.

Steps to Reproduce

Snack or Repository Link (Optional)

No response

Uniwind version

1.0.0-rc.3

React Native Version

0.83.2

Platforms

Android

Expo

Yes

Additional information

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    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