@unocss/preset-wind 0.26.0 → 0.26.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/index.cjs CHANGED
@@ -28,8 +28,8 @@ ${constructCSS(Object.assign({ animation: `${name} ${duration} ${timing} infinit
28
28
  return { animation: utils.handler.bracket.cssvar(name) };
29
29
  }],
30
30
  [/^animate-name-(.+)/, ([, d]) => ({ "animation-name": utils.handler.bracket.cssvar(d) ?? d })],
31
- [/^animate-duration-(.+)$/, ([, d]) => ({ "animation-duration": utils.handler.bracket.cssvar.time(d) })],
32
- [/^animate-delay-(.+)$/, ([, d]) => ({ "animation-delay": utils.handler.bracket.cssvar.time(d) })],
31
+ [/^animate-duration-(.+)$/, ([, d], { theme }) => ({ "animation-duration": theme.duration?.[d || "DEFAULT"] ?? utils.handler.bracket.cssvar.time(d) })],
32
+ [/^animate-delay-(.+)$/, ([, d], { theme }) => ({ "animation-delay": theme.duration?.[d || "DEFAULT"] ?? utils.handler.bracket.cssvar.time(d) })],
33
33
  [/^animate-ease(?:-(.+))?$/, ([, d], { theme }) => ({ "animation-timing-function": theme.easing?.[d || "DEFAULT"] ?? utils.handler.bracket.cssvar(d) })],
34
34
  [/^animate-(?:fill-|mode-|fill-mode-)?(none|forwards|backwards|both|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-fill-mode": d })],
35
35
  [/^animate-(?:direction-)?(normal|reverse|alternate|alternate-reverse|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-direction": d })],
@@ -347,8 +347,8 @@ const spaces = [
347
347
  [/^space-(block|inline)-(-?.+)$/, handlerSpace],
348
348
  [/^space-(block|inline)-reverse$/, ([, d]) => ({ [`--un-space-${d}-reverse`]: 1 })]
349
349
  ];
350
- function handlerSpace([, d, s = "1"]) {
351
- const v = utils.handler.bracket.cssvar.auto.fraction.rem(s);
350
+ function handlerSpace([, d, s], { theme }) {
351
+ const v = theme.spacing?.[s || "DEFAULT"] ?? utils.handler.bracket.cssvar.auto.fraction.rem(s || "1");
352
352
  if (v != null) {
353
353
  const results = utils.directionMap[d].map((item) => {
354
354
  const key = `margin${item}`;
@@ -426,6 +426,16 @@ const screenReadersAccess = [
426
426
  }
427
427
  ]
428
428
  ];
429
+ const contents = [
430
+ [/^content-(.+)$/, ([, v]) => {
431
+ const c = utils.handler.bracket.cssvar(v);
432
+ if (c != null)
433
+ return { content: c };
434
+ return { content: `"${v}"` };
435
+ }],
436
+ ["content-empty", { content: '""' }],
437
+ ["content-none", { content: '""' }]
438
+ ];
429
439
  const isolations = [
430
440
  ["isolate", { isolation: "isolate" }],
431
441
  ["isolate-auto", { isolation: "auto" }],
@@ -535,8 +545,8 @@ const divides = [
535
545
  ["divide-double", { "border-style": "double" }],
536
546
  ["divide-none", { "border-style": "none" }]
537
547
  ];
538
- function handlerDivide([, d, s = "1"]) {
539
- const v = utils.handler.bracket.cssvar.px(s);
548
+ function handlerDivide([, d, s], { theme }) {
549
+ const v = theme.lineWidth?.[s || "DEFAULT"] ?? utils.handler.bracket.cssvar.px(s || "1");
540
550
  if (v != null) {
541
551
  const results = utils.directionMap[d].map((item) => {
542
552
  const key = `border${item}-width`;
@@ -743,7 +753,7 @@ const rules = [
743
753
  filters,
744
754
  rules$1.transitions,
745
755
  rules$1.willChange,
746
- rules$1.contents,
756
+ contents,
747
757
  placeholders,
748
758
  rules$1.questionMark
749
759
  ].flat(1);
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { toArray, CONTROL_SHORTCUT_NO_MERGE } from '@unocss/core';
2
2
  import { theme as theme$1 } from '@unocss/preset-mini/theme';
3
3
  export { colors } from '@unocss/preset-mini';
4
- import { varEmpty, cssVariables as cssVariables$1, cssProperty, pointerEvents, appearances, positions, insets, zIndexes, orders, grids, floats, margins, boxSizing, displays, aspectRatio, sizes, flex, transforms, cursors, userSelects, resizes, appearance, placements, alignments, justifies, gaps, overflows, textOverflows, whitespaces, breaks, borders, bgColors, svgUtilities, paddings, textAligns, textIndents, verticalAligns, fonts, fontStyles, textColors, textDecorations, fontSmoothings, tabSizes, textStrokes, textShadows, opacity, boxShadows, outline, rings, transitions, willChange, contents, questionMark } from '@unocss/preset-mini/rules';
4
+ import { varEmpty, cssVariables as cssVariables$1, cssProperty, pointerEvents, appearances, positions, insets, zIndexes, orders, grids, floats, margins, boxSizing, displays, aspectRatio, sizes, flex, transforms, cursors, userSelects, resizes, appearance, placements, alignments, justifies, gaps, overflows, textOverflows, whitespaces, breaks, borders, bgColors, svgUtilities, paddings, textAligns, textIndents, verticalAligns, fonts, fontStyles, textColors, textDecorations, fontSmoothings, tabSizes, textStrokes, textShadows, opacity, boxShadows, outline, rings, transitions, willChange, questionMark } from '@unocss/preset-mini/rules';
5
5
  import { handler, positionMap, parseColor, colorToString, colorResolver, colorableShadows, directionMap, directionSize, variantMatcher, variantParentMatcher, hasParseableColor } from '@unocss/preset-mini/utils';
6
6
  import { variants as variants$1 } from '@unocss/preset-mini/variants';
7
7
 
@@ -24,8 +24,8 @@ ${constructCSS(Object.assign({ animation: `${name} ${duration} ${timing} infinit
24
24
  return { animation: handler.bracket.cssvar(name) };
25
25
  }],
26
26
  [/^animate-name-(.+)/, ([, d]) => ({ "animation-name": handler.bracket.cssvar(d) ?? d })],
27
- [/^animate-duration-(.+)$/, ([, d]) => ({ "animation-duration": handler.bracket.cssvar.time(d) })],
28
- [/^animate-delay-(.+)$/, ([, d]) => ({ "animation-delay": handler.bracket.cssvar.time(d) })],
27
+ [/^animate-duration-(.+)$/, ([, d], { theme }) => ({ "animation-duration": theme.duration?.[d || "DEFAULT"] ?? handler.bracket.cssvar.time(d) })],
28
+ [/^animate-delay-(.+)$/, ([, d], { theme }) => ({ "animation-delay": theme.duration?.[d || "DEFAULT"] ?? handler.bracket.cssvar.time(d) })],
29
29
  [/^animate-ease(?:-(.+))?$/, ([, d], { theme }) => ({ "animation-timing-function": theme.easing?.[d || "DEFAULT"] ?? handler.bracket.cssvar(d) })],
30
30
  [/^animate-(?:fill-|mode-|fill-mode-)?(none|forwards|backwards|both|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-fill-mode": d })],
31
31
  [/^animate-(?:direction-)?(normal|reverse|alternate|alternate-reverse|inherit|initial|revert|unset)$/, ([, d]) => ({ "animation-direction": d })],
@@ -343,8 +343,8 @@ const spaces = [
343
343
  [/^space-(block|inline)-(-?.+)$/, handlerSpace],
344
344
  [/^space-(block|inline)-reverse$/, ([, d]) => ({ [`--un-space-${d}-reverse`]: 1 })]
345
345
  ];
346
- function handlerSpace([, d, s = "1"]) {
347
- const v = handler.bracket.cssvar.auto.fraction.rem(s);
346
+ function handlerSpace([, d, s], { theme }) {
347
+ const v = theme.spacing?.[s || "DEFAULT"] ?? handler.bracket.cssvar.auto.fraction.rem(s || "1");
348
348
  if (v != null) {
349
349
  const results = directionMap[d].map((item) => {
350
350
  const key = `margin${item}`;
@@ -422,6 +422,16 @@ const screenReadersAccess = [
422
422
  }
423
423
  ]
424
424
  ];
425
+ const contents = [
426
+ [/^content-(.+)$/, ([, v]) => {
427
+ const c = handler.bracket.cssvar(v);
428
+ if (c != null)
429
+ return { content: c };
430
+ return { content: `"${v}"` };
431
+ }],
432
+ ["content-empty", { content: '""' }],
433
+ ["content-none", { content: '""' }]
434
+ ];
425
435
  const isolations = [
426
436
  ["isolate", { isolation: "isolate" }],
427
437
  ["isolate-auto", { isolation: "auto" }],
@@ -531,8 +541,8 @@ const divides = [
531
541
  ["divide-double", { "border-style": "double" }],
532
542
  ["divide-none", { "border-style": "none" }]
533
543
  ];
534
- function handlerDivide([, d, s = "1"]) {
535
- const v = handler.bracket.cssvar.px(s);
544
+ function handlerDivide([, d, s], { theme }) {
545
+ const v = theme.lineWidth?.[s || "DEFAULT"] ?? handler.bracket.cssvar.px(s || "1");
536
546
  if (v != null) {
537
547
  const results = directionMap[d].map((item) => {
538
548
  const key = `border${item}-width`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-wind",
3
- "version": "0.26.0",
3
+ "version": "0.26.3",
4
4
  "description": "Tailwind / Windi CSS compact preset for UnoCSS",
5
5
  "keywords": [
6
6
  "unocss",
@@ -35,8 +35,8 @@
35
35
  "*.css"
36
36
  ],
37
37
  "dependencies": {
38
- "@unocss/core": "0.26.0",
39
- "@unocss/preset-mini": "0.26.0"
38
+ "@unocss/core": "0.26.3",
39
+ "@unocss/preset-mini": "0.26.3"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "unbuild",