@unocss/preset-mini 0.22.3 → 0.22.4

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.
@@ -19,9 +19,9 @@ const textAligns = [
19
19
  ];
20
20
 
21
21
  const outline = [
22
- [/^outline-(?:width-|size-)?(.+)$/, ([, d]) => ({ "outline-width": utilities.handler.bracket.cssvar.auto.fraction.rem(d) })],
22
+ [/^outline-(?:width-|size-)?(.+)$/, ([, d]) => ({ "outline-width": utilities.handler.bracket.cssvar.fraction.rem(d) })],
23
23
  [/^outline-(?:color-)?(.+)$/, utilities.colorResolver("outline-color", "outline-color")],
24
- [/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": utilities.handler.bracket.cssvar.auto.fraction.rem(d) })],
24
+ [/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": utilities.handler.bracket.cssvar.fraction.rem(d) })],
25
25
  ["outline", { "outline-style": "solid" }],
26
26
  [/^outline-(auto|dashed|dotted|double|hidden|solid|groove|ridge|inset|outset|inherit|initial|revert|unset)$/, ([, c]) => ({ "outline-style": c })],
27
27
  ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
@@ -135,7 +135,7 @@ function handlerBorderOpacity([, a = "", opacity]) {
135
135
  return utilities.directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
136
136
  }
137
137
  function handlerRounded([, a = "", s = "DEFAULT"], { theme }) {
138
- const v = theme.borderRadius?.[s] || utilities.handler.bracket.cssvar.auto.fraction.rem(s);
138
+ const v = theme.borderRadius?.[s] || utilities.handler.bracket.cssvar.fraction.rem(s);
139
139
  if (a in utilities.cornerMap && v != null)
140
140
  return utilities.cornerMap[a].map((i) => [`border${i}-radius`, v]);
141
141
  }
@@ -343,13 +343,13 @@ const fonts = [
343
343
  "line-height": height
344
344
  };
345
345
  }
346
- return { "font-size": utilities.handler.bracket.auto.rem(s) };
346
+ return { "font-size": utilities.handler.bracket.rem(s) };
347
347
  }],
348
- [/^text-size-(.+)$/, ([, s]) => ({ "font-size": utilities.handler.bracket.cssvar.auto.rem(s) })],
348
+ [/^text-size-(.+)$/, ([, s]) => ({ "font-size": utilities.handler.bracket.cssvar.rem(s) })],
349
349
  [/^(?:font|fw)-?([^-]+)$/, ([, s]) => ({ "font-weight": weightMap[s] || utilities.handler.number(s) })],
350
- [/^(?:leading|lh)-([^-]+)$/, ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || utilities.handler.bracket.auto.rem(s) })],
351
- [/^tracking-([^-]+)$/, ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || utilities.handler.bracket.auto.rem(s) })],
352
- [/^word-spacing-([^-]+)$/, ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || utilities.handler.bracket.auto.rem(s) })]
350
+ [/^(?:leading|lh)-([^-]+)$/, ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || utilities.handler.bracket.rem(s) })],
351
+ [/^tracking-([^-]+)$/, ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || utilities.handler.bracket.rem(s) })],
352
+ [/^word-spacing-([^-]+)$/, ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || utilities.handler.bracket.rem(s) })]
353
353
  ];
354
354
  const tabSizes = [
355
355
  [/^tab(?:-(.+))?$/, ([, s]) => {
@@ -364,7 +364,7 @@ const tabSizes = [
364
364
  }]
365
365
  ];
366
366
  const textIndents = [
367
- [/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.auto.fraction.rem(s) })]
367
+ [/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.fraction.rem(s) })]
368
368
  ];
369
369
  const textStrokes = [
370
370
  [/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || utilities.handler.bracket.cssvar.px(s) })],
@@ -392,7 +392,7 @@ const directions = {
392
392
  "y": "row-"
393
393
  };
394
394
  const handleGap = ([, d = "", s]) => {
395
- const v = utilities.handler.bracket.cssvar.auto.rem(s);
395
+ const v = utilities.handler.bracket.cssvar.rem(s);
396
396
  if (v != null) {
397
397
  return {
398
398
  [`grid-${directions[d]}gap`]: v,
@@ -709,7 +709,7 @@ const transforms = [
709
709
  [/^translate-()(.+)$/, handleTranslate],
710
710
  [/^translate-([xyz])-(.+)$/, handleTranslate],
711
711
  [/^rotate-()(.+)$/, handleRotate],
712
- [/^rotate(-[xyz])-(.+)$/, handleRotate],
712
+ [/^rotate-([xyz])-(.+)$/, handleRotate],
713
713
  [/^skew-([xy])-(.+)$/, handleSkew],
714
714
  [/^scale-()(.+)$/, handleScale],
715
715
  [/^scale-([xyz])-(.+)$/, handleScale],
@@ -747,16 +747,30 @@ function handleScale([, d, b]) {
747
747
  ];
748
748
  }
749
749
  }
750
- function handleRotate([, d, b]) {
750
+ function handleRotate([, d = "", b]) {
751
751
  const v = utilities.handler.bracket.cssvar.degree(b);
752
752
  if (v != null) {
753
- return [
754
- transformBase,
755
- {
756
- [`--un-rotate${d || ""}`]: v,
757
- transform: "var(--un-transform)"
758
- }
759
- ];
753
+ if (d) {
754
+ return [
755
+ transformBase,
756
+ {
757
+ "--un-rotate": 0,
758
+ [`--un-rotate-${d}`]: v,
759
+ "transform": "var(--un-transform)"
760
+ }
761
+ ];
762
+ } else {
763
+ return [
764
+ transformBase,
765
+ {
766
+ "--un-rotate-x": 0,
767
+ "--un-rotate-y": 0,
768
+ "--un-rotate-z": 0,
769
+ "--un-rotate": v,
770
+ "transform": "var(--un-transform)"
771
+ }
772
+ ];
773
+ }
760
774
  }
761
775
  }
762
776
  function handleSkew([, d, b]) {
@@ -832,7 +846,7 @@ const textDecorations = [
832
846
  }
833
847
  }],
834
848
  [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": utilities.handler.bracket.percent(opacity) })],
835
- [/^underline-offset-(.+)$/, ([, s]) => ({ "text-underline-offset": utilities.handler.auto.bracket.cssvar.px(s) })],
849
+ [/^(?:underline|decoration)-offset-(.+)$/, ([, s]) => ({ "text-underline-offset": utilities.handler.auto.bracket.cssvar.px(s) })],
836
850
  [/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy|inherit|initial|revert|unset)$/, ([, d]) => ({ "text-decoration-style": d })],
837
851
  ["no-underline", { "text-decoration": "none" }],
838
852
  ["decoration-none", { "text-decoration": "none" }]
@@ -17,9 +17,9 @@ const textAligns = [
17
17
  ];
18
18
 
19
19
  const outline = [
20
- [/^outline-(?:width-|size-)?(.+)$/, ([, d]) => ({ "outline-width": handler.bracket.cssvar.auto.fraction.rem(d) })],
20
+ [/^outline-(?:width-|size-)?(.+)$/, ([, d]) => ({ "outline-width": handler.bracket.cssvar.fraction.rem(d) })],
21
21
  [/^outline-(?:color-)?(.+)$/, colorResolver("outline-color", "outline-color")],
22
- [/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": handler.bracket.cssvar.auto.fraction.rem(d) })],
22
+ [/^outline-offset-(.+)$/, ([, d]) => ({ "outline-offset": handler.bracket.cssvar.fraction.rem(d) })],
23
23
  ["outline", { "outline-style": "solid" }],
24
24
  [/^outline-(auto|dashed|dotted|double|hidden|solid|groove|ridge|inset|outset|inherit|initial|revert|unset)$/, ([, c]) => ({ "outline-style": c })],
25
25
  ["outline-none", { "outline": "2px solid transparent", "outline-offset": "2px" }]
@@ -133,7 +133,7 @@ function handlerBorderOpacity([, a = "", opacity]) {
133
133
  return directionMap[a].map((i) => [`--un-border${i}-opacity`, v]);
134
134
  }
135
135
  function handlerRounded([, a = "", s = "DEFAULT"], { theme }) {
136
- const v = theme.borderRadius?.[s] || handler.bracket.cssvar.auto.fraction.rem(s);
136
+ const v = theme.borderRadius?.[s] || handler.bracket.cssvar.fraction.rem(s);
137
137
  if (a in cornerMap && v != null)
138
138
  return cornerMap[a].map((i) => [`border${i}-radius`, v]);
139
139
  }
@@ -341,13 +341,13 @@ const fonts = [
341
341
  "line-height": height
342
342
  };
343
343
  }
344
- return { "font-size": handler.bracket.auto.rem(s) };
344
+ return { "font-size": handler.bracket.rem(s) };
345
345
  }],
346
- [/^text-size-(.+)$/, ([, s]) => ({ "font-size": handler.bracket.cssvar.auto.rem(s) })],
346
+ [/^text-size-(.+)$/, ([, s]) => ({ "font-size": handler.bracket.cssvar.rem(s) })],
347
347
  [/^(?:font|fw)-?([^-]+)$/, ([, s]) => ({ "font-weight": weightMap[s] || handler.number(s) })],
348
- [/^(?:leading|lh)-([^-]+)$/, ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || handler.bracket.auto.rem(s) })],
349
- [/^tracking-([^-]+)$/, ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || handler.bracket.auto.rem(s) })],
350
- [/^word-spacing-([^-]+)$/, ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || handler.bracket.auto.rem(s) })]
348
+ [/^(?:leading|lh)-([^-]+)$/, ([, s], { theme }) => ({ "line-height": theme.lineHeight?.[s] || handler.bracket.rem(s) })],
349
+ [/^tracking-([^-]+)$/, ([, s], { theme }) => ({ "letter-spacing": theme.letterSpacing?.[s] || handler.bracket.rem(s) })],
350
+ [/^word-spacing-([^-]+)$/, ([, s], { theme }) => ({ "word-spacing": theme.wordSpacing?.[s] || handler.bracket.rem(s) })]
351
351
  ];
352
352
  const tabSizes = [
353
353
  [/^tab(?:-(.+))?$/, ([, s]) => {
@@ -362,7 +362,7 @@ const tabSizes = [
362
362
  }]
363
363
  ];
364
364
  const textIndents = [
365
- [/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || handler.bracket.cssvar.auto.fraction.rem(s) })]
365
+ [/^indent(?:-(.+))?$/, ([, s], { theme }) => ({ "text-indent": theme.textIndent?.[s || "DEFAULT"] || handler.bracket.cssvar.fraction.rem(s) })]
366
366
  ];
367
367
  const textStrokes = [
368
368
  [/^text-stroke(?:-(.+))?$/, ([, s], { theme }) => ({ "-webkit-text-stroke-width": theme.textStrokeWidth?.[s || "DEFAULT"] || handler.bracket.cssvar.px(s) })],
@@ -390,7 +390,7 @@ const directions = {
390
390
  "y": "row-"
391
391
  };
392
392
  const handleGap = ([, d = "", s]) => {
393
- const v = handler.bracket.cssvar.auto.rem(s);
393
+ const v = handler.bracket.cssvar.rem(s);
394
394
  if (v != null) {
395
395
  return {
396
396
  [`grid-${directions[d]}gap`]: v,
@@ -707,7 +707,7 @@ const transforms = [
707
707
  [/^translate-()(.+)$/, handleTranslate],
708
708
  [/^translate-([xyz])-(.+)$/, handleTranslate],
709
709
  [/^rotate-()(.+)$/, handleRotate],
710
- [/^rotate(-[xyz])-(.+)$/, handleRotate],
710
+ [/^rotate-([xyz])-(.+)$/, handleRotate],
711
711
  [/^skew-([xy])-(.+)$/, handleSkew],
712
712
  [/^scale-()(.+)$/, handleScale],
713
713
  [/^scale-([xyz])-(.+)$/, handleScale],
@@ -745,16 +745,30 @@ function handleScale([, d, b]) {
745
745
  ];
746
746
  }
747
747
  }
748
- function handleRotate([, d, b]) {
748
+ function handleRotate([, d = "", b]) {
749
749
  const v = handler.bracket.cssvar.degree(b);
750
750
  if (v != null) {
751
- return [
752
- transformBase,
753
- {
754
- [`--un-rotate${d || ""}`]: v,
755
- transform: "var(--un-transform)"
756
- }
757
- ];
751
+ if (d) {
752
+ return [
753
+ transformBase,
754
+ {
755
+ "--un-rotate": 0,
756
+ [`--un-rotate-${d}`]: v,
757
+ "transform": "var(--un-transform)"
758
+ }
759
+ ];
760
+ } else {
761
+ return [
762
+ transformBase,
763
+ {
764
+ "--un-rotate-x": 0,
765
+ "--un-rotate-y": 0,
766
+ "--un-rotate-z": 0,
767
+ "--un-rotate": v,
768
+ "transform": "var(--un-transform)"
769
+ }
770
+ ];
771
+ }
758
772
  }
759
773
  }
760
774
  function handleSkew([, d, b]) {
@@ -830,7 +844,7 @@ const textDecorations = [
830
844
  }
831
845
  }],
832
846
  [/^(?:underline|decoration)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-line-opacity": handler.bracket.percent(opacity) })],
833
- [/^underline-offset-(.+)$/, ([, s]) => ({ "text-underline-offset": handler.auto.bracket.cssvar.px(s) })],
847
+ [/^(?:underline|decoration)-offset-(.+)$/, ([, s]) => ({ "text-underline-offset": handler.auto.bracket.cssvar.px(s) })],
834
848
  [/^(?:underline|decoration)-(solid|double|dotted|dashed|wavy|inherit|initial|revert|unset)$/, ([, d]) => ({ "text-decoration-style": d })],
835
849
  ["no-underline", { "text-decoration": "none" }],
836
850
  ["decoration-none", { "text-decoration": "none" }]
@@ -43,7 +43,7 @@ const variantCombinators = [
43
43
  variants$1.variantMatcher("next", (input) => `${input}+*`),
44
44
  variants$1.variantMatcher("sibling", (input) => `${input}+*`),
45
45
  variants$1.variantMatcher("siblings", (input) => `${input}~*`),
46
- variants$1.variantMatcher("svg", (input) => `${input} svg *`)
46
+ variants$1.variantMatcher("svg", (input) => `${input} svg`)
47
47
  ];
48
48
 
49
49
  const variantMotions = [
@@ -41,7 +41,7 @@ const variantCombinators = [
41
41
  variantMatcher("next", (input) => `${input}+*`),
42
42
  variantMatcher("sibling", (input) => `${input}+*`),
43
43
  variantMatcher("siblings", (input) => `${input}~*`),
44
- variantMatcher("svg", (input) => `${input} svg *`)
44
+ variantMatcher("svg", (input) => `${input} svg`)
45
45
  ];
46
46
 
47
47
  const variantMotions = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-mini",
3
- "version": "0.22.3",
3
+ "version": "0.22.4",
4
4
  "description": "The minimal preset for UnoCSS",
5
5
  "keywords": [
6
6
  "unocss",
@@ -61,7 +61,7 @@
61
61
  "*.css"
62
62
  ],
63
63
  "dependencies": {
64
- "@unocss/core": "0.22.3"
64
+ "@unocss/core": "0.22.4"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "unbuild",