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

Add custom variants #725

Closed
tobiasdiez opened this issue Sep 22, 2023 · 3 comments
Closed

Add custom variants #725

tobiasdiez opened this issue Sep 22, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@tobiasdiez
Copy link

Is your feature request related to a problem? Please describe.

Variants (say for buttons) are a convenient shortcut to apply a set of styles to a component. But this is currently limited to predefined variants.

Describe the solution you'd like

A way to define custom variants.

Describe alternatives you've considered

Not sure, but wrapping a component in a custom component that implements the styles is an option.

Additional context

Vue Tailwind implements such a feature (see https://www.vue-tailwind.com/docs/theming#variants).

@tobiasdiez tobiasdiez added the enhancement New feature or request label Sep 22, 2023
Copy link
Member

You can already define your own variants using the app.config.ts: https://ui.nuxt.com/getting-started/theming#components

export default defineAppConfig({
  ui: {
    button: {
      variant: {
        subtle: ''
      }
    }
  }
})

@theguriev
Copy link

How in this case extend the type hints?
image

@theguriev
Copy link

@benjamincanac and same question for the color. In color case ts will complain about it
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants