indielayer / ui

Vue 3 & Nuxt 3 UI Library with Tailwind CSS 3. 🚀 Build and prototype fast web applications.

Home Page:https://indielayer.com/ui/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

customizing theme colors doesn't work.

gunhaxxor opened this issue · comments

Hi there!
I tried to follow the instructions on how to customize the theme colors:

import UI, { colors } from '@indielayer/ui';

const app = createApp(App);

app.use(UI, {
  prefix: 'X',
  colors: {
    primary: colors.lime,
    secondary: colors.cyan,
    success: colors.teal,
    warning: colors.fuchsia,
    error: colors.rose,
  },
});

But there is no change to the brand colors. What could be wrong?

<XButton color="primary">Button</XButton> <-- this button is blue instead of lime

For my use case it's essential that I can tweak the available options for the color property of the components.

Thanks for reporting, there was a typo in the documentation. To customize the colors you need to nest it inside theme:

app.use(UI, {
  theme: {
    colors: {
      primary: colors.lime,
      secondary: colors.cyan,
      success: colors.teal,
      warning: colors.fuchsia,
      error: colors.rose,
    },
  },
})