winduum 2.0.0-next.35 → 2.0.0-next.36
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/package.json +1 -1
- package/plugin/index.cjs +12 -11
- package/plugin/index.js +13 -9
- package/plugin/utilities/common.js +1 -2
package/package.json
CHANGED
package/plugin/index.cjs
CHANGED
|
@@ -161,8 +161,7 @@ const tailwindParseVariables = (type, file, customValues = {}, customPath, initi
|
|
|
161
161
|
return values
|
|
162
162
|
};
|
|
163
163
|
|
|
164
|
-
const
|
|
165
|
-
const fileContent = node_fs.readFileSync(node_path.resolve(node_path.dirname(filename), file)).toString();
|
|
164
|
+
const fileContent = node_fs.readFileSync(file).toString();
|
|
166
165
|
const values = parseFile(fileContent);
|
|
167
166
|
|
|
168
167
|
if (customPath) {
|
|
@@ -220,6 +219,8 @@ const tailwindAnimations = (values) => {
|
|
|
220
219
|
return result
|
|
221
220
|
};
|
|
222
221
|
|
|
222
|
+
const relativePath = file => node_path.resolve(node_path.dirname(node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href)))), file);
|
|
223
|
+
|
|
223
224
|
/**
|
|
224
225
|
* @type {import('./').PluginOptions} options.
|
|
225
226
|
*/
|
|
@@ -272,7 +273,7 @@ const createPlugin = (userConfig = {}) => {
|
|
|
272
273
|
{ values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] }
|
|
273
274
|
);
|
|
274
275
|
addComponents(tailwindAnimations(userConfig.animations));
|
|
275
|
-
addComponents(tailwindPropertyUtilities('mask', Object.keys(tailwindParseVariables('mask', '
|
|
276
|
+
addComponents(tailwindPropertyUtilities('mask', Object.keys(tailwindParseVariables('mask', relativePath('../src/theme/config/mask.css'), {
|
|
276
277
|
...tailwindVariables('mask', userConfig.mask ?? [])
|
|
277
278
|
}, userConfig.mask, false))));
|
|
278
279
|
addComponents(divideGap({ theme, e }));
|
|
@@ -290,30 +291,30 @@ const createPlugin = (userConfig = {}) => {
|
|
|
290
291
|
transitionDuration: {
|
|
291
292
|
DEFAULT: 'var(--default-transition-duration)'
|
|
292
293
|
},
|
|
293
|
-
transitionTimingFunction: tailwindParseVariables('transition-timing-function', '
|
|
294
|
+
transitionTimingFunction: tailwindParseVariables('transition-timing-function', relativePath('../src/theme/config/transition.css'), {
|
|
294
295
|
...tailwindVariables('transition-timing-function', userConfig.ease ?? [])
|
|
295
296
|
}, userConfig.ease),
|
|
296
|
-
colors: tailwindColors(Object.keys(tailwindParseVariables('color', '
|
|
297
|
+
colors: tailwindColors(Object.keys(tailwindParseVariables('color', relativePath('../src/theme/default.css'), {
|
|
297
298
|
...tailwindVariables('color', userConfig.colors ?? [])
|
|
298
299
|
}, userConfig.colors)), settings.colorMix, settings.rgb),
|
|
299
|
-
fontSize: tailwindParseVariables('font-size', '
|
|
300
|
+
fontSize: tailwindParseVariables('font-size', relativePath('../src/theme/config/font.css'), {
|
|
300
301
|
...tailwindVariables('font-weight', userConfig.fontSize ?? [])
|
|
301
302
|
}, userConfig.fontSize),
|
|
302
|
-
fontFamily: tailwindParseVariables('font-family', '
|
|
303
|
+
fontFamily: tailwindParseVariables('font-family', relativePath('../src/theme/config/font.css'), {
|
|
303
304
|
...tailwindVariables('font-weight', userConfig.fontFamily ?? [])
|
|
304
305
|
}, userConfig.fontFamily),
|
|
305
|
-
fontWeight: tailwindParseVariables('font-weight', '
|
|
306
|
+
fontWeight: tailwindParseVariables('font-weight', relativePath('../src/theme/config/font.css'), {
|
|
306
307
|
...tailwindVariables('font-weight', userConfig.fontWeight ?? [])
|
|
307
308
|
}, userConfig.fontWeight),
|
|
308
|
-
zIndex: tailwindParseVariables('z-index', '
|
|
309
|
+
zIndex: tailwindParseVariables('z-index', relativePath('../src/theme/config/z.css'), {
|
|
309
310
|
...tailwindVariables('z-index', userConfig.zIndex ?? []),
|
|
310
311
|
0: 0,
|
|
311
312
|
auto: 'auto'
|
|
312
313
|
}, userConfig.zIndex),
|
|
313
|
-
spacing: tailwindParseVariables('spacing', '
|
|
314
|
+
spacing: tailwindParseVariables('spacing', relativePath('../src/theme/config/spacing.css'), {
|
|
314
315
|
...tailwindVariables('spacing', userConfig.spacing ?? [])
|
|
315
316
|
}, userConfig.spacing),
|
|
316
|
-
borderRadius: tailwindParseVariables('radius', '
|
|
317
|
+
borderRadius: tailwindParseVariables('radius', relativePath('../src/theme/config/radius.css'), {
|
|
317
318
|
...tailwindVariables('radius', userConfig.borderRadius ?? []),
|
|
318
319
|
DEFAULT: 'var(--radius)'
|
|
319
320
|
}, userConfig.borderRadius),
|
package/plugin/index.js
CHANGED
|
@@ -10,6 +10,10 @@ import {
|
|
|
10
10
|
tailwindVariables,
|
|
11
11
|
tailwindVariablesFont
|
|
12
12
|
} from './utilities/common.js'
|
|
13
|
+
import { dirname, resolve } from 'node:path'
|
|
14
|
+
import { fileURLToPath } from 'node:url'
|
|
15
|
+
|
|
16
|
+
const relativePath = file => resolve(dirname(fileURLToPath(import.meta.url)), file)
|
|
13
17
|
|
|
14
18
|
/**
|
|
15
19
|
* @type {import('./').PluginOptions} options.
|
|
@@ -63,7 +67,7 @@ export const createPlugin = (userConfig = {}) => {
|
|
|
63
67
|
{ values: flattenColorPalette(theme('textColor')), type: ['color', 'any'] }
|
|
64
68
|
)
|
|
65
69
|
addComponents(tailwindAnimations(userConfig.animations))
|
|
66
|
-
addComponents(tailwindPropertyUtilities('mask', Object.keys(tailwindParseVariables('mask', '
|
|
70
|
+
addComponents(tailwindPropertyUtilities('mask', Object.keys(tailwindParseVariables('mask', relativePath('../src/theme/config/mask.css'), {
|
|
67
71
|
...tailwindVariables('mask', userConfig.mask ?? [])
|
|
68
72
|
}, userConfig.mask, false))))
|
|
69
73
|
addComponents(divideGap({ theme, e }))
|
|
@@ -81,30 +85,30 @@ export const createPlugin = (userConfig = {}) => {
|
|
|
81
85
|
transitionDuration: {
|
|
82
86
|
DEFAULT: 'var(--default-transition-duration)'
|
|
83
87
|
},
|
|
84
|
-
transitionTimingFunction: tailwindParseVariables('transition-timing-function', '
|
|
88
|
+
transitionTimingFunction: tailwindParseVariables('transition-timing-function', relativePath('../src/theme/config/transition.css'), {
|
|
85
89
|
...tailwindVariables('transition-timing-function', userConfig.ease ?? [])
|
|
86
90
|
}, userConfig.ease),
|
|
87
|
-
colors: tailwindColors(Object.keys(tailwindParseVariables('color', '
|
|
91
|
+
colors: tailwindColors(Object.keys(tailwindParseVariables('color', relativePath('../src/theme/default.css'), {
|
|
88
92
|
...tailwindVariables('color', userConfig.colors ?? [])
|
|
89
93
|
}, userConfig.colors)), settings.colorMix, settings.rgb),
|
|
90
|
-
fontSize: tailwindParseVariables('font-size', '
|
|
94
|
+
fontSize: tailwindParseVariables('font-size', relativePath('../src/theme/config/font.css'), {
|
|
91
95
|
...tailwindVariables('font-weight', userConfig.fontSize ?? [])
|
|
92
96
|
}, userConfig.fontSize),
|
|
93
|
-
fontFamily: tailwindParseVariables('font-family', '
|
|
97
|
+
fontFamily: tailwindParseVariables('font-family', relativePath('../src/theme/config/font.css'), {
|
|
94
98
|
...tailwindVariables('font-weight', userConfig.fontFamily ?? [])
|
|
95
99
|
}, userConfig.fontFamily),
|
|
96
|
-
fontWeight: tailwindParseVariables('font-weight', '
|
|
100
|
+
fontWeight: tailwindParseVariables('font-weight', relativePath('../src/theme/config/font.css'), {
|
|
97
101
|
...tailwindVariables('font-weight', userConfig.fontWeight ?? [])
|
|
98
102
|
}, userConfig.fontWeight),
|
|
99
|
-
zIndex: tailwindParseVariables('z-index', '
|
|
103
|
+
zIndex: tailwindParseVariables('z-index', relativePath('../src/theme/config/z.css'), {
|
|
100
104
|
...tailwindVariables('z-index', userConfig.zIndex ?? []),
|
|
101
105
|
0: 0,
|
|
102
106
|
auto: 'auto'
|
|
103
107
|
}, userConfig.zIndex),
|
|
104
|
-
spacing: tailwindParseVariables('spacing', '
|
|
108
|
+
spacing: tailwindParseVariables('spacing', relativePath('../src/theme/config/spacing.css'), {
|
|
105
109
|
...tailwindVariables('spacing', userConfig.spacing ?? [])
|
|
106
110
|
}, userConfig.spacing),
|
|
107
|
-
borderRadius: tailwindParseVariables('radius', '
|
|
111
|
+
borderRadius: tailwindParseVariables('radius', relativePath('../src/theme/config/radius.css'), {
|
|
108
112
|
...tailwindVariables('radius', userConfig.borderRadius ?? []),
|
|
109
113
|
DEFAULT: 'var(--radius)'
|
|
110
114
|
}, userConfig.borderRadius),
|
|
@@ -64,8 +64,7 @@ export const tailwindParseVariables = (type, file, customValues = {}, customPath
|
|
|
64
64
|
return values
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
const
|
|
68
|
-
const fileContent = readFileSync(resolve(dirname(filename), file)).toString()
|
|
67
|
+
const fileContent = readFileSync(file).toString()
|
|
69
68
|
const values = parseFile(fileContent)
|
|
70
69
|
|
|
71
70
|
if (customPath) {
|