Skip to content
This repository was archived by the owner on Sep 24, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/nuxt-ui-vue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

<template>
<div class="grid place-items-center w-full min-h-screen">
<UAvatar src="https://github.com/selemondev.pg" icon="ph:moon" />
<UButtonGroup size="sm" orientation="horizontal">
<UButton icon="ph:music-notes" label="Music" />
<UButton icon="ph:music-notes" label="Music" color="red" />
<UButton icon="ph:music-notes" label="Music" color="red" />
</UButtonGroup>
</div>
</template>
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import { useVariants } from '../../../composables/useVariants'

const props = defineProps({
...getVariantPropsWithClassesList<UButtonGroup>(),
vertical: {
type: Boolean,
default: false,
orientation: {
type: String,
default: 'horizontal',
},
})

const variant = computed(() => {
const customProps = {
...props,
variant: props.vertical ? 'vertical' : 'horizontal',
variant: props.orientation === 'vertical' ? 'vertical' : 'horizontal',
}
return useVariants<UButtonGroup>(
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
Expand Down
32 changes: 32 additions & 0 deletions packages/nuxt-ui-vue/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,41 @@
/* eslint-disable no-unused-expressions */
import tailwindColors from './node_modules/tailwindcss/colors'

const colorSafeList = []

const deprecated = ['lightBlue', 'warmGray', 'trueGray', 'coolGray', 'blueGray']

for (const colorName in tailwindColors) {
if (deprecated.includes(colorName))
continue

const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900]

const pallette = tailwindColors[colorName]

if (typeof pallette === 'object') {
shades.forEach((shade) => {
if (shade in pallette) {
colorSafeList.push(`text-${colorName}-${shade}`),
colorSafeList.push(`accent-${colorName}-${shade}`),
colorSafeList.push(`bg-${colorName}-${shade}`),
colorSafeList.push(`hover:enabled:bg-${colorName}-${shade}`),
colorSafeList.push(`focus:bg-${colorName}-${shade}`),
colorSafeList.push(`ring-${colorName}-${shade}`),
colorSafeList.push(`focus:ring-${colorName}-${shade}`),
colorSafeList.push(`border-${colorName}-${shade}`)
}
})
}
}
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
darkMode: 'class',
safelist: colorSafeList,
theme: {
extend: {
colors: tailwindColors,
backgroundColor: ['disabled'],
textColor: ['disabled'],
fontFamily: {
Expand Down