@unocss/preset-wind4 66.1.0-beta.7 → 66.1.0-beta.9
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 +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.mjs +20 -12
- package/dist/postprocess.d.mts +6 -4
- package/dist/postprocess.d.ts +6 -4
- package/dist/postprocess.mjs +2 -42
- package/dist/rules.d.mts +13 -13
- package/dist/rules.d.ts +13 -13
- package/dist/rules.mjs +3 -3
- package/dist/shared/{preset-wind4.BwU-POWl.mjs → preset-wind4.BLH55jNO.mjs} +1 -1
- package/dist/shared/{preset-wind4.CJ98Gjkm.mjs → preset-wind4.BNxtnClY.mjs} +59 -49
- package/dist/shared/{preset-wind4.DXr6hHdY.mjs → preset-wind4.BgYY8vln.mjs} +1 -1
- package/dist/shared/{preset-wind4.CkxnR6p3.mjs → preset-wind4.CbSMpnSp.mjs} +19 -3
- package/dist/shared/{preset-wind4.DhDf1e1c.mjs → preset-wind4.Ch1Z_NI2.mjs} +1 -1
- package/dist/shared/preset-wind4.Pg33yPuf.mjs +57 -0
- package/dist/shortcuts.mjs +3 -3
- package/dist/utils.d.mts +6 -4
- package/dist/utils.d.ts +6 -4
- package/dist/utils.mjs +11 -1
- package/dist/variants.d.mts +1 -1
- package/dist/variants.d.ts +1 -1
- package/dist/variants.mjs +2 -2
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
|
-
import { Postprocessor, Preflight, Variant, PresetOptions,
|
|
2
|
+
import { Postprocessor, Preflight, Variant, PresetOptions, Arrayable, CSSEntry, BaseContext } from '@unocss/core';
|
|
3
|
+
export { shortcuts } from './shortcuts.mjs';
|
|
3
4
|
import { T as Theme } from './shared/preset-wind4.BXbWGSRz.mjs';
|
|
4
5
|
export { r as rules } from './shared/preset-wind4.D71xGC6i.mjs';
|
|
5
|
-
export { shortcuts } from './shortcuts.mjs';
|
|
6
6
|
export { t as theme } from './shared/preset-wind4.BOe5kxIw.mjs';
|
|
7
7
|
|
|
8
8
|
declare function postprocessors(options: PresetWind4Options): Postprocessor[];
|
|
@@ -92,13 +92,14 @@ interface PresetWind4Options extends PresetOptions {
|
|
|
92
92
|
*/
|
|
93
93
|
themePreflight?: boolean | 'on-demand';
|
|
94
94
|
/**
|
|
95
|
-
*
|
|
95
|
+
* Resolve the layer utilits with custom logic.
|
|
96
96
|
*
|
|
97
|
-
* @param
|
|
98
|
-
* @param
|
|
97
|
+
* @param utility [key, value] {@link CSSEntry}
|
|
98
|
+
* @param layer Layer name
|
|
99
|
+
* @param ctx base generator context {@link BaseContext<Theme>}
|
|
99
100
|
* @returns
|
|
100
101
|
*/
|
|
101
|
-
|
|
102
|
+
utilityResolver?: Arrayable<(utility: CSSEntry, layer: string, ctx: BaseContext<Theme>) => void>;
|
|
102
103
|
}
|
|
103
104
|
declare const presetWind4: _unocss_core.PresetFactory<Theme, PresetWind4Options>;
|
|
104
105
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
|
-
import { Postprocessor, Preflight, Variant, PresetOptions,
|
|
2
|
+
import { Postprocessor, Preflight, Variant, PresetOptions, Arrayable, CSSEntry, BaseContext } from '@unocss/core';
|
|
3
|
+
export { shortcuts } from './shortcuts.js';
|
|
3
4
|
import { T as Theme } from './shared/preset-wind4.BXbWGSRz.js';
|
|
4
5
|
export { r as rules } from './shared/preset-wind4.Ca5oWgxX.js';
|
|
5
|
-
export { shortcuts } from './shortcuts.js';
|
|
6
6
|
export { t as theme } from './shared/preset-wind4.BOe5kxIw.js';
|
|
7
7
|
|
|
8
8
|
declare function postprocessors(options: PresetWind4Options): Postprocessor[];
|
|
@@ -92,13 +92,14 @@ interface PresetWind4Options extends PresetOptions {
|
|
|
92
92
|
*/
|
|
93
93
|
themePreflight?: boolean | 'on-demand';
|
|
94
94
|
/**
|
|
95
|
-
*
|
|
95
|
+
* Resolve the layer utilits with custom logic.
|
|
96
96
|
*
|
|
97
|
-
* @param
|
|
98
|
-
* @param
|
|
97
|
+
* @param utility [key, value] {@link CSSEntry}
|
|
98
|
+
* @param layer Layer name
|
|
99
|
+
* @param ctx base generator context {@link BaseContext<Theme>}
|
|
99
100
|
* @returns
|
|
100
101
|
*/
|
|
101
|
-
|
|
102
|
+
utilityResolver?: Arrayable<(utility: CSSEntry, layer: string, ctx: BaseContext<Theme>) => void>;
|
|
102
103
|
}
|
|
103
104
|
declare const presetWind4: _unocss_core.PresetFactory<Theme, PresetWind4Options>;
|
|
104
105
|
|
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { LAYER_PREFLIGHTS, definePreset } from '@unocss/core';
|
|
1
|
+
import { LAYER_PREFLIGHTS, toArray, definePreset } from '@unocss/core';
|
|
2
2
|
import { extractorArbitraryVariants } from '@unocss/extractor-arbitrary-variants';
|
|
3
|
-
import {
|
|
3
|
+
import { b as themeTracking, K as compressCSS, P as PRESET_NAME, z as getThemeByKey, J as hyphenate, p as passThemeKey, j as globalKeywords, t as trackedTheme } from './shared/preset-wind4.CbSMpnSp.mjs';
|
|
4
4
|
import { alphaPlaceholdersRE } from '@unocss/rule-utils';
|
|
5
|
-
import { postprocessors } from './
|
|
6
|
-
import { l as variants } from './shared/preset-wind4.
|
|
5
|
+
import { p as postprocessors } from './shared/preset-wind4.Pg33yPuf.mjs';
|
|
6
|
+
import { l as variants } from './shared/preset-wind4.BgYY8vln.mjs';
|
|
7
7
|
import { theme as theme$1 } from './theme.mjs';
|
|
8
|
-
import { s as shortcuts } from './shared/preset-wind4.
|
|
9
|
-
import { r as rules } from './shared/preset-wind4.
|
|
8
|
+
import { s as shortcuts } from './shared/preset-wind4.BLH55jNO.mjs';
|
|
9
|
+
import { r as rules } from './shared/preset-wind4.BNxtnClY.mjs';
|
|
10
10
|
import './colors.mjs';
|
|
11
|
-
import './shared/preset-wind4.
|
|
11
|
+
import './shared/preset-wind4.Ch1Z_NI2.mjs';
|
|
12
12
|
|
|
13
13
|
const resetCSS = `
|
|
14
14
|
/*
|
|
@@ -465,12 +465,19 @@ function theme(options) {
|
|
|
465
465
|
}
|
|
466
466
|
let deps;
|
|
467
467
|
const generateCSS = (deps2) => {
|
|
468
|
-
if (options.
|
|
469
|
-
|
|
468
|
+
if (options.utilityResolver) {
|
|
469
|
+
const resolver = toArray(options.utilityResolver);
|
|
470
|
+
for (const utility of deps2) {
|
|
471
|
+
for (const r of resolver) {
|
|
472
|
+
r(utility, "theme", ctx);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
470
475
|
}
|
|
471
|
-
|
|
476
|
+
const resolvedDeps = deps2.map(([key, value]) => key && value ? `${key}: ${value};` : void 0).filter(Boolean);
|
|
477
|
+
if (resolvedDeps.length === 0) {
|
|
472
478
|
return void 0;
|
|
473
|
-
|
|
479
|
+
}
|
|
480
|
+
const depCSS = resolvedDeps.join("\n");
|
|
474
481
|
return compressCSS(`
|
|
475
482
|
:root, :host {
|
|
476
483
|
${depCSS}
|
|
@@ -530,7 +537,8 @@ const presetWind4 = definePreset((options = {}) => {
|
|
|
530
537
|
shortcuts,
|
|
531
538
|
theme: theme$1,
|
|
532
539
|
layers: {
|
|
533
|
-
|
|
540
|
+
"cssvar-property": -200,
|
|
541
|
+
"theme": -150
|
|
534
542
|
},
|
|
535
543
|
preflights: preflights(options),
|
|
536
544
|
variants: variants(options),
|
package/dist/postprocess.d.mts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { PresetWind4Options } from './index.mjs';
|
|
2
2
|
export { postprocessors } from './index.mjs';
|
|
3
3
|
import { Postprocessor } from '@unocss/core';
|
|
4
|
+
import './shortcuts.mjs';
|
|
4
5
|
import './shared/preset-wind4.BXbWGSRz.mjs';
|
|
5
6
|
import './shared/preset-wind4.D71xGC6i.mjs';
|
|
6
|
-
import './shortcuts.mjs';
|
|
7
7
|
import './shared/preset-wind4.BOe5kxIw.mjs';
|
|
8
8
|
|
|
9
|
-
declare function important(option: PresetWind4Options
|
|
9
|
+
declare function important({ important: option }: PresetWind4Options): Postprocessor[];
|
|
10
|
+
|
|
11
|
+
declare function utility({ utilityResolver }: PresetWind4Options): Postprocessor[];
|
|
10
12
|
|
|
11
|
-
declare function varPrefix(prefix: PresetWind4Options
|
|
13
|
+
declare function varPrefix({ variablePrefix: prefix }: PresetWind4Options): Postprocessor[];
|
|
12
14
|
|
|
13
|
-
export { important, varPrefix };
|
|
15
|
+
export { important, utility, varPrefix };
|
package/dist/postprocess.d.ts
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { PresetWind4Options } from './index.js';
|
|
2
2
|
export { postprocessors } from './index.js';
|
|
3
3
|
import { Postprocessor } from '@unocss/core';
|
|
4
|
+
import './shortcuts.js';
|
|
4
5
|
import './shared/preset-wind4.BXbWGSRz.js';
|
|
5
6
|
import './shared/preset-wind4.Ca5oWgxX.js';
|
|
6
|
-
import './shortcuts.js';
|
|
7
7
|
import './shared/preset-wind4.BOe5kxIw.js';
|
|
8
8
|
|
|
9
|
-
declare function important(option: PresetWind4Options
|
|
9
|
+
declare function important({ important: option }: PresetWind4Options): Postprocessor[];
|
|
10
|
+
|
|
11
|
+
declare function utility({ utilityResolver }: PresetWind4Options): Postprocessor[];
|
|
10
12
|
|
|
11
|
-
declare function varPrefix(prefix: PresetWind4Options
|
|
13
|
+
declare function varPrefix({ variablePrefix: prefix }: PresetWind4Options): Postprocessor[];
|
|
12
14
|
|
|
13
|
-
export { important, varPrefix };
|
|
15
|
+
export { important, utility, varPrefix };
|
package/dist/postprocess.mjs
CHANGED
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return [];
|
|
4
|
-
const wrapWithIs = (selector) => {
|
|
5
|
-
if (selector.startsWith(":is(") && selector.endsWith(")"))
|
|
6
|
-
return selector;
|
|
7
|
-
if (selector.includes("::"))
|
|
8
|
-
return selector.replace(/(.*?)((?:\s\*)?::.*)/, ":is($1)$2");
|
|
9
|
-
return `:is(${selector})`;
|
|
10
|
-
};
|
|
11
|
-
return [
|
|
12
|
-
option === true ? (util) => {
|
|
13
|
-
util.entries.forEach((i) => {
|
|
14
|
-
if (i[1] != null && !String(i[1]).endsWith("!important"))
|
|
15
|
-
i[1] += " !important";
|
|
16
|
-
});
|
|
17
|
-
} : (util) => {
|
|
18
|
-
if (!util.selector.startsWith(option))
|
|
19
|
-
util.selector = `${option} ${wrapWithIs(util.selector)}`;
|
|
20
|
-
}
|
|
21
|
-
];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function varPrefix(prefix) {
|
|
25
|
-
const processor = (obj) => {
|
|
26
|
-
obj.entries.forEach((i) => {
|
|
27
|
-
i[0] = i[0].replace(/^--un-/, `--${prefix}`);
|
|
28
|
-
if (typeof i[1] === "string")
|
|
29
|
-
i[1] = i[1].replace(/var\(--un-/g, `var(--${prefix}`);
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
return prefix !== "un-" ? [processor] : [];
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function postprocessors(options) {
|
|
36
|
-
return [
|
|
37
|
-
...important(options.important),
|
|
38
|
-
...varPrefix(options.variablePrefix)
|
|
39
|
-
];
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export { important, postprocessors, varPrefix };
|
|
1
|
+
export { i as important, p as postprocessors, u as utility, v as varPrefix } from './shared/preset-wind4.Pg33yPuf.mjs';
|
|
2
|
+
import '@unocss/core';
|
package/dist/rules.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Rule, CSSEntries, Shortcut, StaticRule } from '@unocss/core';
|
|
1
|
+
import { Rule, CSSEntries, Shortcut, StaticRule, CSSValueInput } from '@unocss/core';
|
|
2
2
|
import { T as Theme } from './shared/preset-wind4.BXbWGSRz.mjs';
|
|
3
3
|
export { r as rules } from './shared/preset-wind4.D71xGC6i.mjs';
|
|
4
4
|
|
|
@@ -81,18 +81,18 @@ declare const rings: Rule<Theme>[];
|
|
|
81
81
|
declare const scrolls: Rule<Theme>[];
|
|
82
82
|
|
|
83
83
|
declare const shadowProperties: {
|
|
84
|
-
shadow:
|
|
85
|
-
shadowColor:
|
|
86
|
-
insetShadow:
|
|
87
|
-
insetShadowColor:
|
|
88
|
-
ringColor:
|
|
89
|
-
ringShadow:
|
|
90
|
-
insetRingColor:
|
|
91
|
-
insetRingShadow:
|
|
92
|
-
ringInset:
|
|
93
|
-
ringOffsetWidth:
|
|
94
|
-
ringOffsetColor:
|
|
95
|
-
ringOffsetShadow:
|
|
84
|
+
shadow: CSSValueInput;
|
|
85
|
+
shadowColor: CSSValueInput;
|
|
86
|
+
insetShadow: CSSValueInput;
|
|
87
|
+
insetShadowColor: CSSValueInput;
|
|
88
|
+
ringColor: CSSValueInput;
|
|
89
|
+
ringShadow: CSSValueInput;
|
|
90
|
+
insetRingColor: CSSValueInput;
|
|
91
|
+
insetRingShadow: CSSValueInput;
|
|
92
|
+
ringInset: CSSValueInput;
|
|
93
|
+
ringOffsetWidth: CSSValueInput;
|
|
94
|
+
ringOffsetColor: CSSValueInput;
|
|
95
|
+
ringOffsetShadow: CSSValueInput;
|
|
96
96
|
};
|
|
97
97
|
declare const boxShadows: Rule<Theme>[];
|
|
98
98
|
|
package/dist/rules.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Rule, CSSEntries, Shortcut, StaticRule } from '@unocss/core';
|
|
1
|
+
import { Rule, CSSEntries, Shortcut, StaticRule, CSSValueInput } from '@unocss/core';
|
|
2
2
|
import { T as Theme } from './shared/preset-wind4.BXbWGSRz.js';
|
|
3
3
|
export { r as rules } from './shared/preset-wind4.Ca5oWgxX.js';
|
|
4
4
|
|
|
@@ -81,18 +81,18 @@ declare const rings: Rule<Theme>[];
|
|
|
81
81
|
declare const scrolls: Rule<Theme>[];
|
|
82
82
|
|
|
83
83
|
declare const shadowProperties: {
|
|
84
|
-
shadow:
|
|
85
|
-
shadowColor:
|
|
86
|
-
insetShadow:
|
|
87
|
-
insetShadowColor:
|
|
88
|
-
ringColor:
|
|
89
|
-
ringShadow:
|
|
90
|
-
insetRingColor:
|
|
91
|
-
insetRingShadow:
|
|
92
|
-
ringInset:
|
|
93
|
-
ringOffsetWidth:
|
|
94
|
-
ringOffsetColor:
|
|
95
|
-
ringOffsetShadow:
|
|
84
|
+
shadow: CSSValueInput;
|
|
85
|
+
shadowColor: CSSValueInput;
|
|
86
|
+
insetShadow: CSSValueInput;
|
|
87
|
+
insetShadowColor: CSSValueInput;
|
|
88
|
+
ringColor: CSSValueInput;
|
|
89
|
+
ringShadow: CSSValueInput;
|
|
90
|
+
insetRingColor: CSSValueInput;
|
|
91
|
+
insetRingShadow: CSSValueInput;
|
|
92
|
+
ringInset: CSSValueInput;
|
|
93
|
+
ringOffsetWidth: CSSValueInput;
|
|
94
|
+
ringOffsetColor: CSSValueInput;
|
|
95
|
+
ringOffsetShadow: CSSValueInput;
|
|
96
96
|
};
|
|
97
97
|
declare const boxShadows: Rule<Theme>[];
|
|
98
98
|
|
package/dist/rules.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { d as accents, am as accessibility, H as alignments, a as animations, c as appearance, _ as appearances, U as aspectRatio, aj as backgroundBlendModes, b as backgroundStyles, m as bgColors, g as borderStyles, h as borders, S as boxShadows, N as boxSizing, a7 as breaks, e as carets, n as colorScheme, p as columns, a0 as contains, a5 as contentVisibility, a6 as contents, aB as cssProperty, aA as cssVariables, $ as cursors, Z as displays, u as divides, al as dynamicViewportHeight, x as filters, y as flex, J as flexGridJustifiesAlignments, L as floats, ac as fontSmoothings, ab as fontStyles, ay as fontVariantNumeric, at as fonts, z as gaps, A as grids, j as handlerBorderStyle, ad as hyphens, i as imageRenderings, K as insets, ah as isolations, F as justifies, C as lineClamps, l as listStyle, W as margins, ak as mixBlendModes, Y as notLastChildSelector, ai as objectPositions, k as opacity, G as orders, o as outline, B as overflows, f as overscrolls, V as paddings, D as placeholders, I as placements, a1 as pointerEvents, E as positions, O as questionMark, a2 as resizes, P as rings, r as rules, ag as screenReadersAccess, s as scrollBehaviors, Q as scrolls, R as shadowProperties, T as sizes, X as spaces, az as splitShorthand, an as svgUtilities, au as tabSizes, ao as tables, t as textAligns, q as textDecorations, av as textIndents, a9 as textOverflows, ax as textShadows, aw as textStrokes, aa as textTransforms, a8 as textWraps, ap as touchActions, aq as transformBase, ar as transforms, as as transitions, a3 as userSelects, v as verticalAligns, aC as viewTransition, a4 as whitespaces, w as willChange, ae as writingModes, af as writingOrientations, M as zIndexes } from './shared/preset-wind4.
|
|
2
|
-
export { a as container, c as containerParent, b as containerShortcuts } from './shared/preset-wind4.
|
|
3
|
-
import './shared/preset-wind4.
|
|
1
|
+
export { d as accents, am as accessibility, H as alignments, a as animations, c as appearance, _ as appearances, U as aspectRatio, aj as backgroundBlendModes, b as backgroundStyles, m as bgColors, g as borderStyles, h as borders, S as boxShadows, N as boxSizing, a7 as breaks, e as carets, n as colorScheme, p as columns, a0 as contains, a5 as contentVisibility, a6 as contents, aB as cssProperty, aA as cssVariables, $ as cursors, Z as displays, u as divides, al as dynamicViewportHeight, x as filters, y as flex, J as flexGridJustifiesAlignments, L as floats, ac as fontSmoothings, ab as fontStyles, ay as fontVariantNumeric, at as fonts, z as gaps, A as grids, j as handlerBorderStyle, ad as hyphens, i as imageRenderings, K as insets, ah as isolations, F as justifies, C as lineClamps, l as listStyle, W as margins, ak as mixBlendModes, Y as notLastChildSelector, ai as objectPositions, k as opacity, G as orders, o as outline, B as overflows, f as overscrolls, V as paddings, D as placeholders, I as placements, a1 as pointerEvents, E as positions, O as questionMark, a2 as resizes, P as rings, r as rules, ag as screenReadersAccess, s as scrollBehaviors, Q as scrolls, R as shadowProperties, T as sizes, X as spaces, az as splitShorthand, an as svgUtilities, au as tabSizes, ao as tables, t as textAligns, q as textDecorations, av as textIndents, a9 as textOverflows, ax as textShadows, aw as textStrokes, aa as textTransforms, a8 as textWraps, ap as touchActions, aq as transformBase, ar as transforms, as as transitions, a3 as userSelects, v as verticalAligns, aC as viewTransition, a4 as whitespaces, w as willChange, ae as writingModes, af as writingOrientations, M as zIndexes } from './shared/preset-wind4.BNxtnClY.mjs';
|
|
2
|
+
export { a as container, c as containerParent, b as containerShortcuts } from './shared/preset-wind4.Ch1Z_NI2.mjs';
|
|
3
|
+
import './shared/preset-wind4.CbSMpnSp.mjs';
|
|
4
4
|
import '@unocss/core';
|
|
5
5
|
import '@unocss/rule-utils';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { notNull
|
|
3
|
-
import { a as container, c as containerParent } from './preset-wind4.
|
|
1
|
+
import { j as globalKeywords, c as h, E as makeGlobalStaticRules, g as positionMap, w as parseColor, S as SpecialColorKey, L as defineProperty, b as themeTracking, M as detectThemeValue, u as colorResolver, F as isCSSMathFn, d as directionMap, B as hasParseableColor, e as cornerMap, p as passThemeKey, q as colorCSSGenerator, G as isSize, m as directionSize, n as numberResolver, o as colorableShadows, i as insetMap, J as hyphenate, r as resolveBreakpoints, H as transformXYZ, x as xyzMap, N as bracketTypeRe } from './preset-wind4.CbSMpnSp.mjs';
|
|
2
|
+
import { notNull } from '@unocss/core';
|
|
3
|
+
import { a as container, c as containerParent } from './preset-wind4.Ch1Z_NI2.mjs';
|
|
4
4
|
import { getStringComponent } from '@unocss/rule-utils';
|
|
5
5
|
|
|
6
6
|
const verticalAlignAlias = {
|
|
@@ -184,7 +184,8 @@ function bgGradientColorResolver() {
|
|
|
184
184
|
};
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
|
-
|
|
187
|
+
for (const p of Object.values(properties))
|
|
188
|
+
yield p;
|
|
188
189
|
}
|
|
189
190
|
};
|
|
190
191
|
}
|
|
@@ -193,7 +194,8 @@ function bgGradientPositionResolver() {
|
|
|
193
194
|
yield {
|
|
194
195
|
[`--un-gradient-${mode}-position`]: `${h.bracket.cssvar.percent(body)}`
|
|
195
196
|
};
|
|
196
|
-
|
|
197
|
+
for (const p of Object.values(properties))
|
|
198
|
+
yield p;
|
|
197
199
|
};
|
|
198
200
|
}
|
|
199
201
|
const backgroundStyles = [
|
|
@@ -436,9 +438,9 @@ const borders = [
|
|
|
436
438
|
[/^(?:border|b)-([bi][se])-(?:style-)?(.+)$/, handlerBorderStyle]
|
|
437
439
|
];
|
|
438
440
|
function borderColorResolver(direction) {
|
|
439
|
-
return ([, body],
|
|
440
|
-
const data = parseColor(body, theme);
|
|
441
|
-
const result = colorCSSGenerator(data, `border${direction}-color`, "border");
|
|
441
|
+
return ([, body], ctx) => {
|
|
442
|
+
const data = parseColor(body, ctx.theme);
|
|
443
|
+
const result = colorCSSGenerator(data, `border${direction}-color`, "border", ctx);
|
|
442
444
|
if (result) {
|
|
443
445
|
const css = result[0];
|
|
444
446
|
if (data?.color && !Object.values(SpecialColorKey).includes(data.color) && direction && direction !== "") {
|
|
@@ -458,11 +460,14 @@ function handlerBorderColorOrSize([, a = "", b], ctx) {
|
|
|
458
460
|
if (isCSSMathFn(h.bracket(b)))
|
|
459
461
|
return handlerBorderSize(["", a, b]);
|
|
460
462
|
if (hasParseableColor(b, ctx.theme)) {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
463
|
+
const direcetions = directionMap[a].map((i) => borderColorResolver(i)(["", b], ctx)).filter(notNull);
|
|
464
|
+
return [
|
|
465
|
+
direcetions.map((d) => d[0]).reduce((acc, item) => {
|
|
466
|
+
Object.assign(acc, item);
|
|
467
|
+
return acc;
|
|
468
|
+
}, {}),
|
|
469
|
+
...direcetions.flatMap((d) => d.slice(1))
|
|
470
|
+
];
|
|
466
471
|
}
|
|
467
472
|
}
|
|
468
473
|
}
|
|
@@ -722,7 +727,7 @@ const filterBaseKeys = [
|
|
|
722
727
|
"sepia",
|
|
723
728
|
"drop-shadow"
|
|
724
729
|
];
|
|
725
|
-
const filterProperties = filterBaseKeys.map((i) => defineProperty(`--un-${i}`))
|
|
730
|
+
const filterProperties = filterBaseKeys.map((i) => defineProperty(`--un-${i}`));
|
|
726
731
|
const filterCSS = filterBaseKeys.map((i) => `var(--un-${i},)`).join(" ");
|
|
727
732
|
const backdropBaseKeys = [
|
|
728
733
|
"backdrop-blur",
|
|
@@ -735,7 +740,7 @@ const backdropBaseKeys = [
|
|
|
735
740
|
"backdrop-saturate",
|
|
736
741
|
"backdrop-sepia"
|
|
737
742
|
];
|
|
738
|
-
const backdropProperties = backdropBaseKeys.map((i) => defineProperty(`--un-${i}`))
|
|
743
|
+
const backdropProperties = backdropBaseKeys.map((i) => defineProperty(`--un-${i}`));
|
|
739
744
|
const backdropCSS = backdropBaseKeys.map((i) => `var(--un-${i},)`).join(" ");
|
|
740
745
|
function percentWithDefault(str) {
|
|
741
746
|
let v = h.bracket.cssvar(str || "");
|
|
@@ -756,7 +761,7 @@ function toFilter(varName, resolver) {
|
|
|
756
761
|
"-webkit-backdrop-filter": backdropCSS,
|
|
757
762
|
"backdrop-filter": backdropCSS
|
|
758
763
|
},
|
|
759
|
-
backdropProperties
|
|
764
|
+
...backdropProperties
|
|
760
765
|
];
|
|
761
766
|
} else {
|
|
762
767
|
return [
|
|
@@ -764,7 +769,7 @@ function toFilter(varName, resolver) {
|
|
|
764
769
|
[`--un-${varName}`]: `${varName}(${value})`,
|
|
765
770
|
filter: filterCSS
|
|
766
771
|
},
|
|
767
|
-
filterProperties
|
|
772
|
+
...filterProperties
|
|
768
773
|
];
|
|
769
774
|
}
|
|
770
775
|
}
|
|
@@ -779,7 +784,7 @@ function dropShadowResolver([, s], { theme }) {
|
|
|
779
784
|
"--un-drop-shadow": `drop-shadow(${shadows.join(") drop-shadow(")})`,
|
|
780
785
|
"filter": filterCSS
|
|
781
786
|
},
|
|
782
|
-
filterProperties
|
|
787
|
+
...filterProperties
|
|
783
788
|
];
|
|
784
789
|
}
|
|
785
790
|
v = h.bracket.cssvar(s) ?? (s === "none" ? "" : void 0);
|
|
@@ -789,7 +794,7 @@ function dropShadowResolver([, s], { theme }) {
|
|
|
789
794
|
"--un-drop-shadow": v ? `drop-shadow(${v})` : v,
|
|
790
795
|
"filter": filterCSS
|
|
791
796
|
},
|
|
792
|
-
filterProperties
|
|
797
|
+
...filterProperties
|
|
793
798
|
];
|
|
794
799
|
}
|
|
795
800
|
}
|
|
@@ -1171,19 +1176,19 @@ const shadowProperties = {
|
|
|
1171
1176
|
insetRingColor: defineProperty("--un-inset-ring-color"),
|
|
1172
1177
|
insetRingShadow: defineProperty("--un-inset-ring-shadow", { initialValue: "0 0 #0000" }),
|
|
1173
1178
|
ringInset: defineProperty("--un-ring-inset"),
|
|
1174
|
-
ringOffsetWidth: defineProperty("--un-ring-offset-width", { syntax:
|
|
1179
|
+
ringOffsetWidth: defineProperty("--un-ring-offset-width", { syntax: "<length>", initialValue: "0px" }),
|
|
1175
1180
|
ringOffsetColor: defineProperty("--un-ring-offset-color"),
|
|
1176
1181
|
ringOffsetShadow: defineProperty("--un-ring-offset-shadow", { initialValue: "0 0 #0000" })
|
|
1177
1182
|
};
|
|
1178
1183
|
const boxShadows = [
|
|
1179
1184
|
// shadow
|
|
1180
|
-
[/^shadow(?:-(.+))?$/,
|
|
1185
|
+
[/^shadow(?:-(.+))?$/, handleShadow("shadow"), { autocomplete: ["shadow-$colors", "shadow-$shadow"] }],
|
|
1181
1186
|
[/^shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-shadow-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }],
|
|
1182
1187
|
// inset shadow
|
|
1183
|
-
[/^inset-shadow(?:-(.+))?$/,
|
|
1188
|
+
[/^inset-shadow(?:-(.+))?$/, handleShadow("insetShadow"), { autocomplete: ["inset-shadow-$colors", "inset-shadow-$insetShadow"] }],
|
|
1184
1189
|
[/^inset-shadow-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-inset-shadow-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "shadow-(op|opacity)-<percent>" }]
|
|
1185
1190
|
];
|
|
1186
|
-
function
|
|
1191
|
+
function handleShadow(themeKey) {
|
|
1187
1192
|
return (match, ctx) => {
|
|
1188
1193
|
const [, d] = match;
|
|
1189
1194
|
const { theme } = ctx;
|
|
@@ -1196,7 +1201,7 @@ function hanldeShadow(themeKey) {
|
|
|
1196
1201
|
"--un-shadow": colorableShadows(v || c, `--un-${colorVar}-color`).join(","),
|
|
1197
1202
|
"box-shadow": "var(--un-inset-shadow), var(--un-inset-ring-shadow), var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
|
|
1198
1203
|
},
|
|
1199
|
-
Object.values(shadowProperties)
|
|
1204
|
+
...Object.values(shadowProperties)
|
|
1200
1205
|
];
|
|
1201
1206
|
}
|
|
1202
1207
|
return colorResolver(`--un-${colorVar}-color`, colorVar)(match, ctx);
|
|
@@ -1210,10 +1215,10 @@ const rings = [
|
|
|
1210
1215
|
if (v != null) {
|
|
1211
1216
|
return [
|
|
1212
1217
|
{
|
|
1213
|
-
"--un-ring-shadow": `var(--un-ring-inset) 0 0 0 calc(${v} + var(--un-ring-offset-width)) var(--un-ring-color, currentColor)`,
|
|
1218
|
+
"--un-ring-shadow": `var(--un-ring-inset,) 0 0 0 calc(${v} + var(--un-ring-offset-width)) var(--un-ring-color, currentColor)`,
|
|
1214
1219
|
"box-shadow": "var(--un-inset-shadow), var(--un-inset-ring-shadow), var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
|
|
1215
1220
|
},
|
|
1216
|
-
Object.values(shadowProperties)
|
|
1221
|
+
...Object.values(shadowProperties)
|
|
1217
1222
|
];
|
|
1218
1223
|
}
|
|
1219
1224
|
}],
|
|
@@ -1228,7 +1233,7 @@ const rings = [
|
|
|
1228
1233
|
"--un-inset-ring-shadow": `inset 0 0 0 ${v} var(--un-inset-ring-color, currentColor)`,
|
|
1229
1234
|
"box-shadow": "var(--un-inset-shadow), var(--un-inset-ring-shadow), var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow)"
|
|
1230
1235
|
},
|
|
1231
|
-
Object.values(shadowProperties)
|
|
1236
|
+
...Object.values(shadowProperties)
|
|
1232
1237
|
];
|
|
1233
1238
|
}
|
|
1234
1239
|
}],
|
|
@@ -1412,7 +1417,7 @@ const contains = [
|
|
|
1412
1417
|
"--un-contain-size": d,
|
|
1413
1418
|
"contain": containValues.map((i) => `var(--un-contain-${i})`).join(" ")
|
|
1414
1419
|
},
|
|
1415
|
-
containValues.map((i) => defineProperty(`--un-contain-${i}`))
|
|
1420
|
+
...containValues.map((i) => defineProperty(`--un-contain-${i}`))
|
|
1416
1421
|
] : void 0;
|
|
1417
1422
|
}],
|
|
1418
1423
|
["contain-strict", { contain: "strict" }],
|
|
@@ -1694,7 +1699,8 @@ const tables = [
|
|
|
1694
1699
|
"--un-border-spacing-y": v,
|
|
1695
1700
|
"border-spacing": "var(--un-border-spacing-x) var(--un-border-spacing-y)"
|
|
1696
1701
|
};
|
|
1697
|
-
|
|
1702
|
+
for (const d of ["x", "y"])
|
|
1703
|
+
yield defineProperty(`--un-border-spacing-${d}`, { syntax: "<length>", initialValue: "0" });
|
|
1698
1704
|
}
|
|
1699
1705
|
}, { autocomplete: ["border-spacing", "border-spacing-$spacing"] }],
|
|
1700
1706
|
[/^border-spacing-([xy])-(.+)$/, function* ([, d, s], { theme }) {
|
|
@@ -1704,7 +1710,8 @@ const tables = [
|
|
|
1704
1710
|
[`--un-border-spacing-${d}`]: v,
|
|
1705
1711
|
"border-spacing": "var(--un-border-spacing-x) var(--un-border-spacing-y)"
|
|
1706
1712
|
};
|
|
1707
|
-
|
|
1713
|
+
for (const d2 of ["x", "y"])
|
|
1714
|
+
yield defineProperty(`--un-border-spacing-${d2}`, { syntax: "<length>", initialValue: "0" });
|
|
1708
1715
|
}
|
|
1709
1716
|
}, { autocomplete: ["border-spacing-(x|y)", "border-spacing-(x|y)-$spacing"] }],
|
|
1710
1717
|
["caption-top", { "caption-side": "top" }],
|
|
@@ -1729,28 +1736,31 @@ function resolveValue(s, theme) {
|
|
|
1729
1736
|
}
|
|
1730
1737
|
|
|
1731
1738
|
const touchActionValue = "var(--un-pan-x) var(--un-pan-y) var(--un-pinch-zoom)";
|
|
1732
|
-
const
|
|
1739
|
+
const touchActionProperties = ["pan-x", "pan-y", "pinch-zoom"].map((d) => defineProperty(`--un-${d}`));
|
|
1733
1740
|
const touchActions = [
|
|
1734
1741
|
[/^touch-pan-(x|left|right)$/, function* ([, d]) {
|
|
1735
1742
|
yield {
|
|
1736
1743
|
"--un-pan-x": `pan-${d}`,
|
|
1737
1744
|
"touch-action": touchActionValue
|
|
1738
1745
|
};
|
|
1739
|
-
|
|
1746
|
+
for (const p of touchActionProperties)
|
|
1747
|
+
yield p;
|
|
1740
1748
|
}, { autocomplete: ["touch-pan", "touch-pan-(x|left|right|y|up|down)"] }],
|
|
1741
1749
|
[/^touch-pan-(y|up|down)$/, function* ([, d]) {
|
|
1742
1750
|
yield {
|
|
1743
1751
|
"--un-pan-y": `pan-${d}`,
|
|
1744
1752
|
"touch-action": touchActionValue
|
|
1745
1753
|
};
|
|
1746
|
-
|
|
1754
|
+
for (const p of touchActionProperties)
|
|
1755
|
+
yield p;
|
|
1747
1756
|
}],
|
|
1748
1757
|
[/^touch-pinch-zoom$/, function* () {
|
|
1749
1758
|
yield {
|
|
1750
1759
|
"--un-pinch-zoom": "pinch-zoom",
|
|
1751
1760
|
"touch-action": touchActionValue
|
|
1752
1761
|
};
|
|
1753
|
-
|
|
1762
|
+
for (const p of touchActionProperties)
|
|
1763
|
+
yield p;
|
|
1754
1764
|
}],
|
|
1755
1765
|
["touch-auto", { "touch-action": "auto" }],
|
|
1756
1766
|
["touch-manipulation", { "touch-action": "manipulation" }],
|
|
@@ -1852,7 +1862,7 @@ function handleTranslate([, d, b]) {
|
|
|
1852
1862
|
...transformXYZ(d, typeof v === "number" ? `calc(var(--spacing) * ${v})` : v, "translate"),
|
|
1853
1863
|
["translate", `var(--un-translate-x) var(--un-translate-y)${d === "z" ? " var(--un-translate-z)" : ""}`]
|
|
1854
1864
|
],
|
|
1855
|
-
["x", "y", "z"].map((d2) => defineProperty(`--un-translate-${d2}`, { initialValue: 0 }))
|
|
1865
|
+
...["x", "y", "z"].map((d2) => defineProperty(`--un-translate-${d2}`, { initialValue: 0 }))
|
|
1856
1866
|
];
|
|
1857
1867
|
}
|
|
1858
1868
|
}
|
|
@@ -1869,7 +1879,7 @@ function handleScale([, d, b]) {
|
|
|
1869
1879
|
...transformXYZ(d, v, "scale"),
|
|
1870
1880
|
["scale", `var(--un-scale-x) var(--un-scale-y)${d === "z" ? " var(--un-scale-z)" : ""}`]
|
|
1871
1881
|
],
|
|
1872
|
-
["x", "y", "z"].map((d2) => defineProperty(`--un-scale-${d2}`, { initialValue: 1 }))
|
|
1882
|
+
...["x", "y", "z"].map((d2) => defineProperty(`--un-scale-${d2}`, { initialValue: 1 }))
|
|
1873
1883
|
];
|
|
1874
1884
|
}
|
|
1875
1885
|
}
|
|
@@ -1887,8 +1897,8 @@ function handleRotate([, d = "", b]) {
|
|
|
1887
1897
|
...transformXYZ(d, v.endsWith("deg") ? `rotate${d.toUpperCase()}(${v})` : v, "rotate"),
|
|
1888
1898
|
["transform", transform]
|
|
1889
1899
|
],
|
|
1890
|
-
["x", "y", "z"].map((d2) => defineProperty(`--un-rotate-${d2}`, { initialValue: `rotate${d2.toUpperCase()}(0)` }))
|
|
1891
|
-
["x", "y"].map((d2) => defineProperty(`--un-skew-${d2}`, { initialValue: `skew${d2.toUpperCase()}(0)` }))
|
|
1900
|
+
...["x", "y", "z"].map((d2) => defineProperty(`--un-rotate-${d2}`, { initialValue: `rotate${d2.toUpperCase()}(0)` })),
|
|
1901
|
+
...["x", "y"].map((d2) => defineProperty(`--un-skew-${d2}`, { initialValue: `skew${d2.toUpperCase()}(0)` }))
|
|
1892
1902
|
];
|
|
1893
1903
|
} else {
|
|
1894
1904
|
return {
|
|
@@ -1906,8 +1916,8 @@ function handleSkew([, d, b]) {
|
|
|
1906
1916
|
...ds.map((_d) => [`--un-skew${_d}`, v.endsWith("deg") ? `skew${_d.slice(1).toUpperCase()}(${v})` : v]),
|
|
1907
1917
|
["transform", transform]
|
|
1908
1918
|
],
|
|
1909
|
-
["x", "y", "z"].map((d2) => defineProperty(`--un-rotate-${d2}`, { initialValue: `rotate${d2.toUpperCase()}(0)` }))
|
|
1910
|
-
["x", "y"].map((d2) => defineProperty(`--un-skew-${d2}`, { initialValue: `skew${d2.toUpperCase()}(0)` }))
|
|
1919
|
+
...["x", "y", "z"].map((d2) => defineProperty(`--un-rotate-${d2}`, { initialValue: `rotate${d2.toUpperCase()}(0)` })),
|
|
1920
|
+
...["x", "y"].map((d2) => defineProperty(`--un-skew-${d2}`, { initialValue: `skew${d2.toUpperCase()}(0)` }))
|
|
1911
1921
|
];
|
|
1912
1922
|
}
|
|
1913
1923
|
}
|
|
@@ -2203,19 +2213,19 @@ const fontVariantNumericProperties = [
|
|
|
2203
2213
|
defineProperty("--un-numeric-figure"),
|
|
2204
2214
|
defineProperty("--un-numeric-spacing"),
|
|
2205
2215
|
defineProperty("--un-numeric-fraction")
|
|
2206
|
-
]
|
|
2216
|
+
];
|
|
2207
2217
|
const baseFontVariantNumeric = {
|
|
2208
2218
|
"font-variant-numeric": "var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction)"
|
|
2209
2219
|
};
|
|
2210
2220
|
const fontVariantNumeric = [
|
|
2211
|
-
["ordinal", [{ "--un-ordinal": "ordinal", ...baseFontVariantNumeric }, fontVariantNumericProperties]],
|
|
2212
|
-
["slashed-zero", [{ "--un-slashed-zero": "slashed-zero", ...baseFontVariantNumeric }, fontVariantNumericProperties]],
|
|
2213
|
-
["lining-nums", [{ "--un-numeric-figure": "lining-nums", ...baseFontVariantNumeric }, fontVariantNumericProperties]],
|
|
2214
|
-
["oldstyle-nums", [{ "--un-numeric-figure": "oldstyle-nums", ...baseFontVariantNumeric }, fontVariantNumericProperties]],
|
|
2215
|
-
["proportional-nums", [{ "--un-numeric-spacing": "proportional-nums", ...baseFontVariantNumeric }, fontVariantNumericProperties]],
|
|
2216
|
-
["tabular-nums", [{ "--un-numeric-spacing": "tabular-nums", ...baseFontVariantNumeric }, fontVariantNumericProperties]],
|
|
2217
|
-
["diagonal-fractions", [{ "--un-numeric-fraction": "diagonal-fractions", ...baseFontVariantNumeric }, fontVariantNumericProperties]],
|
|
2218
|
-
["stacked-fractions", [{ "--un-numeric-fraction": "stacked-fractions", ...baseFontVariantNumeric }, fontVariantNumericProperties]],
|
|
2221
|
+
["ordinal", [{ "--un-ordinal": "ordinal", ...baseFontVariantNumeric }, ...fontVariantNumericProperties]],
|
|
2222
|
+
["slashed-zero", [{ "--un-slashed-zero": "slashed-zero", ...baseFontVariantNumeric }, ...fontVariantNumericProperties]],
|
|
2223
|
+
["lining-nums", [{ "--un-numeric-figure": "lining-nums", ...baseFontVariantNumeric }, ...fontVariantNumericProperties]],
|
|
2224
|
+
["oldstyle-nums", [{ "--un-numeric-figure": "oldstyle-nums", ...baseFontVariantNumeric }, ...fontVariantNumericProperties]],
|
|
2225
|
+
["proportional-nums", [{ "--un-numeric-spacing": "proportional-nums", ...baseFontVariantNumeric }, ...fontVariantNumericProperties]],
|
|
2226
|
+
["tabular-nums", [{ "--un-numeric-spacing": "tabular-nums", ...baseFontVariantNumeric }, ...fontVariantNumericProperties]],
|
|
2227
|
+
["diagonal-fractions", [{ "--un-numeric-fraction": "diagonal-fractions", ...baseFontVariantNumeric }, ...fontVariantNumericProperties]],
|
|
2228
|
+
["stacked-fractions", [{ "--un-numeric-fraction": "stacked-fractions", ...baseFontVariantNumeric }, ...fontVariantNumericProperties]],
|
|
2219
2229
|
["normal-nums", [{ "font-variant-numeric": "normal" }]]
|
|
2220
2230
|
];
|
|
2221
2231
|
function handleText([, s = "base"], { theme }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { variantGetParameter, variantMatcher, variantGetBracket, variantParentMatcher, getBracket, hasThemeFn, transformThemeFn, getStringComponent } from '@unocss/rule-utils';
|
|
2
|
-
import {
|
|
2
|
+
import { c as h, r as resolveBreakpoints, C as CONTROL_MINI_NO_NEGATIVE, k as cssMathFnRE, l as cssVarFnRE, B as hasParseableColor } from './preset-wind4.CbSMpnSp.mjs';
|
|
3
3
|
import { escapeRegExp, escapeSelector } from '@unocss/core';
|
|
4
4
|
|
|
5
5
|
const variantAria = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { toArray, escapeSelector } from '@unocss/core';
|
|
1
|
+
import { toArray, escapeSelector, symbols } from '@unocss/core';
|
|
2
2
|
import { createValueHandler, parseCssColor, getStringComponents, colorToString, getStringComponent } from '@unocss/rule-utils';
|
|
3
3
|
|
|
4
4
|
const PRESET_NAME = "@unocss/preset-wind4";
|
|
@@ -140,6 +140,7 @@ const unitOnlyMap = {
|
|
|
140
140
|
};
|
|
141
141
|
const bracketTypeRe = /^\[(color|image|length|size|position|quoted|string):/i;
|
|
142
142
|
const splitComma = /,(?![^()]*\))/g;
|
|
143
|
+
const remRE = /(-?[.\d]+)rem/g;
|
|
143
144
|
|
|
144
145
|
const cssProps = [
|
|
145
146
|
// basic props
|
|
@@ -673,7 +674,22 @@ function defineProperty(property, options = {}) {
|
|
|
673
674
|
inherits = false,
|
|
674
675
|
initialValue
|
|
675
676
|
} = options;
|
|
676
|
-
|
|
677
|
+
const value = {
|
|
678
|
+
[symbols.shortcutsNoMerge]: true,
|
|
679
|
+
[symbols.noMerge]: true,
|
|
680
|
+
[symbols.variants]: () => [
|
|
681
|
+
{
|
|
682
|
+
parent: "",
|
|
683
|
+
layer: "cssvar-property",
|
|
684
|
+
selector: () => `@property ${property}`
|
|
685
|
+
}
|
|
686
|
+
],
|
|
687
|
+
syntax: JSON.stringify(syntax),
|
|
688
|
+
inherits: inherits ? "true" : "false"
|
|
689
|
+
};
|
|
690
|
+
if (initialValue != null)
|
|
691
|
+
value["initial-value"] = JSON.stringify(initialValue);
|
|
692
|
+
return value;
|
|
677
693
|
}
|
|
678
694
|
function detectThemeValue(value, theme) {
|
|
679
695
|
if (value.startsWith("var(")) {
|
|
@@ -689,4 +705,4 @@ function detectThemeValue(value, theme) {
|
|
|
689
705
|
}
|
|
690
706
|
}
|
|
691
707
|
|
|
692
|
-
export {
|
|
708
|
+
export { colorVariable as A, hasParseableColor as B, CONTROL_MINI_NO_NEGATIVE as C, resolveVerticalBreakpoints as D, makeGlobalStaticRules as E, isCSSMathFn as F, isSize as G, transformXYZ as H, camelize as I, hyphenate as J, compressCSS as K, defineProperty as L, detectThemeValue as M, bracketTypeRe as N, PRESET_NAME as P, SpecialColorKey as S, remRE as a, themeTracking as b, h as c, directionMap as d, cornerMap as e, xyzArray as f, positionMap as g, handler as h, insetMap as i, globalKeywords as j, cssMathFnRE as k, cssVarFnRE as l, directionSize as m, numberResolver as n, colorableShadows as o, passThemeKey as p, colorCSSGenerator as q, resolveBreakpoints as r, splitShorthand as s, trackedTheme as t, colorResolver as u, valueHandlers as v, parseColor as w, xyzMap as x, parseThemeColor as y, getThemeByKey as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isString } from '@unocss/core';
|
|
2
|
-
import {
|
|
2
|
+
import { r as resolveBreakpoints } from './preset-wind4.CbSMpnSp.mjs';
|
|
3
3
|
|
|
4
4
|
const containerParent = [
|
|
5
5
|
[/^@container(?:\/(\w+))?(?:-(normal))?$/, ([, l, v]) => {
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { toArray } from '@unocss/core';
|
|
2
|
+
|
|
3
|
+
function important({ important: option }) {
|
|
4
|
+
if (option == null || option === false)
|
|
5
|
+
return [];
|
|
6
|
+
const wrapWithIs = (selector) => {
|
|
7
|
+
if (selector.startsWith(":is(") && selector.endsWith(")"))
|
|
8
|
+
return selector;
|
|
9
|
+
if (selector.includes("::"))
|
|
10
|
+
return selector.replace(/(.*?)((?:\s\*)?::.*)/, ":is($1)$2");
|
|
11
|
+
return `:is(${selector})`;
|
|
12
|
+
};
|
|
13
|
+
return [
|
|
14
|
+
option === true ? (util) => {
|
|
15
|
+
util.entries.forEach((i) => {
|
|
16
|
+
if (i[1] != null && !String(i[1]).endsWith("!important"))
|
|
17
|
+
i[1] += " !important";
|
|
18
|
+
});
|
|
19
|
+
} : (util) => {
|
|
20
|
+
if (!util.selector.startsWith(option))
|
|
21
|
+
util.selector = `${option} ${wrapWithIs(util.selector)}`;
|
|
22
|
+
}
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function utility({ utilityResolver }) {
|
|
27
|
+
const processor = (util) => {
|
|
28
|
+
const resolvers = toArray(utilityResolver);
|
|
29
|
+
util.entries.forEach((i) => {
|
|
30
|
+
for (const resolver of resolvers) {
|
|
31
|
+
resolver(i, "default", {});
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
return utilityResolver ? [processor] : [];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function varPrefix({ variablePrefix: prefix }) {
|
|
39
|
+
const processor = (obj) => {
|
|
40
|
+
obj.entries.forEach((i) => {
|
|
41
|
+
i[0] = i[0].replace(/^--un-/, `--${prefix}`);
|
|
42
|
+
if (typeof i[1] === "string")
|
|
43
|
+
i[1] = i[1].replace(/var\(--un-/g, `var(--${prefix}`);
|
|
44
|
+
});
|
|
45
|
+
};
|
|
46
|
+
return prefix !== "un-" ? [processor] : [];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function postprocessors(options) {
|
|
50
|
+
return [
|
|
51
|
+
important,
|
|
52
|
+
varPrefix,
|
|
53
|
+
utility
|
|
54
|
+
].flatMap((i) => i(options));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export { important as i, postprocessors as p, utility as u, varPrefix as v };
|
package/dist/shortcuts.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { s as shortcuts } from './shared/preset-wind4.
|
|
2
|
-
import './shared/preset-wind4.
|
|
1
|
+
export { s as shortcuts } from './shared/preset-wind4.BLH55jNO.mjs';
|
|
2
|
+
import './shared/preset-wind4.Ch1Z_NI2.mjs';
|
|
3
3
|
import '@unocss/core';
|
|
4
|
-
import './shared/preset-wind4.
|
|
4
|
+
import './shared/preset-wind4.CbSMpnSp.mjs';
|
|
5
5
|
import '@unocss/rule-utils';
|
package/dist/utils.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arrayable, DynamicMatcher, RuleContext, CSSObject, CSSValueInput, VariantContext, StaticRule } from '@unocss/core';
|
|
1
|
+
import { Arrayable, CSSEntry, DynamicMatcher, RuleContext, CSSObject, CSSValueInput, VariantContext, StaticRule } from '@unocss/core';
|
|
2
2
|
import * as _unocss_rule_utils from '@unocss/rule-utils';
|
|
3
3
|
export * from '@unocss/rule-utils';
|
|
4
4
|
import { T as Theme } from './shared/preset-wind4.BXbWGSRz.mjs';
|
|
@@ -70,6 +70,8 @@ declare const globalKeywords: string[];
|
|
|
70
70
|
declare const cssMathFnRE: RegExp;
|
|
71
71
|
declare const cssVarFnRE: RegExp;
|
|
72
72
|
|
|
73
|
+
declare function createRemToPxResolver(base?: number): (utility: CSSEntry) => void;
|
|
74
|
+
|
|
73
75
|
declare const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
|
|
74
76
|
declare const SpecialColorKey: {
|
|
75
77
|
transparent: string;
|
|
@@ -88,7 +90,7 @@ declare function directionSize(propertyPrefix: string): DynamicMatcher<Theme>;
|
|
|
88
90
|
*/
|
|
89
91
|
declare function splitShorthand(body: string, type: string): string[] | undefined;
|
|
90
92
|
declare function colorableShadows(shadows: string | string[], colorVar: string): string[];
|
|
91
|
-
declare function colorCSSGenerator(data: ReturnType<typeof parseColor>, property: string, varName: string, ctx?: RuleContext<Theme>): [CSSObject,
|
|
93
|
+
declare function colorCSSGenerator(data: ReturnType<typeof parseColor>, property: string, varName: string, ctx?: RuleContext<Theme>): [CSSObject, ...CSSValueInput[]] | undefined;
|
|
92
94
|
declare function colorResolver(property: string, varName: string): ([, body]: string[], ctx: RuleContext<Theme>) => (CSSValueInput | string)[] | undefined;
|
|
93
95
|
/**
|
|
94
96
|
* Parse color string into {@link ParsedColorValue} (if possible). Color value will first be matched to theme object before parsing.
|
|
@@ -143,7 +145,7 @@ declare function defineProperty(property: string, options?: {
|
|
|
143
145
|
syntax?: string;
|
|
144
146
|
inherits?: boolean;
|
|
145
147
|
initialValue?: unknown;
|
|
146
|
-
}):
|
|
148
|
+
}): CSSValueInput;
|
|
147
149
|
declare function detectThemeValue(value: string, theme: Theme): void;
|
|
148
150
|
|
|
149
|
-
export { CONTROL_MINI_NO_NEGATIVE, PRESET_NAME, SpecialColorKey, camelize, colorCSSGenerator, colorResolver, colorVariable, colorableShadows, compressCSS, cornerMap, cssMathFnRE, cssVarFnRE, defineProperty, detectThemeValue, directionMap, directionSize, getThemeByKey, globalKeywords, h, handler, hasParseableColor, hyphenate, insetMap, isCSSMathFn, isSize, makeGlobalStaticRules, numberResolver, parseColor, parseThemeColor, passThemeKey, positionMap, resolveBreakpoints, resolveVerticalBreakpoints, splitShorthand, themeTracking, trackedTheme, transformXYZ, handlers as valueHandlers, xyzArray, xyzMap };
|
|
151
|
+
export { CONTROL_MINI_NO_NEGATIVE, PRESET_NAME, SpecialColorKey, camelize, colorCSSGenerator, colorResolver, colorVariable, colorableShadows, compressCSS, cornerMap, createRemToPxResolver, cssMathFnRE, cssVarFnRE, defineProperty, detectThemeValue, directionMap, directionSize, getThemeByKey, globalKeywords, h, handler, hasParseableColor, hyphenate, insetMap, isCSSMathFn, isSize, makeGlobalStaticRules, numberResolver, parseColor, parseThemeColor, passThemeKey, positionMap, resolveBreakpoints, resolveVerticalBreakpoints, splitShorthand, themeTracking, trackedTheme, transformXYZ, handlers as valueHandlers, xyzArray, xyzMap };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Arrayable, DynamicMatcher, RuleContext, CSSObject, CSSValueInput, VariantContext, StaticRule } from '@unocss/core';
|
|
1
|
+
import { Arrayable, CSSEntry, DynamicMatcher, RuleContext, CSSObject, CSSValueInput, VariantContext, StaticRule } from '@unocss/core';
|
|
2
2
|
import * as _unocss_rule_utils from '@unocss/rule-utils';
|
|
3
3
|
export * from '@unocss/rule-utils';
|
|
4
4
|
import { T as Theme } from './shared/preset-wind4.BXbWGSRz.js';
|
|
@@ -70,6 +70,8 @@ declare const globalKeywords: string[];
|
|
|
70
70
|
declare const cssMathFnRE: RegExp;
|
|
71
71
|
declare const cssVarFnRE: RegExp;
|
|
72
72
|
|
|
73
|
+
declare function createRemToPxResolver(base?: number): (utility: CSSEntry) => void;
|
|
74
|
+
|
|
73
75
|
declare const CONTROL_MINI_NO_NEGATIVE = "$$mini-no-negative";
|
|
74
76
|
declare const SpecialColorKey: {
|
|
75
77
|
transparent: string;
|
|
@@ -88,7 +90,7 @@ declare function directionSize(propertyPrefix: string): DynamicMatcher<Theme>;
|
|
|
88
90
|
*/
|
|
89
91
|
declare function splitShorthand(body: string, type: string): string[] | undefined;
|
|
90
92
|
declare function colorableShadows(shadows: string | string[], colorVar: string): string[];
|
|
91
|
-
declare function colorCSSGenerator(data: ReturnType<typeof parseColor>, property: string, varName: string, ctx?: RuleContext<Theme>): [CSSObject,
|
|
93
|
+
declare function colorCSSGenerator(data: ReturnType<typeof parseColor>, property: string, varName: string, ctx?: RuleContext<Theme>): [CSSObject, ...CSSValueInput[]] | undefined;
|
|
92
94
|
declare function colorResolver(property: string, varName: string): ([, body]: string[], ctx: RuleContext<Theme>) => (CSSValueInput | string)[] | undefined;
|
|
93
95
|
/**
|
|
94
96
|
* Parse color string into {@link ParsedColorValue} (if possible). Color value will first be matched to theme object before parsing.
|
|
@@ -143,7 +145,7 @@ declare function defineProperty(property: string, options?: {
|
|
|
143
145
|
syntax?: string;
|
|
144
146
|
inherits?: boolean;
|
|
145
147
|
initialValue?: unknown;
|
|
146
|
-
}):
|
|
148
|
+
}): CSSValueInput;
|
|
147
149
|
declare function detectThemeValue(value: string, theme: Theme): void;
|
|
148
150
|
|
|
149
|
-
export { CONTROL_MINI_NO_NEGATIVE, PRESET_NAME, SpecialColorKey, camelize, colorCSSGenerator, colorResolver, colorVariable, colorableShadows, compressCSS, cornerMap, cssMathFnRE, cssVarFnRE, defineProperty, detectThemeValue, directionMap, directionSize, getThemeByKey, globalKeywords, h, handler, hasParseableColor, hyphenate, insetMap, isCSSMathFn, isSize, makeGlobalStaticRules, numberResolver, parseColor, parseThemeColor, passThemeKey, positionMap, resolveBreakpoints, resolveVerticalBreakpoints, splitShorthand, themeTracking, trackedTheme, transformXYZ, handlers as valueHandlers, xyzArray, xyzMap };
|
|
151
|
+
export { CONTROL_MINI_NO_NEGATIVE, PRESET_NAME, SpecialColorKey, camelize, colorCSSGenerator, colorResolver, colorVariable, colorableShadows, compressCSS, cornerMap, createRemToPxResolver, cssMathFnRE, cssVarFnRE, defineProperty, detectThemeValue, directionMap, directionSize, getThemeByKey, globalKeywords, h, handler, hasParseableColor, hyphenate, insetMap, isCSSMathFn, isSize, makeGlobalStaticRules, numberResolver, parseColor, parseThemeColor, passThemeKey, positionMap, resolveBreakpoints, resolveVerticalBreakpoints, splitShorthand, themeTracking, trackedTheme, transformXYZ, handlers as valueHandlers, xyzArray, xyzMap };
|
package/dist/utils.mjs
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
import { a as remRE } from './shared/preset-wind4.CbSMpnSp.mjs';
|
|
2
|
+
export { C as CONTROL_MINI_NO_NEGATIVE, P as PRESET_NAME, S as SpecialColorKey, I as camelize, q as colorCSSGenerator, u as colorResolver, A as colorVariable, o as colorableShadows, K as compressCSS, e as cornerMap, k as cssMathFnRE, l as cssVarFnRE, L as defineProperty, M as detectThemeValue, d as directionMap, m as directionSize, z as getThemeByKey, j as globalKeywords, c as h, h as handler, B as hasParseableColor, J as hyphenate, i as insetMap, F as isCSSMathFn, G as isSize, E as makeGlobalStaticRules, n as numberResolver, w as parseColor, y as parseThemeColor, p as passThemeKey, g as positionMap, r as resolveBreakpoints, D as resolveVerticalBreakpoints, s as splitShorthand, b as themeTracking, t as trackedTheme, H as transformXYZ, v as valueHandlers, f as xyzArray, x as xyzMap } from './shared/preset-wind4.CbSMpnSp.mjs';
|
|
2
3
|
export * from '@unocss/rule-utils';
|
|
3
4
|
import '@unocss/core';
|
|
5
|
+
|
|
6
|
+
function createRemToPxResolver(base = 16) {
|
|
7
|
+
return (utility) => {
|
|
8
|
+
if (typeof utility[1] === "string" && remRE.test(utility[1]))
|
|
9
|
+
utility[1] = utility[1].replace(remRE, (_, p1) => `${p1 * base}px`);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export { createRemToPxResolver };
|
package/dist/variants.d.mts
CHANGED
|
@@ -2,8 +2,8 @@ import { VariantObject, Variant, VariantFunction } from '@unocss/core';
|
|
|
2
2
|
import { T as Theme } from './shared/preset-wind4.BXbWGSRz.mjs';
|
|
3
3
|
import { PresetWind4Options } from './index.mjs';
|
|
4
4
|
export { variants } from './index.mjs';
|
|
5
|
-
import './shared/preset-wind4.D71xGC6i.mjs';
|
|
6
5
|
import './shortcuts.mjs';
|
|
6
|
+
import './shared/preset-wind4.D71xGC6i.mjs';
|
|
7
7
|
import './shared/preset-wind4.BOe5kxIw.mjs';
|
|
8
8
|
|
|
9
9
|
declare const variantAria: VariantObject<Theme>;
|
package/dist/variants.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { VariantObject, Variant, VariantFunction } from '@unocss/core';
|
|
|
2
2
|
import { T as Theme } from './shared/preset-wind4.BXbWGSRz.js';
|
|
3
3
|
import { PresetWind4Options } from './index.js';
|
|
4
4
|
export { variants } from './index.js';
|
|
5
|
-
import './shared/preset-wind4.Ca5oWgxX.js';
|
|
6
5
|
import './shortcuts.js';
|
|
6
|
+
import './shared/preset-wind4.Ca5oWgxX.js';
|
|
7
7
|
import './shared/preset-wind4.BOe5kxIw.js';
|
|
8
8
|
|
|
9
9
|
declare const variantAria: VariantObject<Theme>;
|
package/dist/variants.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { c as calcMaxWidthBySize, D as placeholderModifier, v as variantAria, b as variantBreakpoints, d as variantChildren, h as variantColorsMediaOrClass, i as variantColorsScheme, e as variantCombinators, g as variantContainerQuery, q as variantContrasts, w as variantCssLayer, p as variantCustomMedia, j as variantDataAttribute, t as variantForcedColors, n as variantImportant, x as variantInternalLayer, m as variantLanguageDirections, r as variantMotions, C as variantNegative, s as variantOrientations, H as variantPartClasses, o as variantPrint, F as variantPseudoClassFunctions, E as variantPseudoClassesAndElements, y as variantScope, u as variantSelector, I as variantStartingStyle, B as variantStickyHover, J as variantSupports, f as variantSvgCombinators, a as variantTaggedAriaAttributes, k as variantTaggedDataAttributes, G as variantTaggedPseudoClasses, A as variantTheme, z as variantVariables, l as variants } from './shared/preset-wind4.
|
|
1
|
+
export { c as calcMaxWidthBySize, D as placeholderModifier, v as variantAria, b as variantBreakpoints, d as variantChildren, h as variantColorsMediaOrClass, i as variantColorsScheme, e as variantCombinators, g as variantContainerQuery, q as variantContrasts, w as variantCssLayer, p as variantCustomMedia, j as variantDataAttribute, t as variantForcedColors, n as variantImportant, x as variantInternalLayer, m as variantLanguageDirections, r as variantMotions, C as variantNegative, s as variantOrientations, H as variantPartClasses, o as variantPrint, F as variantPseudoClassFunctions, E as variantPseudoClassesAndElements, y as variantScope, u as variantSelector, I as variantStartingStyle, B as variantStickyHover, J as variantSupports, f as variantSvgCombinators, a as variantTaggedAriaAttributes, k as variantTaggedDataAttributes, G as variantTaggedPseudoClasses, A as variantTheme, z as variantVariables, l as variants } from './shared/preset-wind4.BgYY8vln.mjs';
|
|
2
2
|
import '@unocss/rule-utils';
|
|
3
|
-
import './shared/preset-wind4.
|
|
3
|
+
import './shared/preset-wind4.CbSMpnSp.mjs';
|
|
4
4
|
import '@unocss/core';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-wind4",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "66.1.0-beta.
|
|
4
|
+
"version": "66.1.0-beta.9",
|
|
5
5
|
"description": "Tailwind 4 compact preset for UnoCSS",
|
|
6
6
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"dist"
|
|
66
66
|
],
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@unocss/core": "66.1.0-beta.
|
|
69
|
-
"@unocss/
|
|
70
|
-
"@unocss/
|
|
68
|
+
"@unocss/core": "66.1.0-beta.9",
|
|
69
|
+
"@unocss/rule-utils": "66.1.0-beta.9",
|
|
70
|
+
"@unocss/extractor-arbitrary-variants": "66.1.0-beta.9"
|
|
71
71
|
},
|
|
72
72
|
"scripts": {
|
|
73
73
|
"build": "unbuild",
|