#Trying to change primary color with no success
18 messages · Page 1 of 1 (latest)
Based on the information provided in the knowledge sources, it appears you've followed the correct steps to change the primary color in your Nuxt UI application. However, there are a few additional points to consider that might help resolve your issue:
- Smart Safelisting: According to the Nuxt UI Theming documentation, the module automatically safelists the primary color classes. Since you've changed the primary color to "indigo", you might need to explicitly safelist it in your
nuxt.config.tsfile:
export default defineNuxtConfig({
ui: {
safelistColors: ['indigo']
}
})
-
Runtime Config: The Nuxt UI Theming documentation mentions that the
app.config.tsfile is used to customize the look and feel of components at runtime with hot-module-replacement (HMR). Make sure your Nuxt application is properly set up to use this configuration. -
Tailwind Config: Your
tailwind.config.tslooks correct, but ensure that you've defined all the shades from 50 to 950 for your custom "indigo" color, as mentioned in the Nuxt UI Theming documentation. -
CSS Variables: The Nuxt UI Pro Theming documentation mentions that some components use CSS variables for colors. You might need to update these variables in your
app.config.ts:
export default defineAppConfig({
ui: {
primary: "indigo",
gray: "cool",
variables: {
light: {
background: '255 255 255',
foreground: 'var(--color-gray-700)'
},
dark: {
background: 'var(--color-gray-900)',
foreground: 'var(--color-gray-200)'
}
}
}
})
If you've followed all these steps and are still experiencing issues, it's possible that there might be a conflict with other configurations or that the problem lies elsewhere in your setup. In that case, you might want to double-check your entire Nuxt and Tailwind configuration or seek further assistance by providing more details about your project structure and any error messages you're encountering.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@lyric jasper Kapa.ai is still learning and improving, please let me know how I did by reacting below.
I'm using the dashboard template from Nuxt UI Pro.
I removed color safelisting.
And editing it to the AI suggestions doesn't work.
@latent garden
Let me check the knowledge base for you again. One moment! :books:
Sorry @lyric jasper, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
@latent garden
Let me check the knowledge base for you again. One moment! :books:
Sorry @lyric jasper, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
@latent garden