-
Notifications
You must be signed in to change notification settings - Fork 696
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
Define variants inside a component #3681
Comments
Yes, using the |
No it's not possible, the |
It would be great if that also could be done from the component. We are creating our own abstractions in between nuxt ui and pass the props with v-bind=props That means when we create components which are custom and not from nuxt ui l, the tailwind variants aren't under app config ui but in the component itself. However i think it would be also more readable if the component variant was an option. As a solution we now have like Button.vue and button.theme.ts which is imported in app config. Any thoughts on this? @benjamincanac |
Unfortunately this is not how the library has been designed. The goal is to define all possible variants in the |
One last question about the variants. When defined inside app.config, is it possible to add new variants, or just completely override the existing one? |
You can't directly add new keys under |
Yes. Maybe variants and variant make ot confusing, but for example adding '2xl' key to sizes works as i have seen. I just wonder if it is possible to define variant, as primary and secondary and remove the solid, outline keys and all the others. The object merge probably kicks in here |
Description
Is it possible to define the same configuration that is defined in app.config, inside a component.
Now it seems that you can only define the slots, or class when there are no slots.
The text was updated successfully, but these errors were encountered: