invictus-codes / nuxt-vuetify

Add Vuetify 3 to your Nuxt application in seconds.
MIT License
73 stars 9 forks source link

Customize vuetifyOptions outside nuxt.config.ts? #25

Closed codeflorist closed 10 months ago

codeflorist commented 10 months ago

I would like to feed data from the tailwind-config into the vuetify-config.

Using the nuxt-tailwind module i can expose it's config lilke this:

import { theme } from '#tailwind-config'

I cannot however use this inside nuxt.config.ts, since it throws the error Cannot find module '#tailwind-config'.

Is there a way to manipulate the vuetifyOptions e.g. in a plugin, where the tailwind-config is available?

jvhellemondt commented 10 months ago

Hi Codeflorist,

Thank you.

I'm curious, what are you trying to do with the config inside the VuetifyOptions?

BR

codeflorist commented 10 months ago

@jvhellemondt

I want to feed tailwind's color definitions into vuetify's theme options, so the tailwind config is the central place to make color-definitions.

I have actually found a way, by simply including my tailwind.config.js inside nuxt.config.ts:

import { theme } from './tailwind.config.js'

Now i can to stuff like this:

vuetifyOptions: {
    theme: {
        defaultTheme: 'light',
        themes: {
            light: {
                colors: {
                    surface: theme.colors.primary[100],
                    primary: theme.colors.primary.DEFAULT,
...