tailwindcss-vue icon indicating copy to clipboard operation
tailwindcss-vue copied to clipboard

Theme system

Open g0shed opened this issue 4 years ago • 5 comments

Is it possible to get some explanation on the theme system? And how to change it etc?

g0shed avatar Oct 10 '20 22:10 g0shed

Hey, thank you for your interest in the project. Are you able to clone and run the project locally? During the install process you are able to pass in your own theme object that contains the properties needed to style it your own way.

mt-dev44 avatar Oct 11 '20 17:10 mt-dev44

Hey, thank you for your interest in the project. Are you able to clone and run the project locally? During the install process you are able to pass in your own theme object that contains the properties needed to style it your own way.

yes, I understand, but If I'm using for example just the Table component it starts complaining about not having the theme, i basically have to pass the theme-override prop every time i call a component

g0shed avatar Oct 20 '20 09:10 g0shed

Do you have an example of how you are including it?

mt-dev44 avatar Oct 20 '20 13:10 mt-dev44

in nuxt for example, I pull a component like this:

import { Button } from '@advanced-data-machines/tailwindcss-vue';

...
components: {
    Button,
},
...

g0shed avatar Oct 22 '20 11:10 g0shed

The best way to handle that is just install the specific component and override the theme.

import { Button } from '@advanced-data-machines/tailwindcss-vue';
const custom = {
    theme: {
        TvButton: {
            ...
        }
    }
};
Vue.use(Button, custom);

Can also install just an array of components.

import Twv, { Button } from '@advanced-data-machines/tailwindcss-vue';

const components = [Button];
const custom = {
    theme: {
        TvButton: {
            ...
        }
    },
    components
};
Vue.use(Twv, custom);

This way you handle the config once.

Let me know if you have other issues or errors.

mt-dev44 avatar Oct 26 '20 23:10 mt-dev44