@unocss/preset-wind4 66.1.2 → 66.1.3
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/colors.mjs +242 -242
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +26 -27
- package/dist/postprocess.d.mts +3 -3
- package/dist/postprocess.d.ts +3 -3
- package/dist/postprocess.mjs +2 -0
- package/dist/rules.d.mts +2 -2
- package/dist/rules.d.ts +2 -2
- package/dist/rules.mjs +3 -3
- package/dist/shared/{preset-wind4.ZZA6r7w6.mjs → preset-wind4.B-PQ1xVa.mjs} +3 -12
- package/dist/shared/{preset-wind4.D2A57N1S.mjs → preset-wind4.BAz4i9y9.mjs} +1 -1
- package/dist/shared/{preset-wind4.CupdUNh8.mjs → preset-wind4.BicXgfCi.mjs} +61 -30
- package/dist/shared/{preset-wind4.BTkJgmuQ.mjs → preset-wind4.CKtLkvUz.mjs} +1 -1
- package/dist/shared/{preset-wind4.BXbWGSRz.d.mts → preset-wind4.CeNzqhCV.d.mts} +1 -1
- package/dist/shared/{preset-wind4.BXbWGSRz.d.ts → preset-wind4.CeNzqhCV.d.ts} +1 -1
- package/dist/shared/{preset-wind4.DLkbGy_k.mjs → preset-wind4.D7fOjUVe.mjs} +44 -26
- package/dist/shared/{preset-wind4.Bga6atur.d.ts → preset-wind4.Hki3f6hz.d.mts} +1 -1
- package/dist/shared/{preset-wind4.Bga6atur.d.mts → preset-wind4.Hki3f6hz.d.ts} +1 -1
- package/dist/shared/{preset-wind4.D71xGC6i.d.mts → preset-wind4.O8irdiHr.d.mts} +1 -1
- package/dist/shared/{preset-wind4.Ca5oWgxX.d.ts → preset-wind4.oLaz9HAb.d.ts} +1 -1
- package/dist/shortcuts.d.mts +1 -1
- package/dist/shortcuts.d.ts +1 -1
- package/dist/shortcuts.mjs +3 -3
- package/dist/theme.d.mts +3 -3
- package/dist/theme.d.ts +3 -3
- package/dist/theme.mjs +1 -1
- package/dist/utils.d.mts +8 -4
- package/dist/utils.d.ts +8 -4
- package/dist/utils.mjs +2 -2
- package/dist/variants.d.mts +4 -5
- package/dist/variants.d.ts +4 -5
- package/dist/variants.mjs +2 -2
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { toArray, definePreset } from '@unocss/core';
|
|
2
2
|
import { extractorArbitraryVariants } from '@unocss/extractor-arbitrary-variants';
|
|
3
|
-
import { k as themeTracking, K as compressCSS, t as trackedTheme, w as getThemeByKey, g as globalKeywords, P as PRESET_NAME } from './shared/preset-wind4.
|
|
3
|
+
import { k as themeTracking, K as compressCSS, t as trackedTheme, w as getThemeByKey, g as globalKeywords, P as PRESET_NAME } from './shared/preset-wind4.D7fOjUVe.mjs';
|
|
4
4
|
import { alphaPlaceholdersRE } from '@unocss/rule-utils';
|
|
5
5
|
import { postprocessors } from './postprocess.mjs';
|
|
6
|
-
import {
|
|
6
|
+
import { k as variants } from './shared/preset-wind4.B-PQ1xVa.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.CKtLkvUz.mjs';
|
|
9
|
+
import { r as rules } from './shared/preset-wind4.BicXgfCi.mjs';
|
|
10
10
|
import './colors.mjs';
|
|
11
|
-
import './shared/preset-wind4.
|
|
11
|
+
import './shared/preset-wind4.BAz4i9y9.mjs';
|
|
12
12
|
|
|
13
13
|
const resetCSS = `
|
|
14
14
|
/*
|
|
@@ -58,14 +58,6 @@ html,
|
|
|
58
58
|
-webkit-tap-highlight-color: transparent; /* 7 */
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
/*
|
|
62
|
-
Inherit line-height from \`html\` so users can set them as a class directly on the \`html\` element.
|
|
63
|
-
*/
|
|
64
|
-
|
|
65
|
-
body {
|
|
66
|
-
line-height: inherit;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
61
|
/*
|
|
70
62
|
1. Add the correct height in Firefox.
|
|
71
63
|
2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
|
|
@@ -297,13 +289,23 @@ textarea,
|
|
|
297
289
|
}
|
|
298
290
|
|
|
299
291
|
/*
|
|
300
|
-
|
|
301
|
-
2. Set the default placeholder color to a semi-transparent version of the current text color.
|
|
292
|
+
Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
|
|
302
293
|
*/
|
|
303
294
|
|
|
304
295
|
::placeholder {
|
|
305
|
-
opacity: 1;
|
|
306
|
-
|
|
296
|
+
opacity: 1;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/*
|
|
300
|
+
Set the default placeholder color to a semi-transparent version of the current text color in browsers that do not
|
|
301
|
+
crash when using \`color-mix(\u2026)\` with \`currentcolor\`. (https://github.com/tailwindlabs/tailwindcss/issues/17194)
|
|
302
|
+
*/
|
|
303
|
+
|
|
304
|
+
@supports (not (-webkit-appearance: -apple-pay-button)) /* Not Safari */ or
|
|
305
|
+
(contain-intrinsic-size: 1px) /* Safari 17+ */ {
|
|
306
|
+
::placeholder {
|
|
307
|
+
color: color-mix(in oklab, currentcolor 50%, transparent);
|
|
308
|
+
}
|
|
307
309
|
}
|
|
308
310
|
|
|
309
311
|
/*
|
|
@@ -402,15 +404,11 @@ function reset(options) {
|
|
|
402
404
|
getCSS: ({ generator }) => {
|
|
403
405
|
themeTracking("font", "sans");
|
|
404
406
|
themeTracking("font", "mono");
|
|
405
|
-
themeTracking("
|
|
406
|
-
themeTracking("
|
|
407
|
-
themeTracking("defaults", ["font", "variationSettings"]);
|
|
408
|
-
themeTracking("defaults", ["monoFont", "family"]);
|
|
409
|
-
themeTracking("defaults", ["monoFont", "featureSettings"]);
|
|
410
|
-
themeTracking("defaults", ["monoFont", "variationSettings"]);
|
|
407
|
+
themeTracking("default", ["font", "family"]);
|
|
408
|
+
themeTracking("default", ["monoFont", "family"]);
|
|
411
409
|
return compressCSS(resetCSS, generator.config.envMode === "dev");
|
|
412
410
|
},
|
|
413
|
-
layer:
|
|
411
|
+
layer: "base"
|
|
414
412
|
};
|
|
415
413
|
}
|
|
416
414
|
|
|
@@ -533,8 +531,9 @@ const presetWind4 = definePreset((options = {}) => {
|
|
|
533
531
|
shortcuts,
|
|
534
532
|
theme: theme$1,
|
|
535
533
|
layers: {
|
|
536
|
-
|
|
537
|
-
|
|
534
|
+
properties: -200,
|
|
535
|
+
theme: -150,
|
|
536
|
+
base: -100
|
|
538
537
|
},
|
|
539
538
|
preflights: preflights(options),
|
|
540
539
|
variants: variants(options),
|
package/dist/postprocess.d.mts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PresetWind4Options } from './index.mjs';
|
|
2
2
|
export { postprocessors } from './index.mjs';
|
|
3
3
|
import { Postprocessor } from '@unocss/core';
|
|
4
|
-
import './shared/preset-wind4.
|
|
5
|
-
import './shared/preset-wind4.
|
|
4
|
+
import './shared/preset-wind4.CeNzqhCV.mjs';
|
|
5
|
+
import './shared/preset-wind4.O8irdiHr.mjs';
|
|
6
6
|
import './shortcuts.mjs';
|
|
7
|
-
import './shared/preset-wind4.
|
|
7
|
+
import './shared/preset-wind4.Hki3f6hz.mjs';
|
|
8
8
|
|
|
9
9
|
declare function important({ important: option }: PresetWind4Options): Postprocessor[];
|
|
10
10
|
|
package/dist/postprocess.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PresetWind4Options } from './index.js';
|
|
2
2
|
export { postprocessors } from './index.js';
|
|
3
3
|
import { Postprocessor } from '@unocss/core';
|
|
4
|
-
import './shared/preset-wind4.
|
|
5
|
-
import './shared/preset-wind4.
|
|
4
|
+
import './shared/preset-wind4.CeNzqhCV.js';
|
|
5
|
+
import './shared/preset-wind4.oLaz9HAb.js';
|
|
6
6
|
import './shortcuts.js';
|
|
7
|
-
import './shared/preset-wind4.
|
|
7
|
+
import './shared/preset-wind4.Hki3f6hz.js';
|
|
8
8
|
|
|
9
9
|
declare function important({ important: option }: PresetWind4Options): Postprocessor[];
|
|
10
10
|
|
package/dist/postprocess.mjs
CHANGED
|
@@ -10,6 +10,8 @@ function important({ important: option }) {
|
|
|
10
10
|
};
|
|
11
11
|
return [
|
|
12
12
|
option === true ? (util) => {
|
|
13
|
+
if (util.layer === "properties")
|
|
14
|
+
return;
|
|
13
15
|
util.entries.forEach((i) => {
|
|
14
16
|
if (i[1] != null && !String(i[1]).endsWith("!important"))
|
|
15
17
|
i[1] += " !important";
|
package/dist/rules.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Rule, CSSEntries, Shortcut, StaticRule, CSSValueInput } from '@unocss/core';
|
|
2
|
-
import { T as Theme } from './shared/preset-wind4.
|
|
3
|
-
export { r as rules } from './shared/preset-wind4.
|
|
2
|
+
import { T as Theme } from './shared/preset-wind4.CeNzqhCV.mjs';
|
|
3
|
+
export { r as rules } from './shared/preset-wind4.O8irdiHr.mjs';
|
|
4
4
|
|
|
5
5
|
declare const verticalAligns: Rule<Theme>[];
|
|
6
6
|
declare const textAligns: Rule<Theme>[];
|
package/dist/rules.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Rule, CSSEntries, Shortcut, StaticRule, CSSValueInput } from '@unocss/core';
|
|
2
|
-
import { T as Theme } from './shared/preset-wind4.
|
|
3
|
-
export { r as rules } from './shared/preset-wind4.
|
|
2
|
+
import { T as Theme } from './shared/preset-wind4.CeNzqhCV.js';
|
|
3
|
+
export { r as rules } from './shared/preset-wind4.oLaz9HAb.js';
|
|
4
4
|
|
|
5
5
|
declare const verticalAligns: Rule<Theme>[];
|
|
6
6
|
declare const textAligns: Rule<Theme>[];
|
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, aC as cssProperty, aB as cssVariables, $ as cursors, Z as displays, u as divides, al as dynamicViewportHeight, an as fieldSizing, x as filters, y as flex, J as flexGridJustifiesAlignments, L as floats, ac as fontSmoothings, ab as fontStyles, az as fontVariantNumeric, au 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, aA as splitShorthand, ao as svgUtilities, av as tabSizes, ap as tables, t as textAligns, q as textDecorations, aw as textIndents, a9 as textOverflows, ay as textShadows, ax as textStrokes, aa as textTransforms, a8 as textWraps, aq as touchActions, ar as transformBase, as as transforms, at as transitions, a3 as userSelects, v as verticalAligns, aD 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, aC as cssProperty, aB as cssVariables, $ as cursors, Z as displays, u as divides, al as dynamicViewportHeight, an as fieldSizing, x as filters, y as flex, J as flexGridJustifiesAlignments, L as floats, ac as fontSmoothings, ab as fontStyles, az as fontVariantNumeric, au 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, aA as splitShorthand, ao as svgUtilities, av as tabSizes, ap as tables, t as textAligns, q as textDecorations, aw as textIndents, a9 as textOverflows, ay as textShadows, ax as textStrokes, aa as textTransforms, a8 as textWraps, aq as touchActions, ar as transformBase, as as transforms, at as transitions, a3 as userSelects, v as verticalAligns, aD as viewTransition, a4 as whitespaces, w as willChange, ae as writingModes, af as writingOrientations, M as zIndexes } from './shared/preset-wind4.BicXgfCi.mjs';
|
|
2
|
+
export { a as container, c as containerParent, b as containerShortcuts } from './shared/preset-wind4.BAz4i9y9.mjs';
|
|
3
|
+
import './shared/preset-wind4.D7fOjUVe.mjs';
|
|
4
4
|
import '@unocss/core';
|
|
5
5
|
import '@unocss/rule-utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { variantGetParameter, variantMatcher, variantGetBracket, variantParentMatcher, getBracket, hasThemeFn, transformThemeFn, getStringComponent } from '@unocss/rule-utils';
|
|
2
|
-
import { b as h, r as resolveBreakpoints, C as CONTROL_NO_NEGATIVE, f as cssMathFnRE, j as cssVarFnRE, B as hasParseableColor } from './preset-wind4.
|
|
1
|
+
import { variantGetParameter, calcMaxWidthBySize, variantMatcher, variantGetBracket, variantParentMatcher, getBracket, hasThemeFn, transformThemeFn, getStringComponent } from '@unocss/rule-utils';
|
|
2
|
+
import { b as h, r as resolveBreakpoints, C as CONTROL_NO_NEGATIVE, f as cssMathFnRE, j as cssVarFnRE, B as hasParseableColor } from './preset-wind4.D7fOjUVe.mjs';
|
|
3
3
|
import { toArray, escapeRegExp, escapeSelector } from '@unocss/core';
|
|
4
4
|
|
|
5
5
|
const variantAria = {
|
|
@@ -44,15 +44,6 @@ const variantTaggedAriaAttributes = [
|
|
|
44
44
|
taggedAria("previous")
|
|
45
45
|
];
|
|
46
46
|
|
|
47
|
-
function calcMaxWidthBySize(size) {
|
|
48
|
-
const value = size.match(/^-?\d+\.?\d*/)?.[0] || "";
|
|
49
|
-
const unit = size.slice(value.length);
|
|
50
|
-
if (unit === "px") {
|
|
51
|
-
const maxWidth = Number.parseFloat(value) - 0.1;
|
|
52
|
-
return Number.isNaN(maxWidth) ? size : `${maxWidth}${unit}`;
|
|
53
|
-
}
|
|
54
|
-
return `calc(${size} - 0.1px)`;
|
|
55
|
-
}
|
|
56
47
|
const sizePseudo = /(max|min)-\[([^\]]*)\]:/;
|
|
57
48
|
function variantBreakpoints() {
|
|
58
49
|
const regexCache = {};
|
|
@@ -953,4 +944,4 @@ function variants(options) {
|
|
|
953
944
|
].flat();
|
|
954
945
|
}
|
|
955
946
|
|
|
956
|
-
export {
|
|
947
|
+
export { variantVariables as A, variantTheme as B, variantStickyHover as C, variantNegative as D, placeholderModifier as E, variantPseudoClassesAndElements as F, variantPseudoClassFunctions as G, variantTaggedPseudoClasses as H, variantPartClasses as I, variantStartingStyle as J, variantSupports as K, variantTaggedAriaAttributes as a, variantBreakpoints as b, variantChildren as c, variantCombinators as d, variantSvgCombinators as e, variantContainerQuery as f, variantColorsMediaOrClass as g, variantColorsScheme as h, variantDataAttribute as i, variantTaggedDataAttributes as j, variants as k, variantLanguageDirections as l, variantImportant as m, variantNoscript as n, variantScripting as o, variantPrint as p, variantCustomMedia as q, variantContrasts as r, variantMotions as s, variantOrientations as t, variantForcedColors as u, variantAria as v, variantSelector as w, variantCssLayer as x, variantInternalLayer as y, variantScope as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isString } from '@unocss/core';
|
|
2
|
-
import { r as resolveBreakpoints } from './preset-wind4.
|
|
2
|
+
import { r as resolveBreakpoints } from './preset-wind4.D7fOjUVe.mjs';
|
|
3
3
|
|
|
4
4
|
const containerParent = [
|
|
5
5
|
[/^@container(?:\/(\w+))?(?:-(normal))?$/, ([, l, v]) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { g as globalKeywords, b as h, E as makeGlobalStaticRules, p as positionMap, q as parseColor, S as SpecialColorKey, l as generateThemeVariable, F as defineProperty, k as themeTracking, m as detectThemeValue, z as colorResolver, G as isCSSMathFn, d as directionMap, B as hasParseableColor, c as cornerMap, y as colorCSSGenerator, H as isSize, o as directionSize, n as numberResolver, A as colorableShadows, i as insetMap, J as hyphenate, r as resolveBreakpoints, C as CONTROL_NO_NEGATIVE, x as xyzMap, L as splitComma, e as xyzArray, M as bracketTypeRe } from './preset-wind4.
|
|
1
|
+
import { g as globalKeywords, b as h, E as makeGlobalStaticRules, p as positionMap, q as parseColor, S as SpecialColorKey, l as generateThemeVariable, F as defineProperty, k as themeTracking, m as detectThemeValue, z as colorResolver, G as isCSSMathFn, d as directionMap, B as hasParseableColor, c as cornerMap, y as colorCSSGenerator, H as isSize, o as directionSize, n as numberResolver, A as colorableShadows, i as insetMap, J as hyphenate, r as resolveBreakpoints, C as CONTROL_NO_NEGATIVE, x as xyzMap, L as splitComma, e as xyzArray, M as bracketTypeRe } from './preset-wind4.D7fOjUVe.mjs';
|
|
2
2
|
import { notNull } from '@unocss/core';
|
|
3
|
-
import { a as container, c as containerParent } from './preset-wind4.
|
|
3
|
+
import { a as container, c as containerParent } from './preset-wind4.BAz4i9y9.mjs';
|
|
4
4
|
import { getStringComponent } from '@unocss/rule-utils';
|
|
5
5
|
|
|
6
6
|
const verticalAlignAlias = {
|
|
@@ -21,8 +21,8 @@ const verticalAlignAlias = {
|
|
|
21
21
|
};
|
|
22
22
|
const verticalAligns = [
|
|
23
23
|
[
|
|
24
|
-
/^(?:vertical|align|v)-(
|
|
25
|
-
([, v]) => ({ "vertical-align": verticalAlignAlias[v] ?? h.numberWithUnit(v) }),
|
|
24
|
+
/^(?:vertical|align|v)-(.+)$/,
|
|
25
|
+
([, v]) => ({ "vertical-align": verticalAlignAlias[v] ?? h.bracket.cssvar.numberWithUnit(v) }),
|
|
26
26
|
{
|
|
27
27
|
autocomplete: [
|
|
28
28
|
`(vertical|align|v)-(${Object.keys(verticalAlignAlias).join("|")})`,
|
|
@@ -294,6 +294,7 @@ const outline = [
|
|
|
294
294
|
"outline-offset": `2px`
|
|
295
295
|
};
|
|
296
296
|
}],
|
|
297
|
+
["outline-none", { "--un-outline-style": "none", "outline-style": "none" }],
|
|
297
298
|
...["auto", "dashed", "dotted", "double", "solid", "groove", "ridge", "inset", "outset", ...globalKeywords].map((v) => [`outline-${v}`, { "--un-outline-style": v, "outline-style": v }])
|
|
298
299
|
];
|
|
299
300
|
function* handleWidth$2([, b]) {
|
|
@@ -1326,21 +1327,27 @@ function getPropName(minmax, hw) {
|
|
|
1326
1327
|
}
|
|
1327
1328
|
function getSizeValue(theme, hw, prop) {
|
|
1328
1329
|
let v;
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
case "fit":
|
|
1335
|
-
case "max":
|
|
1336
|
-
case "min":
|
|
1337
|
-
v = `${prop}-content`;
|
|
1338
|
-
break;
|
|
1339
|
-
case "screen":
|
|
1340
|
-
v = hw === "w" ? "100vw" : "100vh";
|
|
1330
|
+
const keys = ["container", "spacing"];
|
|
1331
|
+
for (const key of keys) {
|
|
1332
|
+
if (theme[key]?.[prop]) {
|
|
1333
|
+
themeTracking(key, prop);
|
|
1334
|
+
v = generateThemeVariable(key, prop);
|
|
1341
1335
|
break;
|
|
1336
|
+
}
|
|
1342
1337
|
}
|
|
1343
|
-
if (
|
|
1338
|
+
if (!v) {
|
|
1339
|
+
switch (prop) {
|
|
1340
|
+
case "fit":
|
|
1341
|
+
case "max":
|
|
1342
|
+
case "min":
|
|
1343
|
+
v = `${prop}-content`;
|
|
1344
|
+
break;
|
|
1345
|
+
case "screen":
|
|
1346
|
+
v = hw === "w" ? "100vw" : "100vh";
|
|
1347
|
+
break;
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
if (!v && h.number(prop) != null) {
|
|
1344
1351
|
themeTracking(`spacing`);
|
|
1345
1352
|
v = `calc(var(--spacing) * ${h.number(prop)})`;
|
|
1346
1353
|
}
|
|
@@ -1972,8 +1979,8 @@ const transitions = [
|
|
|
1972
1979
|
[
|
|
1973
1980
|
/^transition(?:-(\D+?))?(?:-(\d+))?$/,
|
|
1974
1981
|
([, prop, d], { theme }) => {
|
|
1975
|
-
themeTracking("
|
|
1976
|
-
themeTracking("
|
|
1982
|
+
themeTracking("default", ["transition", "timingFunction"]);
|
|
1983
|
+
themeTracking("default", ["transition", "duration"]);
|
|
1977
1984
|
const defaultTransition = {
|
|
1978
1985
|
"transition-property": theme.property?.DEFAULT,
|
|
1979
1986
|
"transition-timing-function": `var(--un-ease, ${generateThemeVariable("defaults", ["transition", "timingFunction"])})`,
|
|
@@ -2067,14 +2074,14 @@ const fonts = [
|
|
|
2067
2074
|
[/^(?:text|color|c)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-text-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "(text|color|c)-(op|opacity)-<percent>" }],
|
|
2068
2075
|
// weights
|
|
2069
2076
|
[
|
|
2070
|
-
/^
|
|
2077
|
+
/^fw-?([^-]+)$/,
|
|
2071
2078
|
([, s], { theme }) => {
|
|
2072
2079
|
let v;
|
|
2073
2080
|
if (theme.fontWeight?.[s]) {
|
|
2074
2081
|
themeTracking(`fontWeight`, s);
|
|
2075
2082
|
v = generateThemeVariable("fontWeight", s);
|
|
2076
2083
|
} else {
|
|
2077
|
-
v = h.bracket.global.number(s);
|
|
2084
|
+
v = h.bracket.cssvar.global.number(s);
|
|
2078
2085
|
}
|
|
2079
2086
|
return {
|
|
2080
2087
|
"--un-font-weight": v,
|
|
@@ -2165,22 +2172,46 @@ const fonts = [
|
|
|
2165
2172
|
([, s]) => ({ "font-stretch": h.bracket.cssvar.fraction.global(s) }),
|
|
2166
2173
|
{ autocomplete: "font-stretch-<percentage>" }
|
|
2167
2174
|
],
|
|
2168
|
-
// family
|
|
2175
|
+
// family & weight
|
|
2169
2176
|
[
|
|
2170
2177
|
/^font-(.+)$/,
|
|
2171
2178
|
([, d], { theme }) => {
|
|
2172
2179
|
let v;
|
|
2173
2180
|
if (theme.font?.[d]) {
|
|
2174
|
-
themeTracking(
|
|
2181
|
+
themeTracking("font", d);
|
|
2175
2182
|
v = generateThemeVariable("font", d);
|
|
2176
|
-
|
|
2177
|
-
|
|
2183
|
+
return { "font-family": v };
|
|
2184
|
+
}
|
|
2185
|
+
if (theme.fontWeight?.[d]) {
|
|
2186
|
+
themeTracking("fontWeight", d);
|
|
2187
|
+
v = generateThemeVariable("fontWeight", d);
|
|
2188
|
+
return { "--un-font-weight": v, "font-weight": v };
|
|
2189
|
+
}
|
|
2190
|
+
v = h.number(d);
|
|
2191
|
+
if (v != null) {
|
|
2192
|
+
return { "--un-font-weight": v, "font-weight": v };
|
|
2193
|
+
}
|
|
2194
|
+
v = h.bracketOfFamily(d);
|
|
2195
|
+
if (v != null && h.number(v) == null) {
|
|
2196
|
+
v = h.cssvar(v) ?? v;
|
|
2197
|
+
return { "font-family": v };
|
|
2198
|
+
}
|
|
2199
|
+
v = h.bracketOfNumber(d);
|
|
2200
|
+
if (v != null) {
|
|
2201
|
+
v = h.cssvar.number(v);
|
|
2202
|
+
return { "--un-font-weight": v, "font-weight": v };
|
|
2203
|
+
}
|
|
2204
|
+
v = h.bracket(d);
|
|
2205
|
+
if (v != null && h.number(v) != null) {
|
|
2206
|
+
const num = h.number(v);
|
|
2207
|
+
return { "--un-font-weight": num, "font-weight": num };
|
|
2208
|
+
}
|
|
2209
|
+
v = h.bracket.cssvar.global(d);
|
|
2210
|
+
if (v != null) {
|
|
2211
|
+
return { "font-family": v };
|
|
2178
2212
|
}
|
|
2179
|
-
return {
|
|
2180
|
-
"font-family": v
|
|
2181
|
-
};
|
|
2182
2213
|
},
|
|
2183
|
-
{ autocomplete: "font-$font" }
|
|
2214
|
+
{ autocomplete: ["font-$font", "font-$fontWeight"] }
|
|
2184
2215
|
]
|
|
2185
2216
|
];
|
|
2186
2217
|
const tabSizes = [
|
|
@@ -2196,7 +2227,7 @@ const tabSizes = [
|
|
|
2196
2227
|
}]
|
|
2197
2228
|
];
|
|
2198
2229
|
const textIndents = [
|
|
2199
|
-
[/^indent(
|
|
2230
|
+
[/^indent-(.+)$/, ([, s]) => {
|
|
2200
2231
|
let v = numberResolver(s);
|
|
2201
2232
|
if (v != null) {
|
|
2202
2233
|
themeTracking(`spacing`);
|
|
@@ -37,7 +37,7 @@ interface Theme {
|
|
|
37
37
|
perspective?: Record<string, string>;
|
|
38
38
|
textStrokeWidth?: Record<string, string>;
|
|
39
39
|
property?: Record<string, string>;
|
|
40
|
-
|
|
40
|
+
default?: Record<string, Record<string, string>>;
|
|
41
41
|
animation?: ThemeAnimation;
|
|
42
42
|
duration?: Record<string, string>;
|
|
43
43
|
containers?: {
|
|
@@ -37,7 +37,7 @@ interface Theme {
|
|
|
37
37
|
perspective?: Record<string, string>;
|
|
38
38
|
textStrokeWidth?: Record<string, string>;
|
|
39
39
|
property?: Record<string, string>;
|
|
40
|
-
|
|
40
|
+
default?: Record<string, Record<string, string>>;
|
|
41
41
|
animation?: ThemeAnimation;
|
|
42
42
|
duration?: Record<string, string>;
|
|
43
43
|
containers?: {
|
|
@@ -135,7 +135,7 @@ const unitOnlyMap = {
|
|
|
135
135
|
lvh: 100,
|
|
136
136
|
lvw: 100
|
|
137
137
|
};
|
|
138
|
-
const bracketTypeRe = /^\[(color|image|length|size|position|quoted|string):/i;
|
|
138
|
+
const bracketTypeRe = /^\[(color|image|length|size|position|quoted|string|number|family):/i;
|
|
139
139
|
const splitComma = /,(?![^()]*\))/g;
|
|
140
140
|
const remRE = /(-?[.\d]+)rem/g;
|
|
141
141
|
|
|
@@ -279,16 +279,21 @@ function bracketWithType(str, requiredType) {
|
|
|
279
279
|
if (!match) {
|
|
280
280
|
base = str.slice(1, -1);
|
|
281
281
|
} else {
|
|
282
|
-
if (!requiredType)
|
|
282
|
+
if (!requiredType) {
|
|
283
283
|
hintedType = match[1];
|
|
284
|
+
} else if (match[1] !== requiredType) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
284
287
|
base = str.slice(match[0].length, -1);
|
|
285
288
|
}
|
|
286
289
|
if (!base)
|
|
287
290
|
return;
|
|
288
291
|
if (base === '=""')
|
|
289
292
|
return;
|
|
290
|
-
if (base.startsWith("--"))
|
|
291
|
-
|
|
293
|
+
if (base.startsWith("--")) {
|
|
294
|
+
const [name, defaultValue] = base.slice(2).split(",");
|
|
295
|
+
base = `var(--${escapeSelector(name)}${defaultValue ? `, ${defaultValue}` : ""})`;
|
|
296
|
+
}
|
|
292
297
|
let curly = 0;
|
|
293
298
|
for (const i of base) {
|
|
294
299
|
if (i === "[") {
|
|
@@ -323,14 +328,23 @@ function bracketOfColor(str) {
|
|
|
323
328
|
return bracketWithType(str, "color");
|
|
324
329
|
}
|
|
325
330
|
function bracketOfLength(str) {
|
|
326
|
-
return bracketWithType(str, "length");
|
|
331
|
+
return bracketWithType(str, "length") || bracketWithType(str, "size");
|
|
327
332
|
}
|
|
328
333
|
function bracketOfPosition(str) {
|
|
329
334
|
return bracketWithType(str, "position");
|
|
330
335
|
}
|
|
336
|
+
function bracketOfFamily(str) {
|
|
337
|
+
return bracketWithType(str, "family");
|
|
338
|
+
}
|
|
339
|
+
function bracketOfNumber(str) {
|
|
340
|
+
return bracketWithType(str, "number");
|
|
341
|
+
}
|
|
331
342
|
function cssvar(str) {
|
|
332
|
-
if (
|
|
333
|
-
|
|
343
|
+
if (str.startsWith("var("))
|
|
344
|
+
return str;
|
|
345
|
+
const match = str.match(/^(?:\$|--)([^\s'"`;{}]+)$/);
|
|
346
|
+
if (match) {
|
|
347
|
+
const [name, defaultValue] = match[1].split(",");
|
|
334
348
|
return `var(--${escapeSelector(name)}${defaultValue ? `, ${defaultValue}` : ""})`;
|
|
335
349
|
}
|
|
336
350
|
}
|
|
@@ -380,7 +394,9 @@ const valueHandlers = {
|
|
|
380
394
|
auto: auto,
|
|
381
395
|
bracket: bracket,
|
|
382
396
|
bracketOfColor: bracketOfColor,
|
|
397
|
+
bracketOfFamily: bracketOfFamily,
|
|
383
398
|
bracketOfLength: bracketOfLength,
|
|
399
|
+
bracketOfNumber: bracketOfNumber,
|
|
384
400
|
bracketOfPosition: bracketOfPosition,
|
|
385
401
|
cssvar: cssvar,
|
|
386
402
|
degree: degree,
|
|
@@ -421,7 +437,7 @@ function directionSize(propertyPrefix) {
|
|
|
421
437
|
}
|
|
422
438
|
return [void 0, void 0];
|
|
423
439
|
}
|
|
424
|
-
function
|
|
440
|
+
function resolveSpace(theme) {
|
|
425
441
|
let base;
|
|
426
442
|
let unit;
|
|
427
443
|
if (theme.spacing?.DEFAULT) {
|
|
@@ -442,24 +458,26 @@ function directionSize(propertyPrefix) {
|
|
|
442
458
|
}, {});
|
|
443
459
|
}
|
|
444
460
|
return ([_, direction, size], { theme }) => {
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
if (
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
461
|
+
if (size != null && direction != null) {
|
|
462
|
+
const spaceMap = resolveSpace(theme);
|
|
463
|
+
let v;
|
|
464
|
+
const isNegative = size.startsWith("-");
|
|
465
|
+
if (isNegative)
|
|
466
|
+
size = size.slice(1);
|
|
467
|
+
v = numberResolver(size, spaceMap[size]);
|
|
468
|
+
if (v != null) {
|
|
469
|
+
if (!Number.isNaN(v)) {
|
|
470
|
+
themeTracking("spacing");
|
|
471
|
+
return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, `calc(var(--spacing) * ${isNegative ? "-" : ""}${v})`]);
|
|
472
|
+
} else {
|
|
473
|
+
themeTracking("spacing", size);
|
|
474
|
+
return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, isNegative ? `calc(var(--spacing-${size} * -1)` : `var(--spacing-${size})`]);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
v = h.bracket.cssvar.global.auto.fraction.rem(isNegative ? `-${size}` : size);
|
|
478
|
+
if (v != null) {
|
|
479
|
+
return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]);
|
|
458
480
|
}
|
|
459
|
-
}
|
|
460
|
-
v = h.bracket.cssvar.global.auto.fraction.rem(isNegative ? `-${size}` : size);
|
|
461
|
-
if (v != null) {
|
|
462
|
-
return directionMap[direction].map((i) => [`${propertyPrefix}${i}`, v]);
|
|
463
481
|
}
|
|
464
482
|
};
|
|
465
483
|
}
|
|
@@ -653,7 +671,7 @@ function defineProperty(property, options = {}) {
|
|
|
653
671
|
[symbols.variants]: () => [
|
|
654
672
|
{
|
|
655
673
|
parent: "",
|
|
656
|
-
layer: "
|
|
674
|
+
layer: "properties",
|
|
657
675
|
selector: () => `@property ${property}`
|
|
658
676
|
}
|
|
659
677
|
],
|
package/dist/shortcuts.d.mts
CHANGED
package/dist/shortcuts.d.ts
CHANGED
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.CKtLkvUz.mjs';
|
|
2
|
+
import './shared/preset-wind4.BAz4i9y9.mjs';
|
|
3
3
|
import '@unocss/core';
|
|
4
|
-
import './shared/preset-wind4.
|
|
4
|
+
import './shared/preset-wind4.D7fOjUVe.mjs';
|
|
5
5
|
import '@unocss/rule-utils';
|
package/dist/theme.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { colors } from './colors.mjs';
|
|
2
|
-
export { t as theme } from './shared/preset-wind4.
|
|
3
|
-
import { T as Theme } from './shared/preset-wind4.
|
|
4
|
-
export { C as Colors, a as ThemeAnimation } from './shared/preset-wind4.
|
|
2
|
+
export { t as theme } from './shared/preset-wind4.Hki3f6hz.mjs';
|
|
3
|
+
import { T as Theme } from './shared/preset-wind4.CeNzqhCV.mjs';
|
|
4
|
+
export { C as Colors, a as ThemeAnimation } from './shared/preset-wind4.CeNzqhCV.mjs';
|
|
5
5
|
|
|
6
6
|
declare const animation: {
|
|
7
7
|
keyframes: {
|
package/dist/theme.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { colors } from './colors.js';
|
|
2
|
-
export { t as theme } from './shared/preset-wind4.
|
|
3
|
-
import { T as Theme } from './shared/preset-wind4.
|
|
4
|
-
export { C as Colors, a as ThemeAnimation } from './shared/preset-wind4.
|
|
2
|
+
export { t as theme } from './shared/preset-wind4.Hki3f6hz.js';
|
|
3
|
+
import { T as Theme } from './shared/preset-wind4.CeNzqhCV.js';
|
|
4
|
+
export { C as Colors, a as ThemeAnimation } from './shared/preset-wind4.CeNzqhCV.js';
|
|
5
5
|
|
|
6
6
|
declare const animation: {
|
|
7
7
|
keyframes: {
|