Skip to content

tailwindcss neutral color missing #3986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Racusthor opened this issue Apr 25, 2025 · 2 comments
Open

tailwindcss neutral color missing #3986

Racusthor opened this issue Apr 25, 2025 · 2 comments
Labels
bug Something isn't working triage v3 #1289

Comments

@Racusthor
Copy link

Environment

Is this bug related to Nuxt or Vue?

Nuxt

Version

v3.1.0

Reproduction

/* main.css */
@import "tailwindcss" theme(static);
@import "@nuxt/ui";

Description

When using the css above, the neutral color (eg. --color-neutral-50, --color-neutral-100, etc ) tailwind variables are missing in the output css file (in :root, :host {} )
They are there when not importing @nuxt/ui

Additional context

No response

Logs

@Racusthor Racusthor added bug Something isn't working triage v3 #1289 labels Apr 25, 2025
@benjamincanac
Copy link
Member

This is intended, we convert the default Tailwind CSS color named neutral to old-neutral and define our own dynamic neutral color based on AppConfig but this shouldn't be a problem for you. What issue are you encountering exactly?

https://github.com/nuxt/ui/blob/v3/src/templates.ts#L80

@Racusthor
Copy link
Author

I import the tailwind colors and then use the tailwind css variables in my colorpicker:

import colors from 'tailwindcss/colors'

      class="inline-block bg-[var(--color-light)] dark:bg-[var(--color-dark)] rounded-full size-4" :style="{
        '--color-light': `var(--color-${color}-500)`,
        '--color-dark': `var(--color-${color}-400)`,
      }"
    />

It seems, due to this, it's no longer possible to assign de tailwind 'neutral' color to Nuxt UI neutral:
appConfig.ui.colors.neutral = 'neutral'
appConfig.ui.colors.neutral = 'old-neutral'

both of these do not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage v3 #1289
Projects
None yet
Development

No branches or pull requests

2 participants