tailvue icon indicating copy to clipboard operation
tailvue copied to clipboard

How to customize style with tailwindcss?

Open pheng0077 opened this issue 2 years ago • 1 comments

pheng0077 avatar Jul 27 '22 06:07 pheng0077

For some of the components like the <PushButton /> you can provide your own custom theme. So you can pass customTheme prop like so:

<script lang="ts" setup>
import { PushButton, PushButtonTheme } from 'tailvue'

const customTheme: PushButtonTheme = {
  primary: 'border border-transparent font-medium rounded shadow-sm text-white bg-cyan-600',
  active: 'hover:bg-cyan-500 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-cyan-500 focus:shadow-outline-cyan active:bg-cyan-700',
  disabled: '',
}
</script>
<template>
  <push-button :custom-theme="customTheme"> Custom Theme </push-button>
</template>

This theme has a type PushButtonTheme you can import if you are using TS to get the proper typing.

image

tcampbPPU avatar Jul 27 '22 13:07 tcampbPPU