@unocss/preset-wind4 66.7.4-beta.1 → 66.7.5

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 CHANGED
@@ -1,4 +1,4 @@
1
1
  import { C as Theme, E as theme } from "./theme-DFkXSCqq.mjs";
2
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-ZwoWjPej.mjs";
3
- import { bt as rules } from "./rules-UeVNVqAS.mjs";
3
+ import { xt as rules } from "./rules-DRyeJ90q.mjs";
4
4
  export { DarkModeSelectors, PreflightsTheme, PresetWind4Options, type Theme, presetWind4 as default, presetWind4, postprocessors, preflights, rules, shortcuts, shorthands, theme, variants };
@@ -61,6 +61,7 @@ declare const flex: Rule<Theme$1>[];
61
61
  //#endregion
62
62
  //#region src/rules/gap.d.ts
63
63
  declare const gaps: Rule<Theme$1>[];
64
+ declare const gapRules: Rule<Theme$1>[];
64
65
  //#endregion
65
66
  //#region src/rules/grid.d.ts
66
67
  declare const grids: Rule<Theme$1>[];
@@ -204,4 +205,4 @@ declare const cssProperty: Rule<Theme$1>[];
204
205
  //#region src/rules/view-transition.d.ts
205
206
  declare const viewTransition: Rule<Theme$1>[];
206
207
  //#endregion
207
- export { rings as $, hyphens as A, borders as At, userSelects as B, willChange as Bt, contents as C, containerParent as Ct, fieldSizing as D, colorScheme as Dt, dynamicViewportHeight as E, bgColors as Et, resizes as F, imageRenderings as Ft, notLastChildSelectorVariant as G, writingModes as H, animations as Ht, screenReadersAccess as I, listStyle as It, aspectRatio as J, paddings as K, textOverflows as L, outline as Lt, mixBlendModes as M, accents as Mt, objectPositions as N, appearance as Nt, fontSmoothings as O, opacity as Ot, pointerEvents as P, carets as Pt, scrolls as Q, textTransforms as R, overscrolls as Rt, contentVisibility as S, container as St, displays as T, columns as Tt, writingOrientations as U, textAligns as Ut, whitespaces as V, backgroundStyles as Vt, margins as W, verticalAligns as Wt, boxShadows as X, sizes as Y, shadowProperties as Z, accessibility as _, flex as _t, fonts as a, insets as at, breaks as b, rules as bt, textIndents as c, placements as ct, transitions as d, placeholders as dt, questionMark as et, transformBase as f, masks as ft, svgUtilities as g, gaps as gt, tables as h, grids as ht, fontVariantNumeric as i, floats as it, isolations as j, handlerBorderStyle as jt, fontStyles as k, borderStyles as kt, textShadows as l, positions as lt, touchActions as m, overflows as mt, cssProperty as n, boxSizing as nt, splitShorthand as o, justifies as ot, transforms as p, lineClamps as pt, spaces as q, cssVariables as r, flexGridJustifiesAlignments as rt, tabSizes as s, orders as st, viewTransition as t, alignments as tt, textStrokes as u, zIndexes as ut, appearances as v, filters as vt, cursors as w, containerShortcuts as wt, contains as x, textDecorations as xt, backgroundBlendModes as y, divides as yt, textWraps as z, scrollBehaviors as zt };
208
+ export { rings as $, hyphens as A, borderStyles as At, userSelects as B, scrollBehaviors as Bt, contents as C, container as Ct, fieldSizing as D, bgColors as Dt, dynamicViewportHeight as E, columns as Et, resizes as F, carets as Ft, notLastChildSelectorVariant as G, verticalAligns as Gt, writingModes as H, backgroundStyles as Ht, screenReadersAccess as I, imageRenderings as It, aspectRatio as J, paddings as K, textOverflows as L, listStyle as Lt, mixBlendModes as M, handlerBorderStyle as Mt, objectPositions as N, accents as Nt, fontSmoothings as O, colorScheme as Ot, pointerEvents as P, appearance as Pt, scrolls as Q, textTransforms as R, outline as Rt, contentVisibility as S, textDecorations as St, displays as T, containerShortcuts as Tt, writingOrientations as U, animations as Ut, whitespaces as V, willChange as Vt, margins as W, textAligns as Wt, boxShadows as X, sizes as Y, shadowProperties as Z, accessibility as _, gaps as _t, fonts as a, insets as at, breaks as b, divides as bt, textIndents as c, placements as ct, transitions as d, placeholders as dt, questionMark as et, transformBase as f, masks as ft, svgUtilities as g, gapRules as gt, tables as h, grids as ht, fontVariantNumeric as i, floats as it, isolations as j, borders as jt, fontStyles as k, opacity as kt, textShadows as l, positions as lt, touchActions as m, overflows as mt, cssProperty as n, boxSizing as nt, splitShorthand as o, justifies as ot, transforms as p, lineClamps as pt, spaces as q, cssVariables as r, flexGridJustifiesAlignments as rt, tabSizes as s, orders as st, viewTransition as t, alignments as tt, textStrokes as u, zIndexes as ut, appearances as v, flex as vt, cursors as w, containerParent as wt, contains as x, rules as xt, backgroundBlendModes as y, filters as yt, textWraps as z, overscrolls as zt };
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-UeVNVqAS.mjs";
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 };
1
+ import { $ as rings, A as hyphens, At as borderStyles, B as userSelects, Bt as scrollBehaviors, C as contents, Ct as container, D as fieldSizing, Dt as bgColors, E as dynamicViewportHeight, Et as columns, F as resizes, Ft as carets, G as notLastChildSelectorVariant, Gt as verticalAligns, H as writingModes, Ht as backgroundStyles, I as screenReadersAccess, It as imageRenderings, J as aspectRatio, K as paddings, L as textOverflows, Lt as listStyle, M as mixBlendModes, Mt as handlerBorderStyle, N as objectPositions, Nt as accents, O as fontSmoothings, Ot as colorScheme, P as pointerEvents, Pt as appearance, Q as scrolls, R as textTransforms, Rt as outline, S as contentVisibility, St as textDecorations, T as displays, Tt as containerShortcuts, U as writingOrientations, Ut as animations, V as whitespaces, Vt as willChange, W as margins, Wt as textAligns, X as boxShadows, Y as sizes, Z as shadowProperties, _ as accessibility, _t as gaps, a as fonts, at as insets, b as breaks, bt as divides, 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 gapRules, h as tables, ht as grids, i as fontVariantNumeric, it as floats, j as isolations, jt as borders, k as fontStyles, kt as opacity, 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 flex, w as cursors, wt as containerParent, x as contains, xt as rules, y as backgroundBlendModes, yt as filters, z as textWraps, zt as overscrolls } from "./rules-DRyeJ90q.mjs";
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, gapRules, 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 };
package/dist/rules.mjs CHANGED
@@ -1150,23 +1150,148 @@ const directions = {
1150
1150
  "col": ["column-"],
1151
1151
  "row": ["row-"]
1152
1152
  };
1153
- const gaps = [
1153
+ const directionFormatter = (p, i) => `${i}${p}`;
1154
+ const gaps = [[
1155
+ /^(?:flex-|grid-)?gap-?()(.+)$/,
1156
+ directionSize("gap", directions, directionFormatter),
1157
+ { autocomplete: ["gap-$spacing", "gap-<num>"] }
1158
+ ], [
1159
+ /^(?:flex-|grid-)?gap-(col|row|x|y)-?(.+)$/,
1160
+ directionSize("gap", directions, directionFormatter),
1161
+ { autocomplete: ["gap-(col|row|x|y)-$spacing", "gap-(col|row|x|y)-<num>"] }
1162
+ ]];
1163
+ const ruleDirections = {
1164
+ "": "",
1165
+ "x": "row-",
1166
+ "y": "column-",
1167
+ "col": "column-",
1168
+ "row": "row-"
1169
+ };
1170
+ const gapRules = [
1154
1171
  [
1155
- /^(?:flex-|grid-)?gap-?()(.+)$/,
1156
- directionSize("gap", directions, (p, i) => `${i}${p}`),
1157
- { autocomplete: ["gap-$spacing", "gap-<num>"] }
1172
+ /^rule(?:-(x|y|col|row))?-(.+)$/,
1173
+ handlerRule,
1174
+ { autocomplete: [
1175
+ "rule-$spacing",
1176
+ "rule-<num>",
1177
+ "rule-(x|y|col|row)-$spacing",
1178
+ "rule-(x|y|col|row)-<num>"
1179
+ ] }
1158
1180
  ],
1159
1181
  [
1160
- /^(?:flex-|grid-)?gap-([xy])-?(.+)$/,
1161
- directionSize("gap", directions, (p, i) => `${i}${p}`),
1162
- { autocomplete: ["gap-(x|y)-$spacing", "gap-(x|y)-<num>"] }
1182
+ /^rule(?:-(x|y|col|row))?(-width)?-(.+)$/,
1183
+ handlerRuleSize,
1184
+ { autocomplete: [
1185
+ "rule-$spacing",
1186
+ "rule-<num>",
1187
+ "rule-(x|y|col|row)-$spacing",
1188
+ "rule-(x|y|col|row)-<num>"
1189
+ ] }
1163
1190
  ],
1164
1191
  [
1165
- /^(?:flex-|grid-)?gap-(col|row)-?(.+)$/,
1166
- directionSize("gap", directions, (p, i) => `${i}${p}`),
1167
- { autocomplete: ["gap-(col|row)-$spacing", "gap-(col|row)-<num>"] }
1168
- ]
1192
+ /^rule(?:-(x|y|col|row))?(-color)?-(.+)$/,
1193
+ handlerRuleColor,
1194
+ { autocomplete: ["rule-$colors", "rule-(x|y|col|row)-$colors"] }
1195
+ ],
1196
+ [
1197
+ /^rule(?:-(x|y|col|row))?-op(?:acity)?-?(.+)$/,
1198
+ ([, d = "", v]) => ({ [`--un-${ruleDirections[d]}rule-opacity`]: h.bracket.percent(v) }),
1199
+ { autocomplete: ["rule-(op|opacity)-<percent>", "rule-(x|y|col|row)-(op|opacity)-<percent>"] }
1200
+ ],
1201
+ [
1202
+ /^rule(?:-(x|y|col|row))?(?:-style)?-(.+)$/,
1203
+ handlerRuleStyle,
1204
+ { autocomplete: [`rule-style-(${borderStyles.join("|")})`, `rule-(x|y|col|row)-style-(${borderStyles.join(" | ")})`] }
1205
+ ],
1206
+ [
1207
+ /^rule(?:-(x|y|col|row))?-break-(normal|none|intersection)/,
1208
+ ([, d = "", v]) => ({ [`${ruleDirections[d]}rule-break`]: v }),
1209
+ { autocomplete: ["rule-break-(normal|none|intersection)", "rule-(x|y|col|row)-break-(normal|none|intersection)"] }
1210
+ ],
1211
+ [
1212
+ /^rule(?:-(x|y|col|row))?-visibility-(normal|all|none|between|around)$/,
1213
+ ([, d = "", v]) => ({ [`${ruleDirections[d]}rule-visibility-items`]: v }),
1214
+ { autocomplete: ["rule-visibility-(normal|all|none|between)", "rule-(x|y|col|row)-visibility-(normal|all|none|between)"] }
1215
+ ],
1216
+ [
1217
+ /^rule(?:-(x|y|col|row))?-inset(?:-(cap|junction))?(?:-(start|end))?-(.+)$/,
1218
+ ([, d = "", kind, edge, v]) => {
1219
+ const p = ruleDirections[d];
1220
+ const value = h.bracket.cssvar.px(v);
1221
+ if (value != null) return { [[
1222
+ p,
1223
+ "rule",
1224
+ "inset",
1225
+ kind,
1226
+ edge
1227
+ ].filter(Boolean).join("-")]: value };
1228
+ },
1229
+ { autocomplete: [
1230
+ "rule-inset-<num>",
1231
+ "rule-inset-(start|end)-<num>",
1232
+ "rule-inset-(cap|junction)-<num>",
1233
+ "rule-inset-(cap|junction)-(start|end)-<num>",
1234
+ "rule-(x|y|col|row)-inset-<num>",
1235
+ "rule-(x|y|col|row)-inset-(start|end)-<num>",
1236
+ "rule-(x|y|col|row)-inset-(cap|junction)-<num>",
1237
+ "rule-(x|y|col|row)-inset-(cap|junction)-(start|end)-<num>"
1238
+ ] }
1239
+ ],
1240
+ ["rule-overlap-row", { "rule-overlap": "row-over-column" }],
1241
+ ["rule-overlap-column", { "rule-overlap": "column-over-row" }]
1169
1242
  ];
1243
+ function handlerRuleStyle([, a = "", s]) {
1244
+ const property = ruleProperty(a, "style");
1245
+ if (property && borderStyles.includes(s)) return { [property]: s };
1246
+ }
1247
+ function handlerRuleColor([, d = "", colorLabel, v], ctx) {
1248
+ const property = ruleProperty(d, "color");
1249
+ const varName = ruleProperty(d);
1250
+ if (!property || !varName) return;
1251
+ const bracketColor = h.bracket(v);
1252
+ if (!colorLabel && hasRuleCSSVariable(bracketColor ?? v)) return;
1253
+ if (bracketColor == null) return colorResolver(property, varName)(["", v], ctx);
1254
+ const values = splitRuleValues(bracketColor);
1255
+ if (values.every((c) => hasParseableColor(c, ctx.theme))) return { [property]: values.map((c) => parseColor(c, ctx.theme).color).join(",") };
1256
+ }
1257
+ function handlerRuleSize([, d = "", widthLabel, s = "1"], { theme }) {
1258
+ const property = ruleProperty(d, "width");
1259
+ if (!property) return;
1260
+ const v = h.bracket.cssvar.px(s, theme);
1261
+ if (!v) return;
1262
+ const values = splitRuleValues(v).map((s) => h.cssvar.px(s) ?? s);
1263
+ if (!widthLabel && values.some(isRuleCSSVariable)) return;
1264
+ if (values.every((s) => isSize(s) || s.startsWith("var("))) return { [property]: values.join(",") };
1265
+ }
1266
+ function handlerRule([, d = "", v], { theme }) {
1267
+ const property = ruleProperty(d);
1268
+ const value = h.bracket.cssvar(v, theme);
1269
+ const shorthand = value && resolveRuleShorthand(value, theme);
1270
+ if (property && shorthand) return { [property]: shorthand };
1271
+ }
1272
+ function ruleProperty(direction, suffix) {
1273
+ const prefix = ruleDirections[direction];
1274
+ if (prefix == null) return;
1275
+ return `${prefix}rule${suffix ? `-${suffix}` : ""}`;
1276
+ }
1277
+ function splitRuleValues(value) {
1278
+ return value.split(splitComma).map((v) => v.trim());
1279
+ }
1280
+ function isRuleCSSVariable(value) {
1281
+ return h.cssvar(value) != null;
1282
+ }
1283
+ function hasRuleCSSVariable(value) {
1284
+ return splitRuleValues(value).some(isRuleCSSVariable);
1285
+ }
1286
+ function resolveRuleShorthand(value, theme) {
1287
+ const components = getStringComponents(value, " ", 3);
1288
+ if (!components) return;
1289
+ if (!value.startsWith("var(") && !components.some((c) => borderStyles.includes(c))) return;
1290
+ return components.map((c) => {
1291
+ if (hasParseableColor(c, theme)) return parseColor(c, theme).color;
1292
+ return h.cssvar.px(c) ?? c;
1293
+ }).join(" ");
1294
+ }
1170
1295
  //#endregion
1171
1296
  //#region src/rules/grid.ts
1172
1297
  function rowCol(s) {
@@ -3075,7 +3200,8 @@ const rules = [
3075
3200
  spaces,
3076
3201
  divides,
3077
3202
  fieldSizing,
3203
+ gapRules,
3078
3204
  questionMark
3079
3205
  ].flat();
3080
3206
  //#endregion
3081
- 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 };
3207
+ 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, gapRules, 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 };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unocss/preset-wind4",
3
3
  "type": "module",
4
- "version": "66.7.4-beta.1",
4
+ "version": "66.7.5",
5
5
  "description": "Tailwind 4 compact preset for UnoCSS",
6
6
  "authors": [
7
7
  {
@@ -54,9 +54,9 @@
54
54
  "dist"
55
55
  ],
56
56
  "dependencies": {
57
- "@unocss/extractor-arbitrary-variants": "66.7.4-beta.1",
58
- "@unocss/rule-utils": "66.7.4-beta.1",
59
- "@unocss/core": "66.7.4-beta.1"
57
+ "@unocss/core": "66.7.5",
58
+ "@unocss/extractor-arbitrary-variants": "66.7.5",
59
+ "@unocss/rule-utils": "66.7.5"
60
60
  },
61
61
  "scripts": {
62
62
  "build": "tsdown --config-loader unrun",