Giter Site home page Giter Site logo

Comments (2)

stephenkhoo avatar stephenkhoo commented on May 21, 2024

I've tried to setup with similar setting, I can't get the configuration / theme to even work.

import { createApp } from 'vue'
import App from './components/App.vue'
import { variantJS, TButton } from '@variantjs/vue'

let app = createApp(App)

app.mount('#app')

const configuration = {
  't-button': {
    component: TButton,
    props: {
      fixedClasses: 'border-2 block w-full rounded text-gray-800',
      classes: 'border-2 block w-full rounded text-gray-800'
      // ...More settings
    }
  },
}

app.use(variantJS, configuration)

The classes or fixedClasses will not reflect when I use the component. :(

from vue.

alfonsobries avatar alfonsobries commented on May 21, 2024

@stephenkhoo docs are incorrect the correct syntax is this:

export const theme = {
  TButton: {
      // The fixed classes will never change and will be merged with the `classes` value or the active variant
      fixedClasses: 'focus:outline-none focus:shadow-outline inline-flex items-center transition ease-in-out duration-150',
      // Classes used when any variant is active
      classes: 'text-white bg-blue-600 hover:bg-blue-500 focus:border-blue-700 active:bg-blue-700 text-sm font-medium border border-transparent px-3 py-2 rounded-md',
      variants: {
          error: {
            classes: 'text-white bg-red-600 hover:bg-red-500 focus:border-red-700 active:bg-red-700 text-sm font-medium border border-transparent px-3 py-2 rounded-md',
          },
          success: {
            classes: 'text-white bg-green-600 hover:bg-green-500 focus:border-green-700 active:bg-green-700 text-sm font-medium border border-transparent px-3 py-2 rounded-md',
          }
      }
      // ...More settings
  },
};

I am updating the docs right now, feel free to open this ticket again if it doesn't work

from vue.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.