Commit 62f846877513b0eec2d0800d37f56e804c187572

Authored by Vben
1 parent 8e5740e7

chore: add windi.config.ts

tailwind.config.js renamed to windi.config.ts
1 -module.exports = {  
2 - mode: 'jit', 1 +import colors from 'windicss/colors';
  2 +import { defineConfig } from 'vite-plugin-windicss';
  3 +import { primaryColor } from './build/config/themeConfig';
  4 +
  5 +export default defineConfig({
3 darkMode: 'class', 6 darkMode: 'class',
4 plugins: [createEnterPlugin()], 7 plugins: [createEnterPlugin()],
5 - purge: {  
6 - enable: process.env.NODE_ENV === 'production',  
7 - content: ['./index.html', './src/**/*.{vue,ts,tsx}'],  
8 - },  
9 theme: { 8 theme: {
10 extend: { 9 extend: {
11 zIndex: { 10 zIndex: {
12 '-1': '-1', 11 '-1': '-1',
13 }, 12 },
14 colors: { 13 colors: {
15 - primary: {  
16 - DEFAULT: '#0960bd',  
17 - // dark: primaryColorDark,  
18 - }, 14 + ...colors,
  15 + primary: primaryColor,
19 }, 16 },
20 screens: { 17 screens: {
21 sm: '576px', 18 sm: '576px',
@@ -26,13 +23,14 @@ module.exports = { @@ -26,13 +23,14 @@ module.exports = {
26 }, 23 },
27 }, 24 },
28 }, 25 },
29 -}; 26 +});
  27 +
30 /** 28 /**
31 * Used for animation when the element is displayed 29 * Used for animation when the element is displayed
32 * @param maxOutput The larger the maxOutput output, the larger the generated css volume 30 * @param maxOutput The larger the maxOutput output, the larger the generated css volume
33 */ 31 */
34 -function createEnterPlugin(maxOutput = 6) {  
35 - const createCss = (index, d = 'x') => { 32 +function createEnterPlugin(maxOutput = 10) {
  33 + const createCss = (index: number, d = 'x') => {
36 const upd = d.toUpperCase(); 34 const upd = d.toUpperCase();
37 return { 35 return {
38 [`*> .enter-${d}:nth-child(${index})`]: { 36 [`*> .enter-${d}:nth-child(${index})`]: {