@unocss/preset-wind4 66.5.2 → 66.5.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.
- package/dist/index.d.mts +25 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.mjs +14 -15
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -110,6 +110,31 @@ interface PresetWind4Options extends PresetOptions {
|
|
|
110
110
|
* to match the design system or requirements of your project.
|
|
111
111
|
*/
|
|
112
112
|
theme?: PreflightsTheme['mode'] | PreflightsTheme;
|
|
113
|
+
/**
|
|
114
|
+
* Configuration for property preflight generation.
|
|
115
|
+
*
|
|
116
|
+
* - `false`: Disable property preflight
|
|
117
|
+
* - `true` or `undefined`: Enable with default configuration
|
|
118
|
+
* - `object`: Enable with custom configuration
|
|
119
|
+
*/
|
|
120
|
+
property?: boolean | {
|
|
121
|
+
/**
|
|
122
|
+
* Custom parent selector (e.g., @supports query or @layer).
|
|
123
|
+
*
|
|
124
|
+
* - `string`: Use custom parent selector
|
|
125
|
+
* - `false`: No parent wrapper, apply properties directly to selector
|
|
126
|
+
* - `undefined`: Use default @supports query
|
|
127
|
+
*
|
|
128
|
+
* @default '@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b))))'
|
|
129
|
+
*/
|
|
130
|
+
parent?: string | false;
|
|
131
|
+
/**
|
|
132
|
+
* Custom selector for applying properties.
|
|
133
|
+
*
|
|
134
|
+
* @default '*, ::before, ::after, ::backdrop'
|
|
135
|
+
*/
|
|
136
|
+
selector?: string;
|
|
137
|
+
};
|
|
113
138
|
};
|
|
114
139
|
}
|
|
115
140
|
declare const presetWind4: _unocss_core.PresetFactory<Theme, PresetWind4Options>;
|
package/dist/index.d.ts
CHANGED
|
@@ -110,6 +110,31 @@ interface PresetWind4Options extends PresetOptions {
|
|
|
110
110
|
* to match the design system or requirements of your project.
|
|
111
111
|
*/
|
|
112
112
|
theme?: PreflightsTheme['mode'] | PreflightsTheme;
|
|
113
|
+
/**
|
|
114
|
+
* Configuration for property preflight generation.
|
|
115
|
+
*
|
|
116
|
+
* - `false`: Disable property preflight
|
|
117
|
+
* - `true` or `undefined`: Enable with default configuration
|
|
118
|
+
* - `object`: Enable with custom configuration
|
|
119
|
+
*/
|
|
120
|
+
property?: boolean | {
|
|
121
|
+
/**
|
|
122
|
+
* Custom parent selector (e.g., @supports query or @layer).
|
|
123
|
+
*
|
|
124
|
+
* - `string`: Use custom parent selector
|
|
125
|
+
* - `false`: No parent wrapper, apply properties directly to selector
|
|
126
|
+
* - `undefined`: Use default @supports query
|
|
127
|
+
*
|
|
128
|
+
* @default '@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b))))'
|
|
129
|
+
*/
|
|
130
|
+
parent?: string | false;
|
|
131
|
+
/**
|
|
132
|
+
* Custom selector for applying properties.
|
|
133
|
+
*
|
|
134
|
+
* @default '*, ::before, ::after, ::backdrop'
|
|
135
|
+
*/
|
|
136
|
+
selector?: string;
|
|
137
|
+
};
|
|
113
138
|
};
|
|
114
139
|
}
|
|
115
140
|
declare const presetWind4: _unocss_core.PresetFactory<Theme, PresetWind4Options>;
|
package/dist/index.mjs
CHANGED
|
@@ -10,15 +10,18 @@ import { r as rules } from './shared/preset-wind4.Fo7dLYPT.mjs';
|
|
|
10
10
|
import './colors.mjs';
|
|
11
11
|
import './shared/preset-wind4.C9-nkhy3.mjs';
|
|
12
12
|
|
|
13
|
-
function
|
|
13
|
+
function property(options) {
|
|
14
|
+
if (options.preflights?.property === false)
|
|
15
|
+
return void 0;
|
|
16
|
+
const propertyConfig = typeof options.preflights?.property === "object" ? options.preflights.property : void 0;
|
|
17
|
+
const parentSelector = propertyConfig?.parent !== void 0 ? propertyConfig.parent : "@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b))))";
|
|
18
|
+
const selector = propertyConfig?.selector ?? "*, ::before, ::after, ::backdrop";
|
|
14
19
|
return {
|
|
15
20
|
getCSS: () => {
|
|
16
|
-
if (trackedProperties.size
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return `${parent}{${root}{${css}}}`;
|
|
21
|
-
}
|
|
21
|
+
if (trackedProperties.size === 0)
|
|
22
|
+
return;
|
|
23
|
+
const css = Array.from(trackedProperties.entries()).map(([property2, value]) => `${property2}:${value};`).join("");
|
|
24
|
+
return parentSelector === false ? `${selector}{${css}}` : `${parentSelector}{${selector}{${css}}}`;
|
|
22
25
|
},
|
|
23
26
|
layer: "properties"
|
|
24
27
|
};
|
|
@@ -415,7 +418,7 @@ input:where([type='button'], [type='reset'], [type='submit']),
|
|
|
415
418
|
Make elements with the HTML hidden attribute stay hidden by default.
|
|
416
419
|
*/
|
|
417
420
|
|
|
418
|
-
[hidden]:where(:not([hidden
|
|
421
|
+
[hidden]:where(:not([hidden~='until-found'])) {
|
|
419
422
|
display: none !important;
|
|
420
423
|
}
|
|
421
424
|
`;
|
|
@@ -473,12 +476,13 @@ function getThemeVarsMap(theme2, keys) {
|
|
|
473
476
|
return themeMap;
|
|
474
477
|
}
|
|
475
478
|
function theme(options) {
|
|
479
|
+
const preflightsTheme = typeof options.preflights?.theme === "boolean" || typeof options.preflights?.theme === "string" ? { mode: options.preflights.theme ?? "on-demand" } : { mode: options.preflights?.theme?.mode ?? "on-demand", ...options.preflights?.theme };
|
|
476
480
|
return {
|
|
477
481
|
layer: "theme",
|
|
478
482
|
getCSS(ctx) {
|
|
479
483
|
const { theme: theme2, generator } = ctx;
|
|
480
484
|
const safelist = uniq(generator.config.safelist.flatMap((s) => typeof s === "function" ? s(ctx) : s));
|
|
481
|
-
const { mode, process } =
|
|
485
|
+
const { mode, process } = preflightsTheme;
|
|
482
486
|
if (mode === false) {
|
|
483
487
|
return void 0;
|
|
484
488
|
}
|
|
@@ -538,7 +542,7 @@ const preflights = (options) => {
|
|
|
538
542
|
return [
|
|
539
543
|
reset(options),
|
|
540
544
|
theme(options),
|
|
541
|
-
|
|
545
|
+
property(options)
|
|
542
546
|
].filter(Boolean);
|
|
543
547
|
};
|
|
544
548
|
|
|
@@ -558,11 +562,6 @@ const presetWind4 = definePreset((options = {}) => {
|
|
|
558
562
|
options.attributifyPseudo = options.attributifyPseudo ?? false;
|
|
559
563
|
options.variablePrefix = options.variablePrefix ?? "un-";
|
|
560
564
|
options.important = options.important ?? false;
|
|
561
|
-
const preflightsTheme = typeof options.preflights?.theme === "boolean" || typeof options.preflights?.theme === "string" ? { mode: options.preflights.theme ?? "on-demand" } : { mode: options.preflights?.theme?.mode ?? "on-demand", ...options.preflights?.theme };
|
|
562
|
-
options.preflights = {
|
|
563
|
-
reset: options.preflights?.reset ?? true,
|
|
564
|
-
theme: preflightsTheme
|
|
565
|
-
};
|
|
566
565
|
return {
|
|
567
566
|
name: PRESET_NAME,
|
|
568
567
|
rules,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind4",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "66.5.
|
|
4
|
+
"version": "66.5.4",
|
|
5
5
|
"description": "Tailwind 4 compact preset for UnoCSS",
|
|
6
6
|
"authors": [
|
|
7
7
|
{
|
|
@@ -74,9 +74,9 @@
|
|
|
74
74
|
"dist"
|
|
75
75
|
],
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@unocss/core": "66.5.
|
|
78
|
-
"@unocss/
|
|
79
|
-
"@unocss/
|
|
77
|
+
"@unocss/core": "66.5.4",
|
|
78
|
+
"@unocss/rule-utils": "66.5.4",
|
|
79
|
+
"@unocss/extractor-arbitrary-variants": "66.5.4"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
82
82
|
"build": "unbuild",
|