@dt-frames/tailwind-config 4.0.2 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ import { Config } from 'tailwindcss';
2
+
3
+ declare const _default: Config;
4
+
5
+ export = _default;
@@ -0,0 +1,5 @@
1
+ import { Config } from 'tailwindcss';
2
+
3
+ declare const _default: Config;
4
+
5
+ export { _default as default };
@@ -0,0 +1,5 @@
1
+ import { Config } from 'tailwindcss';
2
+
3
+ declare const _default: Config;
4
+
5
+ export = _default;
@@ -15,7 +15,6 @@ const postcss_config = {
15
15
  // 修复 element-plus的样式和tailwindcss冲突问题
16
16
  "postcss-antd-fixes": { prefixes: ["el"] },
17
17
  "postcss-import": {},
18
- "postcss-preset-env": {},
19
18
  tailwindcss: { config: index }
20
19
  }
21
20
  };
@@ -0,0 +1,3 @@
1
+ declare const _default: Record<string, any>;
2
+
3
+ export = _default;
@@ -0,0 +1,3 @@
1
+ declare const _default: Record<string, any>;
2
+
3
+ export { _default as default };
@@ -0,0 +1,3 @@
1
+ declare const _default: Record<string, any>;
2
+
3
+ export = _default;
@@ -13,7 +13,6 @@ const postcss_config = {
13
13
  // 修复 element-plus的样式和tailwindcss冲突问题
14
14
  "postcss-antd-fixes": { prefixes: ["el"] },
15
15
  "postcss-import": {},
16
- "postcss-preset-env": {},
17
16
  tailwindcss: { config }
18
17
  }
19
18
  };
package/package.json CHANGED
@@ -1,48 +1,56 @@
1
- {
2
- "name": "@dt-frames/tailwind-config",
3
- "version": "4.0.2",
4
- "description": "css原子化",
5
- "scripts": {
6
- "build": "pnpm unbuild"
7
- },
8
- "keywords": [],
9
- "author": "",
10
- "license": "ISC",
11
- "main": "./dist/index.mjs",
12
- "module": "./dist/index.mjs",
13
- "exports": {
14
- ".": {
15
- "types": "./src/index.ts",
16
- "import": "./dist/index.mjs",
17
- "require": "./dist/index.cjs"
18
- },
19
- "./postcss": {
20
- "types": "./src/postcss.config.ts",
21
- "import": "./dist/postcss.config.mjs",
22
- "require": "./dist/postcss.config.cjs",
23
- "default": "./dist/postcss.config.mjs"
24
- },
25
- "./*": "./*"
26
- },
27
- "peerDependencies": {
28
- "tailwindcss": "^4.1.7"
29
- },
30
- "dependencies": {
31
- "@dt-frames/ts-config": "workspace:*",
32
- "@iconify/json": "^2.2.335",
33
- "@iconify/tailwind": "^1.2.0",
34
- "@manypkg/get-packages": "^3.1.0",
35
- "@tailwindcss/postcss": "^4.1.13",
36
- "@tailwindcss/typography": "^0.5.16",
37
- "@types/node": "^22.14.0",
38
- "autoprefixer": "^10.4.21",
39
- "cssnano": "^7.1.1",
40
- "postcss": "^8.5.6",
41
- "postcss-import": "^16.1.1",
42
- "tailwindcss-animate": "^1.0.7",
43
- "unbuild": "^3.5.0"
44
- },
45
- "devDependencies": {
46
- "@types/postcss-import": "^14.0.3"
47
- }
48
- }
1
+ {
2
+ "name": "@dt-frames/tailwind-config",
3
+ "version": "4.0.4",
4
+ "description": "css 原子化",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "keywords": [],
9
+ "author": "",
10
+ "license": "ISC",
11
+ "main": "./dist/index.mjs",
12
+ "module": "./dist/index.mjs",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.mjs",
17
+ "require": "./dist/index.cjs"
18
+ },
19
+ "./postcss": {
20
+ "types": "./dist/postcss.config.d.ts",
21
+ "import": "./dist/postcss.config.mjs",
22
+ "require": "./dist/postcss.config.cjs",
23
+ "default": "./dist/postcss.config.mjs"
24
+ },
25
+ "./*": "./*"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public",
29
+ "registry": "https://registry.npmjs.org/"
30
+ },
31
+ "peerDependencies": {
32
+ "tailwindcss": "^4.1.7"
33
+ },
34
+ "dependencies": {
35
+ "@dt-frames/ts-config": "4.0.3",
36
+ "@iconify/json": "^2.2.335",
37
+ "@iconify/tailwind": "^1.2.0",
38
+ "@manypkg/get-packages": "^3.1.0",
39
+ "@tailwindcss/postcss": "^4.1.13",
40
+ "@tailwindcss/typography": "^0.5.16",
41
+ "@types/node": "^22.14.0",
42
+ "autoprefixer": "^10.4.21",
43
+ "cssnano": "^7.1.1",
44
+ "postcss": "^8.5.6",
45
+ "postcss-antd-fixes": "^0.2.0",
46
+ "postcss-import": "^16.1.1",
47
+ "tailwindcss-animate": "^1.0.7",
48
+ "unbuild": "^3.5.0"
49
+ },
50
+ "devDependencies": {
51
+ "@types/postcss-import": "^14.0.3"
52
+ },
53
+ "scripts": {
54
+ "build": "pnpm unbuild"
55
+ }
56
+ }
package/build.config.ts DELETED
@@ -1,11 +0,0 @@
1
- import { defineBuildConfig } from 'unbuild'
2
-
3
- export default defineBuildConfig({
4
- clean: true,
5
- declaration: false,
6
- failOnWarn: false,
7
- entries: ['./src/index', './src/postcss.config'],
8
- rollup: {
9
- emitCJS: true,
10
- }
11
- })
package/src/index.ts DELETED
@@ -1,218 +0,0 @@
1
- import type { Config } from 'tailwindcss'
2
- import path from 'node:path'
3
- import { addDynamicIconSelectors } from '@iconify/tailwind'
4
- import { getPackagesSync } from '@manypkg/get-packages'
5
- import typographyPlugin from '@tailwindcss/typography'
6
- import animate from 'tailwindcss-animate'
7
- import { enterAnimationPlugin } from './plugins/entry'
8
-
9
- const { packages } = getPackagesSync(process.cwd())
10
- const tailwindPackages: string[] = []
11
- packages.forEach(pkg => {
12
- tailwindPackages.push(pkg.dir)
13
- })
14
-
15
- const shadcnUiColors = {
16
- accent: {
17
- DEFAULT: 'hsl(var(--accent))',
18
- foreground: 'hsl(var(--accent-foreground))',
19
- hover: 'hsl(var(--accent-hover))',
20
- lighter: 'has(val(--accent-lighter))'
21
- },
22
- background: {
23
- deep: 'hsl(var(--background-deep))',
24
- DEFAULT: 'hsl(var(--background))'
25
- },
26
- border: {
27
- DEFAULT: 'hsl(var(--border))'
28
- },
29
- card: {
30
- DEFAULT: 'hsl(var(--card))',
31
- foreground: 'hsl(var(--card-foreground))'
32
- },
33
- destructive: {
34
- ...createColorsPalette('destructive'),
35
- DEFAULT: 'hsl(var(--destructive))'
36
- },
37
- foreground: {
38
- DEFAULT: 'hsl(var(--foreground))'
39
- },
40
- input: {
41
- background: 'hsl(var(--input-background))',
42
- DEFAULT: 'hsl(var(--input))'
43
- },
44
- muted: {
45
- DEFAULT: 'hsl(var(--muted))',
46
- foreground: 'hsl(var(--muted-foreground))'
47
- },
48
- popover: {
49
- DEFAULT: 'hsl(var(--popover))',
50
- foreground: 'hsl(var(--popover-foreground))'
51
- },
52
- primary: {
53
- ...createColorsPalette('primary'),
54
- DEFAULT: 'hsl(var(--primary))'
55
- },
56
- ring: 'hsl(var(--ring))',
57
- secondary: {
58
- DEFAULT: 'hsl(var(--secondary))',
59
- desc: 'hsl(var(--secondary-desc))',
60
- foreground: 'hsl(var(--secondary-foreground))'
61
- }
62
- }
63
-
64
- const customColors = {
65
- green: {
66
- ...createColorsPalette('green'),
67
- foreground: 'hsl(var(--success-foreground))'
68
- },
69
- header: {
70
- DEFAULT: 'hsl(var(--header))'
71
- },
72
- heavy: {
73
- DEFAULT: 'hsl(var(--heavy))',
74
- foreground: 'hsl(var(--heavy-foreground))'
75
- },
76
- main: {
77
- DEFAULT: 'hsl(var(--main))'
78
- },
79
- overlay: {
80
- content: 'hsl(var(--overlay-content))',
81
- DEFAULT: 'hsl(var(--overlay))'
82
- },
83
- red: {
84
- ...createColorsPalette('red'),
85
- foreground: 'hsl(var(--destructive-foreground))'
86
- },
87
- sidebar: {
88
- deep: 'hsl(var(--sidebar-deep))',
89
- DEFAULT: 'hsl(var(--sidebar))'
90
- },
91
- success: {
92
- ...createColorsPalette('success'),
93
- DEFAULT: 'hsl(var(--success))'
94
- },
95
- warning: {
96
- ...createColorsPalette('warning'),
97
- DEFAULT: 'hsl(var(--warning))'
98
- },
99
- yellow: {
100
- ...createColorsPalette('yellow'),
101
- foreground: 'hsl(var(--warning-foreground))'
102
- }
103
- }
104
-
105
- export default {
106
- content: [
107
- './index.html',
108
- ...tailwindPackages.map(item =>
109
- path.join(item, 'src/**/*.{vue,js,ts,jsx,tsx,svelte,astro,html}')
110
- )
111
- ],
112
- darkMode: 'selector',
113
- plugins: [animate, typographyPlugin, addDynamicIconSelectors(), enterAnimationPlugin],
114
- prefix: '',
115
- theme: {
116
- container: {
117
- center: true,
118
- padding: '2rem',
119
- screens: {
120
- '2xl': '1400px'
121
- }
122
- },
123
- extend: {
124
- animation: {
125
- 'accordion-down': 'accordion-down 0.2s ease-out',
126
- 'accordion-up': 'accordion-up 0.2s ease-out',
127
- 'collapsible-down': 'collapsible-down 0.2s ease-in-out',
128
- 'collapsible-up': 'collapsible-up 0.2s ease-in-out',
129
- float: 'float 5s linear 0ms infinite'
130
- }
131
- },
132
- animationDuration: {
133
- '2000': '2000ms',
134
- '3000': '3000ms'
135
- },
136
- borderRadius: {
137
- lg: 'var(--radius)',
138
- md: 'calc(var(--radius) - 2px)',
139
- sm: 'calc(var(--radius) - 4px)',
140
- xl: 'calc(var(--radius) + 4px)'
141
- },
142
- boxShadow: {
143
- float: `0 6px 16px 0 rgb(0 0 0 / 8%),
144
- 0 3px 6px -4px rgb(0 0 0 / 12%),
145
- 0 9px 28px 8px rgb(0 0 0 / 5%)`
146
- },
147
- colors: {
148
- ...customColors,
149
- ...shadcnUiColors
150
- },
151
- fontFamily: {
152
- sans: ['var(--font-family)']
153
- },
154
- keyframes: {
155
- 'accordion-down': {
156
- from: { height: '0' },
157
- to: { height: 'var(--radix-accordion-content-height)' }
158
- },
159
- 'accordion-up': {
160
- from: { height: 'var(--radix-accordion-content-height)' },
161
- to: { height: '0' }
162
- },
163
- 'collapsible-down': {
164
- from: { height: '0' },
165
- to: { height: 'var(--radix-collapsible-content-height)' }
166
- },
167
- 'collapsible-up': {
168
- from: { height: 'var(--radix-collapsible-content-height)' },
169
- to: { height: '0' }
170
- },
171
- float: {
172
- '0%': { transform: 'translateY(0)' },
173
- '50%': { transform: 'translateY(-20px)' },
174
- '100%': { transform: 'translateY(0)' }
175
- }
176
- },
177
- zIndex: {
178
- '100': '100',
179
- '1000': '1000'
180
- }
181
- },
182
- safelist: ['dark']
183
- } as Config
184
-
185
- function createColorsPalette(name: string) {
186
- return {
187
- 50: `hsl(var(--${name}-50))`,
188
- 100: `hsl(var(--${name}-100))`,
189
- 200: `hsl(var(--${name}-200))`,
190
- 300: `hsl(var(--${name}-300))`,
191
- 400: `hsl(var(--${name}-400))`,
192
- 500: `hsl(var(--${name}-500))`,
193
- 600: `hsl(var(--${name}-600))`,
194
- 700: `hsl(var(--${name}-700))`,
195
-
196
- // 激活状态下的颜色,适用于按钮按下时的背景色或边框色。
197
- active: `hsl(var(--${name}-700))`,
198
- // 浅色背景,适用于输入框或表单区域的背景。
199
- 'background-light': `hsl(var(--${name}-200))`,
200
- // 适用于略浅的背景色,通常用于次要背景或略浅的区域。
201
- 'background-lighter': `hsl(var(--${name}-100))`,
202
- // 最浅的背景色,适用于非常轻微的阴影或卡片的背景。
203
- 'background-lightest': `hsl(var(--${name}-50))`,
204
- // 适用于普通边框,可能用于按钮或卡片的边框。
205
- border: `hsl(var(--${name}-400))`,
206
- // 浅色边框,适用于输入框或卡片的边框。
207
- 'border-light': `hsl(var(--${name}-300))`,
208
- foreground: `hsl(var(--${name}-foreground))`,
209
- // 鼠标悬停状态下的颜色,适用于按钮悬停时的背景色或边框色。
210
- hover: `hsl(var(--${name}-600))`,
211
- // 主色文本
212
- text: `hsl(var(--${name}-500))`,
213
- // 主色文本激活态
214
- 'text-active': `hsl(var(--${name}-700))`,
215
- // 主色文本悬浮态
216
- 'text-hover': `hsl(var(--${name}-600))`
217
- }
218
- }
@@ -1,54 +0,0 @@
1
- import plugin from 'tailwindcss/plugin.js'
2
-
3
- const enterAnimationPlugin = plugin(({ addUtilities }) => {
4
- const maxChild = 5
5
- const utilities: Record<string, any> = {}
6
-
7
- for (let i = 1; i <= maxChild; i++) {
8
- const baseDelay = 0.1
9
- const delay = `${baseDelay * i}s`
10
-
11
- utilities[`.enter-x:nth-child(${i})`] = {
12
- animation: `enter-x-animation 0.3s ease-in-out ${delay} forwards`,
13
- opacity: '0',
14
- transform: `translateX(50px)`,
15
- }
16
-
17
- utilities[`.enter-y:nth-child(${i})`] = {
18
- animation: `enter-y-animation 0.3s ease-in-out ${delay} forwards`,
19
- opacity: '0',
20
- transform: `translateY(50px)`,
21
- }
22
-
23
- utilities[`.-enter-x:nth-child(${i})`] = {
24
- animation: `enter-x-animation 0.3s ease-in-out ${delay} forwards`,
25
- opacity: '0',
26
- transform: `translateX(-50px)`,
27
- }
28
-
29
- utilities[`.-enter-y:nth-child(${i})`] = {
30
- animation: `enter-y-animation 0.3s ease-in-out ${delay} forwards`,
31
- opacity: '0',
32
- transform: `translateY(-50px)`,
33
- }
34
- }
35
-
36
- // 添加动画关键帧
37
- addUtilities(utilities)
38
- addUtilities({
39
- '@keyframes enter-x-animation': {
40
- to: {
41
- opacity: '1',
42
- transform: 'translateX(0)'
43
- }
44
- },
45
- '@keyframes enter-y-animation': {
46
- to: {
47
- opacity: '1',
48
- transform: 'translateY(0)'
49
- }
50
- }
51
- })
52
- })
53
-
54
- export { enterAnimationPlugin }
@@ -1,13 +0,0 @@
1
- import config from './index'
2
-
3
- export default {
4
- plugins: {
5
- ...(process.env.NODE_ENV === 'production' ? { cssnano: {} } : {}),
6
- autoprefixer: {},
7
- // 修复 element-plus的样式和tailwindcss冲突问题
8
- 'postcss-antd-fixes': { prefixes: ['el'] },
9
- 'postcss-import': {},
10
- 'postcss-preset-env': {},
11
- tailwindcss: { config }
12
- }
13
- }
package/tsconfig.json DELETED
@@ -1,9 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "extends": "@dt-frames/ts-config/node.json",
4
- "compilerOptions": {
5
- "moduleResolution": "bundler"
6
- },
7
- "include": ["src"],
8
- "exclude": ["node_modules"]
9
- }