nuxt / nuxt/ui

Better handling of `UButton`, `UBadge`, … colors on colored backgrounds

Open
#3,307 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

v5
Dominant language
TypeScript
Stars
6.9k
Forks
1.1k
Avg merge
1d 7h
Merged PRs (30d)
57

Description

Description

When adding UButton component with ghost or link variant inside a UBanner with links attribute, they remain displayed in black text, even if the banner has a dark background (e.g., primary color). Unlike the Banner close button, which has specific Tailwind classes that adapt it to dark mode (white text), these elements do not automatically adjust their colors.

Image

  <UBanner to="/guide-gouvernance-associative-crise" icon="i-ph-books-duotone" title="Guide Gouvernance Associative" :actions="[{label: 'Lire le guide', to: '/guide-gouvernance-associative-crise', variant: 'ghost', size: 'md', trailingIcon: 'i-ph-arrow-right'}, {label: 'Lire le guide', to: '/guide-gouvernance-associative-crise', variant: 'link', size: 'md'}]" close />

Would it be relevant to add a global attribute to components like Button, Badge, etc., to force their appearance in dark (or light) mode, regardless of the global setting? This would ensure better visual consistency when these elements are placed on a colored background (e.g., UPageCTA with solid variant).

Additional context

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how UButton, UBadge, and UBanner action colors are defined, comparing them with the Banner close button's dark-background classes. Clarify the intended global appearance API and its scope for dark and light backgrounds; done means ghost and link controls remain readable and visually consistent on colored backgrounds such as a primary UBanner or solid UPageCTA.

Written by the indexing model from the issue text.

Assessment

Tech stack
tailwindcss, typescript
Domain
design, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.