Skip to content
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

Can't Custom default props in app.config.ts #3574

Closed
narr07 opened this issue Mar 15, 2025 · 5 comments
Closed

Can't Custom default props in app.config.ts #3574

narr07 opened this issue Mar 15, 2025 · 5 comments
Labels
bug Something isn't working v3 #1289

Comments

@narr07
Copy link
Contributor

narr07 commented Mar 15, 2025

Environment



Is this bug related to Nuxt or Vue?

Nuxt

Version

v3.16.0

Reproduction

https://codesandbox.io/p/devbox/stoic-curran-tvdyvz

Description

The default card not override with custom

// app/app.config.ts
export default defineAppConfig({
  ui: {
    colors: {
      primary: "permadi",
      neutral: "slate",
    },
    card: {
      slots: {
        root: "bg-primary-300 ring-2 ring-primary-900 divide-y divide-primary-900 rounded-[calc(var(--ui-radius)*2)]",
        header: "p-4 sm:px-6",
        body: "p-4 sm:p-6",
        footer: "p-4 sm:px-6",
      },
    },
  },
});


This main.css

@import "tailwindcss" theme(static);
@import "@nuxt/ui";

@theme static {
  --font-sans: "Host Grotesk", sans-serif;
  --font-title: "Sofia Sans", sans-serif;

  --color-permadi-50: #edf5f3;
  --color-permadi-100: #d7e9e4;
  --color-permadi-200: #c1ddd5;
  --color-permadi-300: #abd1c6;
  --color-permadi-400: #80aea5;
  --color-permadi-500: #568c85;
  --color-permadi-600: #2b6964;
  --color-permadi-700: #004643;
  --color-permadi-800: #023230;
  --color-permadi-900: #031e1c;
  --color-permadi-950: #050a09;
}

body {
  @apply bg-white;
}

Additional context

No response

Logs

@narr07 narr07 added bug Something isn't working triage v3 #1289 labels Mar 15, 2025
@narr07
Copy link
Contributor Author

narr07 commented Mar 15, 2025

The ring and the bg-card not override from app.config.ts

Image

@HugoRCD
Copy link
Member

HugoRCD commented Mar 16, 2025

@narr07 To use a custom color in primary, you need to add the new name to your nuxt.config.ts

Image

https://ui.nuxt.com/getting-started/theme#colors

@luismanolo
Copy link

I have the same problem.

This is my nuxt.config.js:

Image

This is my app.config.js:

Image

This is my code:

Image

And this is my default (primary) color submit button:

Image

Many thanks in advance.

@HugoRCD
Copy link
Member

HugoRCD commented Mar 16, 2025

@luismanolo Could you make a reproduction because I can't reproduce your error locally?

@luismanolo
Copy link

Sorry.

The app.config.ts file was in the project root, not in the app/ directory.

Everything is fine for me.

Many thanks.

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

No branches or pull requests

4 participants