@udixio/tailwind 1.1.0 → 1.2.1
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.
- package/CHANGELOG.md +20 -0
- package/dist/index.cjs +27 -2
- package/dist/index.js +27 -2
- package/dist/tailwind.plugin.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/main.ts +5 -1
- package/src/plugins-tailwind/shadow.ts +32 -0
- package/src/tailwind.plugin.ts +0 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## 1.2.1 (2025-08-22)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **tailwind:** remove unused imports and enhance breakpoint parsing ([34dc995](https://github.com/Udixio/UI/commit/34dc995))
|
|
6
|
+
|
|
7
|
+
### ❤️ Thank You
|
|
8
|
+
|
|
9
|
+
- Joël VIGREUX
|
|
10
|
+
|
|
11
|
+
## 1.2.0 (2025-08-21)
|
|
12
|
+
|
|
13
|
+
### 🚀 Features
|
|
14
|
+
|
|
15
|
+
- **tailwind:** add custom shadow utility plugin ([8e3485e](https://github.com/Udixio/UI/commit/8e3485e))
|
|
16
|
+
|
|
17
|
+
### ❤️ Thank You
|
|
18
|
+
|
|
19
|
+
- Joël VIGREUX
|
|
20
|
+
|
|
1
21
|
## 1.1.0 (2025-08-21)
|
|
2
22
|
|
|
3
23
|
### 🚀 Features
|
package/dist/index.cjs
CHANGED
|
@@ -128,6 +128,30 @@ const font = plugin.withOptions((options) => {
|
|
|
128
128
|
addUtilities(newUtilities);
|
|
129
129
|
};
|
|
130
130
|
});
|
|
131
|
+
const shadow = plugin(
|
|
132
|
+
({ addUtilities }) => {
|
|
133
|
+
addUtilities({
|
|
134
|
+
[".shadow"]: {
|
|
135
|
+
boxShadow: "0 4px 10px #00000008, 0 0 2px #0000000f, 0 2px 6px #0000001f"
|
|
136
|
+
},
|
|
137
|
+
[".shadow-1"]: {
|
|
138
|
+
boxShadow: "0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30)"
|
|
139
|
+
},
|
|
140
|
+
[".shadow-2"]: {
|
|
141
|
+
boxShadow: "0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30)"
|
|
142
|
+
},
|
|
143
|
+
[".shadow-3"]: {
|
|
144
|
+
boxShadow: "0px 1px 3px 0px rgba(0, 0, 0, 0.30), 0px 4px 8px 3px rgba(0, 0, 0, 0.15)"
|
|
145
|
+
},
|
|
146
|
+
[".shadow-4"]: {
|
|
147
|
+
boxShadow: "0px 2px 3px 0px rgba(0, 0, 0, 0.30), 0px 6px 10px 4px rgba(0, 0, 0, 0.15)"
|
|
148
|
+
},
|
|
149
|
+
[".box-shadow-5"]: {
|
|
150
|
+
boxShadow: "0px 4px 4px 0px rgba(0, 0, 0, 0.30), 0px 8px 12px 6px rgba(0, 0, 0, 0.15)"
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
);
|
|
131
155
|
const main = plugin.withOptions((args) => {
|
|
132
156
|
const configCss = args;
|
|
133
157
|
const fontStyles = {};
|
|
@@ -147,7 +171,8 @@ const main = plugin.withOptions((args) => {
|
|
|
147
171
|
breakPointsCss = [breakPointsCss];
|
|
148
172
|
}
|
|
149
173
|
const responsiveBreakPoints = {};
|
|
150
|
-
breakPointsCss.forEach((
|
|
174
|
+
breakPointsCss.forEach((line) => {
|
|
175
|
+
const [key, value] = line.split(" ");
|
|
151
176
|
responsiveBreakPoints[key] = value;
|
|
152
177
|
});
|
|
153
178
|
const options = {
|
|
@@ -158,6 +183,7 @@ const main = plugin.withOptions((args) => {
|
|
|
158
183
|
return (api) => {
|
|
159
184
|
font(options).handler(api);
|
|
160
185
|
state(options).handler(api);
|
|
186
|
+
shadow.handler(api);
|
|
161
187
|
};
|
|
162
188
|
});
|
|
163
189
|
const createOrUpdateFile = (filePath, content) => {
|
|
@@ -301,7 +327,6 @@ class TailwindImplPlugin extends theme.PluginImplAbstract {
|
|
|
301
327
|
@import "./udixio.css";`;
|
|
302
328
|
const tailwindCssPath = findTailwindCssFile(projectRoot, searchPattern);
|
|
303
329
|
udixioCssPath = path.join(tailwindCssPath, "../udixio.css");
|
|
304
|
-
console__namespace.log("rrgfgt", tailwindCssPath, udixioCssPath);
|
|
305
330
|
if (!getFileContent(tailwindCssPath, /@import\s+"\.\/udixio\.css";/)) {
|
|
306
331
|
replaceFileContent(tailwindCssPath, searchPattern, replacement);
|
|
307
332
|
}
|
package/dist/index.js
CHANGED
|
@@ -108,6 +108,30 @@ const font = plugin.withOptions((options) => {
|
|
|
108
108
|
addUtilities(newUtilities);
|
|
109
109
|
};
|
|
110
110
|
});
|
|
111
|
+
const shadow = plugin(
|
|
112
|
+
({ addUtilities }) => {
|
|
113
|
+
addUtilities({
|
|
114
|
+
[".shadow"]: {
|
|
115
|
+
boxShadow: "0 4px 10px #00000008, 0 0 2px #0000000f, 0 2px 6px #0000001f"
|
|
116
|
+
},
|
|
117
|
+
[".shadow-1"]: {
|
|
118
|
+
boxShadow: "0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30)"
|
|
119
|
+
},
|
|
120
|
+
[".shadow-2"]: {
|
|
121
|
+
boxShadow: "0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30)"
|
|
122
|
+
},
|
|
123
|
+
[".shadow-3"]: {
|
|
124
|
+
boxShadow: "0px 1px 3px 0px rgba(0, 0, 0, 0.30), 0px 4px 8px 3px rgba(0, 0, 0, 0.15)"
|
|
125
|
+
},
|
|
126
|
+
[".shadow-4"]: {
|
|
127
|
+
boxShadow: "0px 2px 3px 0px rgba(0, 0, 0, 0.30), 0px 6px 10px 4px rgba(0, 0, 0, 0.15)"
|
|
128
|
+
},
|
|
129
|
+
[".box-shadow-5"]: {
|
|
130
|
+
boxShadow: "0px 4px 4px 0px rgba(0, 0, 0, 0.30), 0px 8px 12px 6px rgba(0, 0, 0, 0.15)"
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
);
|
|
111
135
|
const main = plugin.withOptions((args) => {
|
|
112
136
|
const configCss = args;
|
|
113
137
|
const fontStyles = {};
|
|
@@ -127,7 +151,8 @@ const main = plugin.withOptions((args) => {
|
|
|
127
151
|
breakPointsCss = [breakPointsCss];
|
|
128
152
|
}
|
|
129
153
|
const responsiveBreakPoints = {};
|
|
130
|
-
breakPointsCss.forEach((
|
|
154
|
+
breakPointsCss.forEach((line) => {
|
|
155
|
+
const [key, value] = line.split(" ");
|
|
131
156
|
responsiveBreakPoints[key] = value;
|
|
132
157
|
});
|
|
133
158
|
const options = {
|
|
@@ -138,6 +163,7 @@ const main = plugin.withOptions((args) => {
|
|
|
138
163
|
return (api) => {
|
|
139
164
|
font(options).handler(api);
|
|
140
165
|
state(options).handler(api);
|
|
166
|
+
shadow.handler(api);
|
|
141
167
|
};
|
|
142
168
|
});
|
|
143
169
|
const createOrUpdateFile = (filePath, content) => {
|
|
@@ -281,7 +307,6 @@ class TailwindImplPlugin extends PluginImplAbstract {
|
|
|
281
307
|
@import "./udixio.css";`;
|
|
282
308
|
const tailwindCssPath = findTailwindCssFile(projectRoot, searchPattern);
|
|
283
309
|
udixioCssPath = path__default.join(tailwindCssPath, "../udixio.css");
|
|
284
|
-
console.log("rrgfgt", tailwindCssPath, udixioCssPath);
|
|
285
310
|
if (!getFileContent(tailwindCssPath, /@import\s+"\.\/udixio\.css";/)) {
|
|
286
311
|
replaceFileContent(tailwindCssPath, searchPattern, replacement);
|
|
287
312
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tailwind.plugin.d.ts","sourceRoot":"","sources":["../src/tailwind.plugin.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"tailwind.plugin.d.ts","sourceRoot":"","sources":["../src/tailwind.plugin.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAG/E,UAAU,qBAAqB;IAE7B,qBAAqB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/C,aAAa,CAAC,EAAE,MAAM,CAAC;CAExB;AAED,qBAAa,cAAe,SAAQ,cAAc,CAChD,kBAAkB,EAClB,qBAAqB,CACtB;IACQ,YAAY,wBAAgB;IAC5B,IAAI,SAAc;IACzB,WAAW,4BAAsB;CAClC;AAED,cAAM,kBAAmB,SAAQ,kBAAkB,CAAC,qBAAqB,CAAC;IACxE,MAAM;IAMN,MAAM;CA+FP"}
|
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
state,
|
|
6
6
|
StateOptions,
|
|
7
7
|
} from './plugins-tailwind';
|
|
8
|
+
import { shadow } from './plugins-tailwind/shadow';
|
|
8
9
|
|
|
9
10
|
export type ConfigJs = FontPluginOptions & StateOptions;
|
|
10
11
|
export type ConfigCss = {
|
|
@@ -34,8 +35,10 @@ export const main = plugin.withOptions<ConfigJs>((args) => {
|
|
|
34
35
|
if (!Array.isArray(breakPointsCss)) {
|
|
35
36
|
breakPointsCss = [breakPointsCss];
|
|
36
37
|
}
|
|
38
|
+
|
|
37
39
|
const responsiveBreakPoints: any = {};
|
|
38
|
-
breakPointsCss.forEach((
|
|
40
|
+
breakPointsCss.forEach((line) => {
|
|
41
|
+
const [key, value] = line.split(' ');
|
|
39
42
|
responsiveBreakPoints[key] = value;
|
|
40
43
|
});
|
|
41
44
|
|
|
@@ -48,5 +51,6 @@ export const main = plugin.withOptions<ConfigJs>((args) => {
|
|
|
48
51
|
return (api: PluginAPI) => {
|
|
49
52
|
font(options).handler(api);
|
|
50
53
|
state(options).handler(api);
|
|
54
|
+
shadow.handler(api);
|
|
51
55
|
};
|
|
52
56
|
});
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import plugin, { PluginAPI } from 'tailwindcss/plugin';
|
|
2
|
+
|
|
3
|
+
export const shadow = plugin(
|
|
4
|
+
({ addUtilities }: Pick<PluginAPI, 'addUtilities'>) => {
|
|
5
|
+
addUtilities({
|
|
6
|
+
['.shadow']: {
|
|
7
|
+
boxShadow:
|
|
8
|
+
'0 4px 10px #00000008, 0 0 2px #0000000f, 0 2px 6px #0000001f',
|
|
9
|
+
},
|
|
10
|
+
['.shadow-1']: {
|
|
11
|
+
boxShadow:
|
|
12
|
+
'0px 1px 3px 1px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30)',
|
|
13
|
+
},
|
|
14
|
+
['.shadow-2']: {
|
|
15
|
+
boxShadow:
|
|
16
|
+
'0px 2px 6px 2px rgba(0, 0, 0, 0.15), 0px 1px 2px 0px rgba(0, 0, 0, 0.30)',
|
|
17
|
+
},
|
|
18
|
+
['.shadow-3']: {
|
|
19
|
+
boxShadow:
|
|
20
|
+
'0px 1px 3px 0px rgba(0, 0, 0, 0.30), 0px 4px 8px 3px rgba(0, 0, 0, 0.15)',
|
|
21
|
+
},
|
|
22
|
+
['.shadow-4']: {
|
|
23
|
+
boxShadow:
|
|
24
|
+
'0px 2px 3px 0px rgba(0, 0, 0, 0.30), 0px 6px 10px 4px rgba(0, 0, 0, 0.15)',
|
|
25
|
+
},
|
|
26
|
+
['.box-shadow-5']: {
|
|
27
|
+
boxShadow:
|
|
28
|
+
'0px 4px 4px 0px rgba(0, 0, 0, 0.30), 0px 8px 12px 6px rgba(0, 0, 0, 0.15)',
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
);
|
package/src/tailwind.plugin.ts
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
import path from 'path';
|
|
9
9
|
import { FontPlugin, PluginAbstract, PluginImplAbstract } from '@udixio/theme';
|
|
10
10
|
import { ConfigCss } from './main';
|
|
11
|
-
import * as console from 'node:console';
|
|
12
11
|
|
|
13
12
|
interface TailwindPluginOptions {
|
|
14
13
|
// darkMode?: 'class' | 'media';
|
|
@@ -45,8 +44,6 @@ class TailwindImplPlugin extends PluginImplAbstract<TailwindPluginOptions> {
|
|
|
45
44
|
const tailwindCssPath = findTailwindCssFile(projectRoot, searchPattern);
|
|
46
45
|
udixioCssPath = path.join(tailwindCssPath, '../udixio.css');
|
|
47
46
|
|
|
48
|
-
console.log('rrgfgt', tailwindCssPath, udixioCssPath);
|
|
49
|
-
|
|
50
47
|
if (!getFileContent(tailwindCssPath, /@import\s+"\.\/udixio\.css";/)) {
|
|
51
48
|
replaceFileContent(tailwindCssPath, searchPattern, replacement);
|
|
52
49
|
}
|