@unocss/preset-wind4 66.6.6 → 66.6.7
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/chunk-D1SwGrFN.mjs +27 -0
- package/dist/{colors-DfOpBqNN.mjs → colors-DSN24uxs.mjs} +1 -2
- package/dist/colors.d.mts +1 -1
- package/dist/colors.mjs +2 -3
- package/dist/{container-BsDB8iH5.mjs → container-_7pdPWQl.mjs} +2 -4
- package/dist/{index-CG7jV-T1.d.mts → index-Br5yJM3P.d.mts} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +19 -26
- package/dist/postprocess.d.mts +1 -2
- package/dist/postprocess.mjs +2 -4
- package/dist/{rules-C5vHFC6_.d.mts → rules-BpaLAJkj.d.mts} +1 -1
- package/dist/rules.d.mts +1 -1
- package/dist/rules.mjs +51 -86
- package/dist/shortcuts.d.mts +1 -2
- package/dist/shortcuts.mjs +2 -4
- package/dist/theme.d.mts +2 -2
- package/dist/theme.mjs +2 -13
- package/dist/{utils-B_qFX7UQ.mjs → utils-BamiTVVE.mjs} +8 -63
- package/dist/utils.d.mts +1 -2
- package/dist/utils.mjs +3 -5
- package/dist/{variants-Dae_1bdw.mjs → variants-BQhcPCjX.mjs} +6 -25
- package/dist/variants.d.mts +1 -2
- package/dist/variants.mjs +2 -3
- package/package.json +4 -4
- package/dist/chunk-w_xFUvYo.mjs +0 -36
- /package/dist/{colors-Dy0ZKdct.d.mts → colors-WEybJ2pP.d.mts} +0 -0
- /package/dist/{theme-BEjX_ZME.d.mts → theme-C7zgiweA.d.mts} +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __exportAll = (all, no_symbols) => {
|
|
7
|
+
let target = {};
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: true
|
|
11
|
+
});
|
|
12
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
13
|
+
return target;
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
17
|
+
key = keys[i];
|
|
18
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: ((k) => from[k]).bind(null, key),
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
26
|
+
//#endregion
|
|
27
|
+
export { __reExport as n, __exportAll as t };
|
package/dist/colors.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as colors } from "./colors-
|
|
1
|
+
import { t as colors } from "./colors-WEybJ2pP.mjs";
|
|
2
2
|
export { colors };
|
package/dist/colors.mjs
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { t as colors } from "./colors-
|
|
2
|
-
|
|
3
|
-
export { colors };
|
|
1
|
+
import { t as colors } from "./colors-DSN24uxs.mjs";
|
|
2
|
+
export { colors };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { w as resolveBreakpoints } from "./utils-
|
|
1
|
+
import { w as resolveBreakpoints } from "./utils-BamiTVVE.mjs";
|
|
2
2
|
import { isString } from "@unocss/core";
|
|
3
|
-
|
|
4
3
|
//#region src/rules/container.ts
|
|
5
4
|
const containerParent = [[/^@container(?:\/(\w+))?(?:-(normal))?$/, ([, l, v]) => {
|
|
6
5
|
return {
|
|
@@ -55,6 +54,5 @@ const containerShortcuts = [[/^(?:(\w+)[:-])?container$/, ([, bp], context) => {
|
|
|
55
54
|
if (!bp) shortcuts.unshift("__container");
|
|
56
55
|
return shortcuts;
|
|
57
56
|
}]];
|
|
58
|
-
|
|
59
57
|
//#endregion
|
|
60
|
-
export { containerParent as n, containerShortcuts as r, container as t };
|
|
58
|
+
export { containerParent as n, containerShortcuts as r, container as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Theme } from "./theme-
|
|
1
|
+
import { C as Theme } from "./theme-C7zgiweA.mjs";
|
|
2
2
|
import * as _unocss_core0 from "@unocss/core";
|
|
3
3
|
import { Arrayable, CSSEntry, Postprocessor, Preflight, PreflightContext, PresetOptions, Variant, VariantFunction, VariantObject } from "@unocss/core";
|
|
4
4
|
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Theme, E as theme } from "./theme-
|
|
2
|
-
import { G as preflights, J as postprocessors, U as shorthands, W as shortcuts, i as presetWind4, j as variants, n as PreflightsTheme, r as PresetWind4Options, t as DarkModeSelectors } from "./index-
|
|
3
|
-
import { bt as rules } from "./rules-
|
|
1
|
+
import { C as Theme, E as theme } from "./theme-C7zgiweA.mjs";
|
|
2
|
+
import { G as preflights, J as postprocessors, U as shorthands, W as shortcuts, i as presetWind4, j as variants, n as PreflightsTheme, r as PresetWind4Options, t as DarkModeSelectors } from "./index-Br5yJM3P.mjs";
|
|
3
|
+
import { bt as rules } from "./rules-BpaLAJkj.mjs";
|
|
4
4
|
export { DarkModeSelectors, PreflightsTheme, PresetWind4Options, Theme, presetWind4 as default, presetWind4, postprocessors, preflights, rules, shortcuts, shorthands, theme, variants };
|
package/dist/index.mjs
CHANGED
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
import { postprocessors } from "./postprocess.mjs";
|
|
2
|
-
import { H as PRESET_NAME, I as globalKeywords, a as themeTracking, f as compressCSS, h as getThemeByKey, n as detectThemeValue, o as trackedProperties, s as trackedTheme } from "./utils-
|
|
2
|
+
import { H as PRESET_NAME, I as globalKeywords, a as themeTracking, f as compressCSS, h as getThemeByKey, n as detectThemeValue, o as trackedProperties, s as trackedTheme } from "./utils-BamiTVVE.mjs";
|
|
3
3
|
import { rules } from "./rules.mjs";
|
|
4
4
|
import { shortcuts } from "./shortcuts.mjs";
|
|
5
5
|
import { theme } from "./theme.mjs";
|
|
6
|
-
import { t as variants } from "./variants-
|
|
6
|
+
import { t as variants } from "./variants-BQhcPCjX.mjs";
|
|
7
7
|
import { definePreset, escapeSelector, toArray, uniq } from "@unocss/core";
|
|
8
8
|
import { extractorArbitraryVariants } from "@unocss/extractor-arbitrary-variants";
|
|
9
9
|
import { alphaPlaceholdersRE } from "@unocss/rule-utils";
|
|
10
|
-
|
|
11
10
|
//#region src/preflights/property.ts
|
|
12
11
|
function property(options) {
|
|
13
12
|
if (options.preflights?.property === false) return void 0;
|
|
14
13
|
const propertyConfig = typeof options.preflights?.property === "object" ? options.preflights.property : void 0;
|
|
15
14
|
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))))";
|
|
16
15
|
const selector = propertyConfig?.selector ?? "*, ::before, ::after, ::backdrop";
|
|
16
|
+
const prefix = options.variablePrefix ?? "un-";
|
|
17
17
|
return {
|
|
18
18
|
getCSS: () => {
|
|
19
19
|
if (trackedProperties.size === 0) return;
|
|
20
|
-
const css = Array.from(trackedProperties.entries()).map(([property
|
|
20
|
+
const css = Array.from(trackedProperties.entries()).map(([property, value]) => `${property.replace(/^--un-/, `--${prefix}`)}:${value};`).join("");
|
|
21
21
|
return parentSelector === false ? `${selector}{${css}}` : `${parentSelector}{${selector}{${css}}}`;
|
|
22
22
|
},
|
|
23
23
|
layer: "properties"
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
|
|
27
26
|
//#endregion
|
|
28
27
|
//#region src/preflights/reset.ts
|
|
29
28
|
const resetCSS = `
|
|
@@ -434,7 +433,6 @@ function reset(options) {
|
|
|
434
433
|
layer: "base"
|
|
435
434
|
};
|
|
436
435
|
}
|
|
437
|
-
|
|
438
436
|
//#endregion
|
|
439
437
|
//#region src/preflights/theme.ts
|
|
440
438
|
/** Exclude output for CSS Variables */
|
|
@@ -453,17 +451,17 @@ const ExcludeCssVarKeys = [
|
|
|
453
451
|
"supports",
|
|
454
452
|
"containers"
|
|
455
453
|
];
|
|
456
|
-
function getThemeVarsMap(theme
|
|
457
|
-
const themeMap = new Map([["--spacing", theme
|
|
454
|
+
function getThemeVarsMap(theme, keys) {
|
|
455
|
+
const themeMap = new Map([["--spacing", theme.spacing.DEFAULT]]);
|
|
458
456
|
const normalizeValue = (value) => value.replace(alphaPlaceholdersRE, "1");
|
|
459
457
|
function process(obj, prefix) {
|
|
460
458
|
for (const key in obj) if (Array.isArray(obj[key])) themeMap.set(`--${prefix}-${key}`, normalizeValue(obj[key].join(",")));
|
|
461
459
|
else if (typeof obj[key] === "object") process(obj[key], `${prefix}-${key}`);
|
|
462
460
|
else themeMap.set(`--${prefix}-${key}`, normalizeValue(obj[key]));
|
|
463
461
|
}
|
|
464
|
-
for (const key in theme
|
|
462
|
+
for (const key in theme) {
|
|
465
463
|
if (!keys.includes(key)) continue;
|
|
466
|
-
process(theme
|
|
464
|
+
process(theme[key], key);
|
|
467
465
|
}
|
|
468
466
|
return themeMap;
|
|
469
467
|
}
|
|
@@ -475,25 +473,25 @@ function theme$1(options) {
|
|
|
475
473
|
return {
|
|
476
474
|
layer: "theme",
|
|
477
475
|
getCSS(ctx) {
|
|
478
|
-
const { theme
|
|
476
|
+
const { theme, generator } = ctx;
|
|
479
477
|
const safelist = uniq(generator.config.safelist.flatMap((s) => typeof s === "function" ? s(ctx) : s));
|
|
480
478
|
const { mode, process } = preflightsTheme;
|
|
481
479
|
if (mode === false) return;
|
|
482
480
|
if (safelist.length > 0) for (const s of safelist) {
|
|
483
481
|
const [key, ...prop] = s.trim().split(":");
|
|
484
|
-
if (key in theme
|
|
482
|
+
if (key in theme && prop.length <= 1) {
|
|
485
483
|
const props = prop.length === 0 ? ["DEFAULT"] : prop[0].split("-");
|
|
486
|
-
const v = getThemeByKey(theme
|
|
484
|
+
const v = getThemeByKey(theme, key, props);
|
|
487
485
|
if (typeof v === "string") {
|
|
488
486
|
themeTracking(key, props);
|
|
489
|
-
detectThemeValue(v, theme
|
|
487
|
+
detectThemeValue(v, theme);
|
|
490
488
|
}
|
|
491
489
|
}
|
|
492
490
|
}
|
|
493
491
|
let deps;
|
|
494
|
-
const generateCSS = (deps
|
|
495
|
-
if (process) for (const utility of deps
|
|
496
|
-
const resolvedDeps = deps
|
|
492
|
+
const generateCSS = (deps) => {
|
|
493
|
+
if (process) for (const utility of deps) for (const p of toArray(process)) p(utility, ctx);
|
|
494
|
+
const resolvedDeps = deps.map(([key, value]) => key && value ? `${escapeSelector(key)}: ${value};` : void 0).filter(Boolean);
|
|
497
495
|
if (resolvedDeps.length === 0) return;
|
|
498
496
|
return compressCSS(`
|
|
499
497
|
:root, :host {
|
|
@@ -504,18 +502,17 @@ ${resolvedDeps.join("\n")}
|
|
|
504
502
|
if (trackedTheme.size === 0) return void 0;
|
|
505
503
|
deps = Array.from(trackedTheme).map((k) => {
|
|
506
504
|
const [key, prop] = k.split(":");
|
|
507
|
-
const v = getThemeByKey(theme
|
|
505
|
+
const v = getThemeByKey(theme, key, prop.split("-"));
|
|
508
506
|
if (typeof v === "string") return [`--${key}${`${key === "spacing" && prop === "DEFAULT" ? "" : `-${prop}`}`}`, v];
|
|
509
507
|
}).filter(Boolean);
|
|
510
508
|
} else {
|
|
511
|
-
const keys = Object.keys(theme
|
|
512
|
-
deps = Array.from(getThemeVarsMap(theme
|
|
509
|
+
const keys = Object.keys(theme).filter((k) => !ExcludeCssVarKeys.includes(k));
|
|
510
|
+
deps = Array.from(getThemeVarsMap(theme, keys));
|
|
513
511
|
}
|
|
514
512
|
return generateCSS(deps);
|
|
515
513
|
}
|
|
516
514
|
};
|
|
517
515
|
}
|
|
518
|
-
|
|
519
516
|
//#endregion
|
|
520
517
|
//#region src/preflights/index.ts
|
|
521
518
|
const preflights = (options) => {
|
|
@@ -525,7 +522,6 @@ const preflights = (options) => {
|
|
|
525
522
|
property(options)
|
|
526
523
|
].filter(Boolean);
|
|
527
524
|
};
|
|
528
|
-
|
|
529
525
|
//#endregion
|
|
530
526
|
//#region src/shorthands.ts
|
|
531
527
|
const shorthands = {
|
|
@@ -538,7 +534,6 @@ const shorthands = {
|
|
|
538
534
|
],
|
|
539
535
|
globalKeyword: globalKeywords
|
|
540
536
|
};
|
|
541
|
-
|
|
542
537
|
//#endregion
|
|
543
538
|
//#region src/index.ts
|
|
544
539
|
const presetWind4 = definePreset((options = {}) => {
|
|
@@ -573,7 +568,5 @@ const presetWind4 = definePreset((options = {}) => {
|
|
|
573
568
|
}
|
|
574
569
|
};
|
|
575
570
|
});
|
|
576
|
-
var src_default = presetWind4;
|
|
577
|
-
|
|
578
571
|
//#endregion
|
|
579
|
-
export {
|
|
572
|
+
export { presetWind4 as default, presetWind4, postprocessors, preflights, rules, shortcuts, shorthands, theme, variants };
|
package/dist/postprocess.d.mts
CHANGED
package/dist/postprocess.mjs
CHANGED
|
@@ -14,11 +14,11 @@ function important({ important: option }) {
|
|
|
14
14
|
else if (!util.selector.startsWith(option)) util.selector = `${option} ${wrapWithIs(util.selector)}`;
|
|
15
15
|
}];
|
|
16
16
|
}
|
|
17
|
-
|
|
18
17
|
//#endregion
|
|
19
18
|
//#region src/postprocess/varPrefix.ts
|
|
20
19
|
function varPrefix({ variablePrefix: prefix }) {
|
|
21
20
|
const processor = (obj) => {
|
|
21
|
+
if (obj.layer === "properties") obj.selector = obj.selector.replace(/^@property --un-/, `@property --${prefix}`);
|
|
22
22
|
obj.entries.forEach((i) => {
|
|
23
23
|
i[0] = i[0].replace(/^--un-/, `--${prefix}`);
|
|
24
24
|
if (typeof i[1] === "string") i[1] = i[1].replace(/var\(--un-/g, `var(--${prefix}`);
|
|
@@ -26,12 +26,10 @@ function varPrefix({ variablePrefix: prefix }) {
|
|
|
26
26
|
};
|
|
27
27
|
return prefix !== "un-" ? [processor] : [];
|
|
28
28
|
}
|
|
29
|
-
|
|
30
29
|
//#endregion
|
|
31
30
|
//#region src/postprocess/default.ts
|
|
32
31
|
function postprocessors(options) {
|
|
33
32
|
return [important, varPrefix].flatMap((i) => i(options));
|
|
34
33
|
}
|
|
35
|
-
|
|
36
34
|
//#endregion
|
|
37
|
-
export { important, postprocessors, varPrefix };
|
|
35
|
+
export { important, postprocessors, varPrefix };
|
package/dist/rules.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as rings, A as hyphens, At as borders, B as userSelects, Bt as willChange, C as contents, Ct as containerParent, D as fieldSizing, Dt as colorScheme, E as dynamicViewportHeight, Et as bgColors, F as resizes, Ft as imageRenderings, G as notLastChildSelectorVariant, H as writingModes, Ht as animations, I as screenReadersAccess, It as listStyle, J as aspectRatio, K as paddings, L as textOverflows, Lt as outline, M as mixBlendModes, Mt as accents, N as objectPositions, Nt as appearance, O as fontSmoothings, Ot as opacity, P as pointerEvents, Pt as carets, Q as scrolls, R as textTransforms, Rt as overscrolls, S as contentVisibility, St as container, T as displays, Tt as columns, U as writingOrientations, Ut as textAligns, V as whitespaces, Vt as backgroundStyles, W as margins, Wt as verticalAligns, X as boxShadows, Y as sizes, Z as shadowProperties, _ as accessibility, _t as flex, a as fonts, at as insets, b as breaks, bt as rules, c as textIndents, ct as placements, d as transitions, dt as placeholders, et as questionMark, f as transformBase, ft as masks, g as svgUtilities, gt as gaps, h as tables, ht as grids, i as fontVariantNumeric, it as floats, j as isolations, jt as handlerBorderStyle, k as fontStyles, kt as borderStyles, l as textShadows, lt as positions, m as touchActions, mt as overflows, n as cssProperty, nt as boxSizing, o as splitShorthand, ot as justifies, p as transforms, pt as lineClamps, q as spaces, r as cssVariables, rt as flexGridJustifiesAlignments, s as tabSizes, st as orders, t as viewTransition, tt as alignments, u as textStrokes, ut as zIndexes, v as appearances, vt as filters, w as cursors, wt as containerShortcuts, x as contains, xt as textDecorations, y as backgroundBlendModes, yt as divides, z as textWraps, zt as scrollBehaviors } from "./rules-
|
|
1
|
+
import { $ as rings, A as hyphens, At as borders, B as userSelects, Bt as willChange, C as contents, Ct as containerParent, D as fieldSizing, Dt as colorScheme, E as dynamicViewportHeight, Et as bgColors, F as resizes, Ft as imageRenderings, G as notLastChildSelectorVariant, H as writingModes, Ht as animations, I as screenReadersAccess, It as listStyle, J as aspectRatio, K as paddings, L as textOverflows, Lt as outline, M as mixBlendModes, Mt as accents, N as objectPositions, Nt as appearance, O as fontSmoothings, Ot as opacity, P as pointerEvents, Pt as carets, Q as scrolls, R as textTransforms, Rt as overscrolls, S as contentVisibility, St as container, T as displays, Tt as columns, U as writingOrientations, Ut as textAligns, V as whitespaces, Vt as backgroundStyles, W as margins, Wt as verticalAligns, X as boxShadows, Y as sizes, Z as shadowProperties, _ as accessibility, _t as flex, a as fonts, at as insets, b as breaks, bt as rules, c as textIndents, ct as placements, d as transitions, dt as placeholders, et as questionMark, f as transformBase, ft as masks, g as svgUtilities, gt as gaps, h as tables, ht as grids, i as fontVariantNumeric, it as floats, j as isolations, jt as handlerBorderStyle, k as fontStyles, kt as borderStyles, l as textShadows, lt as positions, m as touchActions, mt as overflows, n as cssProperty, nt as boxSizing, o as splitShorthand, ot as justifies, p as transforms, pt as lineClamps, q as spaces, r as cssVariables, rt as flexGridJustifiesAlignments, s as tabSizes, st as orders, t as viewTransition, tt as alignments, u as textStrokes, ut as zIndexes, v as appearances, vt as filters, w as cursors, wt as containerShortcuts, x as contains, xt as textDecorations, y as backgroundBlendModes, yt as divides, z as textWraps, zt as scrollBehaviors } from "./rules-BpaLAJkj.mjs";
|
|
2
2
|
export { accents, accessibility, alignments, animations, appearance, appearances, aspectRatio, backgroundBlendModes, backgroundStyles, bgColors, borderStyles, borders, boxShadows, boxSizing, breaks, carets, colorScheme, columns, container, containerParent, containerShortcuts, contains, contentVisibility, contents, cssProperty, cssVariables, cursors, displays, divides, dynamicViewportHeight, fieldSizing, filters, flex, flexGridJustifiesAlignments, floats, fontSmoothings, fontStyles, fontVariantNumeric, fonts, gaps, grids, handlerBorderStyle, hyphens, imageRenderings, insets, isolations, justifies, lineClamps, listStyle, margins, masks, mixBlendModes, notLastChildSelectorVariant, objectPositions, opacity, orders, outline, overflows, overscrolls, paddings, placeholders, placements, pointerEvents, positions, questionMark, resizes, rings, rules, screenReadersAccess, scrollBehaviors, scrolls, shadowProperties, sizes, spaces, splitShorthand, svgUtilities, tabSizes, tables, textAligns, textDecorations, textIndents, textOverflows, textShadows, textStrokes, textTransforms, textWraps, touchActions, transformBase, transforms, transitions, userSelects, verticalAligns, viewTransition, whitespaces, willChange, writingModes, writingOrientations, zIndexes };
|