2024-05-19 13:20:42 +00:00
|
|
|
import type { Config } from 'tailwindcss';
|
|
|
|
|
|
|
|
import path from 'node:path';
|
|
|
|
|
2024-06-08 11:49:06 +00:00
|
|
|
import { fs, getPackagesSync } from '@vben/node-utils';
|
|
|
|
|
2024-05-19 13:20:42 +00:00
|
|
|
import { addDynamicIconSelectors } from '@iconify/tailwind';
|
|
|
|
import formsPlugin from '@tailwindcss/forms';
|
2024-05-28 15:38:36 +00:00
|
|
|
import typographyPlugin from '@tailwindcss/typography';
|
2024-05-19 13:20:42 +00:00
|
|
|
import animate from 'tailwindcss-animate';
|
2024-05-28 15:38:36 +00:00
|
|
|
|
2024-06-02 12:47:50 +00:00
|
|
|
import { enterAnimationPlugin } from './plugins/entry';
|
|
|
|
|
2024-05-19 13:20:42 +00:00
|
|
|
// import defaultTheme from 'tailwindcss/defaultTheme';
|
|
|
|
|
|
|
|
const { packages } = getPackagesSync();
|
|
|
|
|
|
|
|
const tailwindPackages: string[] = [];
|
|
|
|
|
|
|
|
packages.forEach((pkg) => {
|
|
|
|
// apps目录下和 @vben-core/tailwind-ui 包需要使用到 tailwindcss ui
|
|
|
|
if (fs.existsSync(path.join(pkg.dir, 'tailwind.config.mjs'))) {
|
|
|
|
tailwindPackages.push(pkg.dir);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default {
|
|
|
|
content: [
|
|
|
|
'./index.html',
|
|
|
|
...tailwindPackages.map((item) =>
|
|
|
|
path.join(item, 'src/**/*.{vue,js,ts,jsx,tsx,svelte,astro,html}'),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
darkMode: 'class',
|
2024-06-02 12:47:50 +00:00
|
|
|
plugins: [
|
|
|
|
animate,
|
|
|
|
formsPlugin,
|
|
|
|
typographyPlugin,
|
|
|
|
addDynamicIconSelectors(),
|
|
|
|
enterAnimationPlugin,
|
|
|
|
],
|
2024-05-19 13:20:42 +00:00
|
|
|
prefix: '',
|
|
|
|
safelist: ['dark'],
|
|
|
|
theme: {
|
|
|
|
container: {
|
|
|
|
center: true,
|
|
|
|
padding: '2rem',
|
|
|
|
screens: {
|
|
|
|
'2xl': '1400px',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
extend: {
|
|
|
|
animation: {
|
|
|
|
'accordion-down': 'accordion-down 0.2s ease-out',
|
|
|
|
'accordion-up': 'accordion-up 0.2s ease-out',
|
|
|
|
'collapsible-down': 'collapsible-down 0.2s ease-in-out',
|
|
|
|
'collapsible-up': 'collapsible-up 0.2s ease-in-out',
|
|
|
|
float: 'float 5s linear 0ms infinite',
|
|
|
|
},
|
2024-06-16 07:45:15 +00:00
|
|
|
animationDuration: {
|
|
|
|
'2000': '2000ms',
|
|
|
|
'3000': '3000ms',
|
|
|
|
},
|
2024-05-19 13:20:42 +00:00
|
|
|
borderRadius: {
|
2024-06-23 06:21:27 +00:00
|
|
|
lg: 'var(--radius)',
|
|
|
|
md: 'calc(var(--radius) - 2px)',
|
|
|
|
sm: 'calc(var(--radius) - 4px)',
|
|
|
|
xl: 'calc(var(--radius) + 4px)',
|
2024-05-19 13:20:42 +00:00
|
|
|
},
|
|
|
|
colors: {
|
|
|
|
accent: {
|
2024-06-23 06:21:27 +00:00
|
|
|
DEFAULT: 'hsl(var(--accent))',
|
|
|
|
foreground: 'hsl(var(--accent-foreground))',
|
|
|
|
hover: 'hsl(var(--accent-hover))',
|
2024-05-19 13:20:42 +00:00
|
|
|
},
|
2024-06-23 06:21:27 +00:00
|
|
|
background: 'hsl(var(--background))',
|
|
|
|
border: 'hsl(var(--border))',
|
2024-05-19 13:20:42 +00:00
|
|
|
card: {
|
2024-06-23 06:21:27 +00:00
|
|
|
DEFAULT: 'hsl(var(--card))',
|
|
|
|
foreground: 'hsl(var(--card-foreground))',
|
2024-05-19 13:20:42 +00:00
|
|
|
},
|
|
|
|
destructive: {
|
2024-06-23 06:21:27 +00:00
|
|
|
DEFAULT: 'hsl(var(--destructive))',
|
|
|
|
foreground: 'hsl(var(--destructive-foreground))',
|
2024-05-19 13:20:42 +00:00
|
|
|
},
|
2024-06-23 06:21:27 +00:00
|
|
|
foreground: 'hsl(var(--foreground) / <alpha-value>)',
|
2024-05-19 13:20:42 +00:00
|
|
|
heavy: {
|
2024-06-23 06:21:27 +00:00
|
|
|
DEFAULT: 'hsl(var(--heavy))',
|
|
|
|
foreground: 'hsl(var(--heavy-foreground))',
|
2024-05-19 13:20:42 +00:00
|
|
|
},
|
|
|
|
input: {
|
2024-06-23 06:21:27 +00:00
|
|
|
DEFAULT: 'hsl(var(--input))',
|
|
|
|
background: 'hsl(var(--input-background))',
|
2024-05-19 13:20:42 +00:00
|
|
|
},
|
|
|
|
muted: {
|
2024-06-23 06:21:27 +00:00
|
|
|
DEFAULT: 'hsl(var(--muted))',
|
|
|
|
foreground: 'hsl(var(--muted-foreground))',
|
2024-05-19 13:20:42 +00:00
|
|
|
},
|
2024-06-23 06:21:27 +00:00
|
|
|
overlay: 'hsl(var(--overlay))',
|
2024-05-19 13:20:42 +00:00
|
|
|
popover: {
|
2024-06-23 06:21:27 +00:00
|
|
|
DEFAULT: 'hsl(var(--popover))',
|
|
|
|
foreground: 'hsl(var(--popover-foreground))',
|
2024-05-19 13:20:42 +00:00
|
|
|
},
|
|
|
|
primary: {
|
2024-06-23 06:21:27 +00:00
|
|
|
DEFAULT: 'hsl(var(--primary) / <alpha-value>)',
|
|
|
|
foreground: 'hsl(var(--primary-foreground) / <alpha-value>)',
|
2024-05-19 13:20:42 +00:00
|
|
|
},
|
2024-06-23 06:21:27 +00:00
|
|
|
ring: 'hsl(var(--ring))',
|
2024-05-19 13:20:42 +00:00
|
|
|
secondary: {
|
2024-06-23 06:21:27 +00:00
|
|
|
DEFAULT: 'hsl(var(--secondary) / <alpha-value>)',
|
|
|
|
desc: 'hsl(var(--secondary-desc) / <alpha-value>)',
|
|
|
|
foreground: 'hsl(var(--secondary-foreground) / <alpha-value>)',
|
|
|
|
},
|
|
|
|
success: {
|
|
|
|
DEFAULT: 'hsl(var(--success))',
|
|
|
|
foreground: 'hsl(var(--success-foreground))',
|
|
|
|
},
|
|
|
|
warning: {
|
|
|
|
DEFAULT: 'hsl(var(--warning))',
|
|
|
|
foreground: 'hsl(var(--warning-foreground))',
|
2024-05-19 13:20:42 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
fontFamily: {
|
|
|
|
sans: [
|
|
|
|
'var(--font-geist-sans)',
|
|
|
|
// ...defaultTheme.fontFamily.sans
|
|
|
|
],
|
|
|
|
},
|
|
|
|
keyframes: {
|
|
|
|
'accordion-down': {
|
|
|
|
from: { height: '0' },
|
|
|
|
to: { height: 'var(--radix-accordion-content-height)' },
|
|
|
|
},
|
|
|
|
'accordion-up': {
|
|
|
|
from: { height: 'var(--radix-accordion-content-height)' },
|
|
|
|
to: { height: '0' },
|
|
|
|
},
|
|
|
|
'collapsible-down': {
|
|
|
|
from: { height: '0' },
|
|
|
|
to: { height: 'var(--radix-collapsible-content-height)' },
|
|
|
|
},
|
|
|
|
'collapsible-up': {
|
|
|
|
from: { height: 'var(--radix-collapsible-content-height)' },
|
|
|
|
to: { height: '0' },
|
|
|
|
},
|
|
|
|
float: {
|
|
|
|
'0%': { transform: 'translateY(0)' },
|
|
|
|
'50%': { transform: 'translateY(-20px)' },
|
|
|
|
'100%': { transform: 'translateY(0)' },
|
|
|
|
},
|
|
|
|
},
|
|
|
|
zIndex: {
|
|
|
|
'100': '100',
|
|
|
|
'1000': '1000',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
} as Config;
|