@unocss/preset-wind4 66.1.1 → 66.1.2

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.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import { LAYER_PREFLIGHTS, 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.BSPYtMpU.mjs';
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.DLkbGy_k.mjs';
4
4
  import { alphaPlaceholdersRE } from '@unocss/rule-utils';
5
5
  import { postprocessors } from './postprocess.mjs';
6
- import { l as variants } from './shared/preset-wind4.CGMrICl7.mjs';
6
+ import { l as variants } from './shared/preset-wind4.ZZA6r7w6.mjs';
7
7
  import { theme as theme$1 } from './theme.mjs';
8
- import { s as shortcuts } from './shared/preset-wind4.Uw8htZyZ.mjs';
9
- import { r as rules } from './shared/preset-wind4.BCxYi0D-.mjs';
8
+ import { s as shortcuts } from './shared/preset-wind4.BTkJgmuQ.mjs';
9
+ import { r as rules } from './shared/preset-wind4.CupdUNh8.mjs';
10
10
  import './colors.mjs';
11
- import './shared/preset-wind4.D4JS3Plq.mjs';
11
+ import './shared/preset-wind4.D2A57N1S.mjs';
12
12
 
13
13
  const resetCSS = `
14
14
  /*
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.BCxYi0D-.mjs';
2
- export { a as container, c as containerParent, b as containerShortcuts } from './shared/preset-wind4.D4JS3Plq.mjs';
3
- import './shared/preset-wind4.BSPYtMpU.mjs';
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.CupdUNh8.mjs';
2
+ export { a as container, c as containerParent, b as containerShortcuts } from './shared/preset-wind4.D2A57N1S.mjs';
3
+ import './shared/preset-wind4.DLkbGy_k.mjs';
4
4
  import '@unocss/core';
5
5
  import '@unocss/rule-utils';
@@ -1,4 +1,4 @@
1
- import { b as containerShortcuts } from './preset-wind4.D4JS3Plq.mjs';
1
+ import { b as containerShortcuts } from './preset-wind4.D2A57N1S.mjs';
2
2
 
3
3
  const shortcuts = [
4
4
  ...containerShortcuts
@@ -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.BSPYtMpU.mjs';
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.DLkbGy_k.mjs';
2
2
  import { notNull } from '@unocss/core';
3
- import { a as container, c as containerParent } from './preset-wind4.D4JS3Plq.mjs';
3
+ import { a as container, c as containerParent } from './preset-wind4.D2A57N1S.mjs';
4
4
  import { getStringComponent } from '@unocss/rule-utils';
5
5
 
6
6
  const verticalAlignAlias = {
@@ -274,13 +274,17 @@ const outline = [
274
274
  [/^outline-(?:width-|size-)?(.+)$/, handleWidth$2, { autocomplete: "outline-(width|size)-<num>" }],
275
275
  // color
276
276
  [/^outline-(?:color-)?(.+)$/, handleColorOrWidth$2, { autocomplete: "outline-$colors" }],
277
+ [/^outline-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-outline-opacity": h.bracket.percent.cssvar(opacity) }), { autocomplete: "outline-(op|opacity)-<percent>" }],
277
278
  // offset
278
279
  [/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": h.bracket.cssvar.global.px(d) }), { autocomplete: "outline-(offset)-<num>" }],
279
280
  ["outline-offset-none", { "outline-offset": "0" }],
280
281
  // style
281
- ["outline", {
282
- "outline-style": "var(--un-outline-style)",
283
- "outline-width": "1px"
282
+ [/^outline$/, function* () {
283
+ yield {
284
+ "outline-style": "var(--un-outline-style)",
285
+ "outline-width": "1px"
286
+ };
287
+ yield defineProperty("--un-outline-style", { initialValue: "solid" });
284
288
  }],
285
289
  [/^outline-hidden$/, function* (_, { symbols }) {
286
290
  yield { "outline-style": "none" };
@@ -292,19 +296,27 @@ const outline = [
292
296
  }],
293
297
  ...["auto", "dashed", "dotted", "double", "solid", "groove", "ridge", "inset", "outset", ...globalKeywords].map((v) => [`outline-${v}`, { "--un-outline-style": v, "outline-style": v }])
294
298
  ];
295
- function handleWidth$2([, b]) {
299
+ function* handleWidth$2([, b]) {
296
300
  const v = h.bracket.cssvar.global.px(b);
297
301
  if (v != null) {
298
- return {
302
+ yield {
299
303
  "outline-style": "var(--un-outline-style)",
300
304
  "outline-width": v
301
305
  };
306
+ yield defineProperty("--un-outline-style", { initialValue: "solid" });
302
307
  }
303
308
  }
304
- function handleColorOrWidth$2(match, ctx) {
305
- if (isCSSMathFn(h.bracket(match[1])))
306
- return handleWidth$2(match);
307
- return colorResolver("outline-color", "outline-color")(match, ctx);
309
+ function* handleColorOrWidth$2(match, ctx) {
310
+ if (isCSSMathFn(h.bracket(match[1]))) {
311
+ yield* handleWidth$2(match);
312
+ } else {
313
+ const result = colorResolver("outline-color", "outline")(match, ctx);
314
+ if (result) {
315
+ for (const i of result) {
316
+ yield i;
317
+ }
318
+ }
319
+ }
308
320
  }
309
321
  const appearance = [
310
322
  ["appearance-auto", { "-webkit-appearance": "auto", "appearance": "auto" }],
@@ -1461,13 +1473,18 @@ const contentVisibility = [
1461
1473
  ...makeGlobalStaticRules("content-visibility")
1462
1474
  ];
1463
1475
  const contents = [
1464
- [/^content-(.+)$/, ([, v]) => [
1465
- {
1466
- "--un-content": h.bracket.cssvar(v),
1467
- "content": "var(--un-content)"
1468
- },
1469
- defineProperty("--un-content", { initialValue: '""' })
1470
- ]],
1476
+ [/^content-(.+)$/, ([, v]) => {
1477
+ const _v = h.bracket.cssvar(v);
1478
+ if (_v != null) {
1479
+ return [
1480
+ {
1481
+ "--un-content": h.bracket.cssvar(v),
1482
+ "content": "var(--un-content)"
1483
+ },
1484
+ defineProperty("--un-content", { initialValue: '""' })
1485
+ ];
1486
+ }
1487
+ }],
1471
1488
  ["content-empty", { content: '""' }],
1472
1489
  ["content-none", { content: "none" }]
1473
1490
  ];
@@ -1,5 +1,5 @@
1
1
  import { isString } from '@unocss/core';
2
- import { r as resolveBreakpoints } from './preset-wind4.BSPYtMpU.mjs';
2
+ import { r as resolveBreakpoints } from './preset-wind4.DLkbGy_k.mjs';
3
3
 
4
4
  const containerParent = [
5
5
  [/^@container(?:\/(\w+))?(?:-(normal))?$/, ([, l, v]) => {
@@ -250,12 +250,12 @@ function number(str) {
250
250
  return round(num);
251
251
  }
252
252
  function percent(str) {
253
- if (str.endsWith("%"))
254
- return str;
255
- if (numberRE.test(str)) {
256
- const num = Number.parseFloat(str);
257
- if (!Number.isNaN(num))
258
- return `${round(num)}%`;
253
+ if (str.endsWith("%")) {
254
+ str = str.slice(0, -1);
255
+ }
256
+ const num = number(str);
257
+ if (num != null) {
258
+ return `${num}%`;
259
259
  }
260
260
  }
261
261
  function fraction(str) {
@@ -1,5 +1,5 @@
1
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.BSPYtMpU.mjs';
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.DLkbGy_k.mjs';
3
3
  import { toArray, escapeRegExp, escapeSelector } from '@unocss/core';
4
4
 
5
5
  const variantAria = {
@@ -576,6 +576,7 @@ function hasOpacityValue(body) {
576
576
  return false;
577
577
  }
578
578
 
579
+ const PseudoPlaceholder = "__pseudo_placeholder__";
579
580
  const PseudoClasses = Object.fromEntries([
580
581
  // pseudo elements part 1
581
582
  ["first-letter", "::first-letter"],
@@ -620,6 +621,7 @@ const PseudoClasses = Object.fromEntries([
620
621
  ["even", ":nth-child(even)"],
621
622
  ["odd-of-type", ":nth-of-type(odd)"],
622
623
  ["odd", ":nth-child(odd)"],
624
+ ["nth", `:nth-child(${PseudoPlaceholder})`],
623
625
  "first-of-type",
624
626
  ["first", ":first-child"],
625
627
  "last-of-type",
@@ -751,12 +753,18 @@ function variantPseudoClassesAndElements() {
751
753
  name: "pseudo",
752
754
  match(input, ctx) {
753
755
  if (!(PseudoClassesAndElementsRE && PseudoClassesAndElementsColonRE)) {
754
- PseudoClassesAndElementsRE = new RegExp(`^(${PseudoClassesAndElementsStr})(?:${ctx.generator.config.separators.join("|")})`);
756
+ PseudoClassesAndElementsRE = new RegExp(`^(${PseudoClassesAndElementsStr})(?:-(\\[\\w+\\]))?(?:${ctx.generator.config.separators.join("|")})`);
755
757
  PseudoClassesAndElementsColonRE = new RegExp(`^(${PseudoClassesAndElementsColonStr})(?:${ctx.generator.config.separators.filter((x) => x !== "-").join("|")})`);
756
758
  }
757
759
  const match = input.match(PseudoClassesAndElementsRE) || input.match(PseudoClassesAndElementsColonRE);
758
760
  if (match) {
759
- const pseudo = PseudoClasses[match[1]] || PseudoClassesColon[match[1]] || `:${match[1]}`;
761
+ let pseudo = PseudoClasses[match[1]] || PseudoClassesColon[match[1]] || `:${match[1]}`;
762
+ if (match[2]) {
763
+ const anPlusB = h.bracket(match[2]);
764
+ if (anPlusB) {
765
+ pseudo = pseudo.replace(PseudoPlaceholder, anPlusB);
766
+ }
767
+ }
760
768
  let index = PseudoClassesKeys.indexOf(match[1]);
761
769
  if (index === -1)
762
770
  index = PseudoClassesColonKeys.indexOf(match[1]);
@@ -1,5 +1,5 @@
1
- export { s as shortcuts } from './shared/preset-wind4.Uw8htZyZ.mjs';
2
- import './shared/preset-wind4.D4JS3Plq.mjs';
1
+ export { s as shortcuts } from './shared/preset-wind4.BTkJgmuQ.mjs';
2
+ import './shared/preset-wind4.D2A57N1S.mjs';
3
3
  import '@unocss/core';
4
- import './shared/preset-wind4.BSPYtMpU.mjs';
4
+ import './shared/preset-wind4.DLkbGy_k.mjs';
5
5
  import '@unocss/rule-utils';
package/dist/utils.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { a as remRE } from './shared/preset-wind4.BSPYtMpU.mjs';
2
- export { C as CONTROL_NO_NEGATIVE, P as PRESET_NAME, S as SpecialColorKey, I as camelize, y as colorCSSGenerator, z as colorResolver, A as colorableShadows, K as compressCSS, c as cornerMap, f as cssMathFnRE, j as cssVarFnRE, F as defineProperty, m as detectThemeValue, d as directionMap, o as directionSize, l as generateThemeVariable, w as getThemeByKey, g as globalKeywords, b as h, h as handler, B as hasParseableColor, J as hyphenate, i as insetMap, G as isCSSMathFn, H as isSize, E as makeGlobalStaticRules, n as numberResolver, q as parseColor, u as parseThemeColor, p as positionMap, r as resolveBreakpoints, D as resolveVerticalBreakpoints, s as splitShorthand, k as themeTracking, t as trackedTheme, v as valueHandlers, e as xyzArray, x as xyzMap } from './shared/preset-wind4.BSPYtMpU.mjs';
1
+ import { a as remRE } from './shared/preset-wind4.DLkbGy_k.mjs';
2
+ export { C as CONTROL_NO_NEGATIVE, P as PRESET_NAME, S as SpecialColorKey, I as camelize, y as colorCSSGenerator, z as colorResolver, A as colorableShadows, K as compressCSS, c as cornerMap, f as cssMathFnRE, j as cssVarFnRE, F as defineProperty, m as detectThemeValue, d as directionMap, o as directionSize, l as generateThemeVariable, w as getThemeByKey, g as globalKeywords, b as h, h as handler, B as hasParseableColor, J as hyphenate, i as insetMap, G as isCSSMathFn, H as isSize, E as makeGlobalStaticRules, n as numberResolver, q as parseColor, u as parseThemeColor, p as positionMap, r as resolveBreakpoints, D as resolveVerticalBreakpoints, s as splitShorthand, k as themeTracking, t as trackedTheme, v as valueHandlers, e as xyzArray, x as xyzMap } from './shared/preset-wind4.DLkbGy_k.mjs';
3
3
  export * from '@unocss/rule-utils';
4
4
  import '@unocss/core';
5
5
 
package/dist/variants.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as calcMaxWidthBySize, F as placeholderModifier, v as variantAria, b as variantBreakpoints, d as variantChildren, h as variantColorsMediaOrClass, i as variantColorsScheme, e as variantCombinators, g as variantContainerQuery, s as variantContrasts, y as variantCssLayer, r as variantCustomMedia, j as variantDataAttribute, w as variantForcedColors, n as variantImportant, z as variantInternalLayer, m as variantLanguageDirections, t as variantMotions, E as variantNegative, o as variantNoscript, u as variantOrientations, J as variantPartClasses, q as variantPrint, H as variantPseudoClassFunctions, G as variantPseudoClassesAndElements, A as variantScope, p as variantScripting, x as variantSelector, K as variantStartingStyle, D as variantStickyHover, L as variantSupports, f as variantSvgCombinators, a as variantTaggedAriaAttributes, k as variantTaggedDataAttributes, I as variantTaggedPseudoClasses, C as variantTheme, B as variantVariables, l as variants } from './shared/preset-wind4.CGMrICl7.mjs';
1
+ export { c as calcMaxWidthBySize, F as placeholderModifier, v as variantAria, b as variantBreakpoints, d as variantChildren, h as variantColorsMediaOrClass, i as variantColorsScheme, e as variantCombinators, g as variantContainerQuery, s as variantContrasts, y as variantCssLayer, r as variantCustomMedia, j as variantDataAttribute, w as variantForcedColors, n as variantImportant, z as variantInternalLayer, m as variantLanguageDirections, t as variantMotions, E as variantNegative, o as variantNoscript, u as variantOrientations, J as variantPartClasses, q as variantPrint, H as variantPseudoClassFunctions, G as variantPseudoClassesAndElements, A as variantScope, p as variantScripting, x as variantSelector, K as variantStartingStyle, D as variantStickyHover, L as variantSupports, f as variantSvgCombinators, a as variantTaggedAriaAttributes, k as variantTaggedDataAttributes, I as variantTaggedPseudoClasses, C as variantTheme, B as variantVariables, l as variants } from './shared/preset-wind4.ZZA6r7w6.mjs';
2
2
  import '@unocss/rule-utils';
3
- import './shared/preset-wind4.BSPYtMpU.mjs';
3
+ import './shared/preset-wind4.DLkbGy_k.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.1",
4
+ "version": "66.1.2",
5
5
  "description": "Tailwind 4 compact preset for UnoCSS",
6
6
  "authors": [
7
7
  {
@@ -74,9 +74,9 @@
74
74
  "dist"
75
75
  ],
76
76
  "dependencies": {
77
- "@unocss/core": "66.1.1",
78
- "@unocss/extractor-arbitrary-variants": "66.1.1",
79
- "@unocss/rule-utils": "66.1.1"
77
+ "@unocss/core": "66.1.2",
78
+ "@unocss/extractor-arbitrary-variants": "66.1.2",
79
+ "@unocss/rule-utils": "66.1.2"
80
80
  },
81
81
  "scripts": {
82
82
  "build": "unbuild",