@unocss/preset-mini 0.17.3 → 0.20.0

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.
@@ -46,6 +46,12 @@ const borders = [
46
46
  [/^(?:border|b)()-(.+)$/, handlerBorderColor],
47
47
  [/^(?:border|b)-([^-]+)(?:-(.+))?$/, handlerBorderColor],
48
48
  [/^(?:border|b)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-border-opacity": utilities.handler.bracket.percent(opacity) })],
49
+ [/^(?:border|b)-([^-]+)-op(?:acity)?-?(.+)$/, ([, a, opacity]) => {
50
+ const v = utilities.handler.bracket.percent(opacity);
51
+ const d = utilities.directionMap[a];
52
+ if (v !== void 0 && d)
53
+ return d.map((i) => [`--un-border${i}-opacity`, v]);
54
+ }],
49
55
  [/^(?:border-)?(?:rounded|rd)$/, handlerRounded],
50
56
  [/^(?:border-)?(?:rounded|rd)(?:-(.+))?$/, handlerRounded],
51
57
  [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-(.+))?$/, handlerRounded],
@@ -55,6 +61,43 @@ const borders = [
55
61
  ["border-double", { "border-style": "double" }],
56
62
  ["border-none", { "border-style": "none" }]
57
63
  ];
64
+ const borderHasColor = (color, { theme }) => {
65
+ return color !== void 0 && !!utilities.parseColor(color, theme)?.color;
66
+ };
67
+ const borderColorResolver = (direction) => ([, body], { theme }) => {
68
+ const data = utilities.parseColor(body, theme);
69
+ if (!data)
70
+ return;
71
+ const { opacity, color, rgba } = data;
72
+ if (!color)
73
+ return;
74
+ const a = opacity ? opacity[0] === "[" ? utilities.handler.bracket.percent(opacity) : parseFloat(opacity) / 100 : rgba?.[3];
75
+ if (rgba) {
76
+ if (a != null && !Number.isNaN(a)) {
77
+ rgba[3] = typeof a === "string" && !a.includes("%") ? parseFloat(a) : a;
78
+ return {
79
+ [`border${direction}-color`]: `rgba(${rgba.join(",")})`
80
+ };
81
+ } else {
82
+ if (direction === "") {
83
+ return {
84
+ "--un-border-opacity": 1,
85
+ [`border${direction}-color`]: `rgba(${rgba.slice(0, 3).join(",")},var(--un-border${direction}-opacity))`
86
+ };
87
+ } else {
88
+ return {
89
+ "--un-border-opacity": 1,
90
+ [`--un-border${direction}-opacity`]: "var(--un-border-opacity)",
91
+ [`border${direction}-color`]: `rgba(${rgba.slice(0, 3).join(",")},var(--un-border${direction}-opacity))`
92
+ };
93
+ }
94
+ }
95
+ } else {
96
+ return {
97
+ [`border${direction}-color`]: color.replace("%alpha", `${a || 1}`)
98
+ };
99
+ }
100
+ };
58
101
  function handlerBorder(m) {
59
102
  const borderSizes = handlerBorderSize(m);
60
103
  if (borderSizes) {
@@ -71,8 +114,8 @@ function handlerBorderSize([, a, b]) {
71
114
  return utilities.directionMap[d].map((i) => [`border${i}-width`, v]);
72
115
  }
73
116
  function handlerBorderColor([, a, c], ctx) {
74
- if (c !== void 0 && utilities.colorResolver("border-color", "border")(["", c], ctx)) {
75
- return Object.assign({}, ...utilities.directionMap[utilities.directionMap[a] ? a : ""].map((i) => utilities.colorResolver(`border${i}-color`, "border")(["", c], ctx)));
117
+ if (borderHasColor(c, ctx)) {
118
+ return Object.assign({}, ...utilities.directionMap[utilities.directionMap[a] ? a : ""].map((i) => borderColorResolver(i)(["", c], ctx)));
76
119
  }
77
120
  }
78
121
  function handlerRounded([, a, b], { theme }) {
@@ -130,7 +173,7 @@ const flex = [
130
173
  ["flex-auto", { flex: "1 1 auto" }],
131
174
  ["flex-initial", { flex: "0 1 auto" }],
132
175
  ["flex-none", { flex: "none" }],
133
- [/^flex-\[(.+)\]$/, ([, d]) => ({ flex: d })],
176
+ [/^flex-(\[.+\])$/, ([, d]) => ({ flex: utilities.handler.bracket(d).replace(/\d+\/\d+/, ($1) => utilities.handler.fraction($1)) })],
134
177
  ["flex-shrink", { "flex-shrink": 1 }],
135
178
  ["flex-shrink-0", { "flex-shrink": 0 }],
136
179
  ["flex-grow", { "flex-grow": 1 }],
@@ -293,12 +336,12 @@ const grids = [
293
336
  [/^(?:grid-)?auto-cols-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-columns": autoDirection(v, theme) })],
294
337
  [/^(?:grid-)?auto-flow-([\w.-]+)$/, ([, v]) => ({ "grid-auto-flow": v.replace("col", "column").split("-").join(" ") })],
295
338
  [/^(?:grid-)?auto-rows-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-rows": autoDirection(v, theme) })],
339
+ [/^grid-cols-(.+)$/, ([, v]) => ({ "grid-template-columns": utilities.handler.bracket(v) })],
340
+ [/^grid-rows-(.+)$/, ([, v]) => ({ "grid-template-rows": utilities.handler.bracket(v) })],
296
341
  [/^grid-cols-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-columns": `repeat(auto-fill,minmax(${d},1fr))` })],
297
342
  [/^grid-rows-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-rows": `repeat(auto-fill,minmax(${d},1fr))` })],
298
343
  [/^grid-cols-(\d+)$/, ([, d]) => ({ "grid-template-columns": `repeat(${d},minmax(0,1fr))` })],
299
- [/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d},minmax(0,1fr))` })],
300
- [/^grid-cols-\[(.+)\]$/, ([, v]) => ({ "grid-template-columns": v.replace(/,/g, " ") })],
301
- [/^grid-rows-\[(.+)\]$/, ([, v]) => ({ "grid-template-rows": v.replace(/,/g, " ") })]
344
+ [/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d},minmax(0,1fr))` })]
302
345
  ];
303
346
 
304
347
  const overflowValues = [
@@ -314,11 +357,8 @@ const overflows = [
314
357
 
315
358
  const basicSet = ["auto", "start", "end", "center", "stretch"];
316
359
  const positions = [
317
- ["relative", { position: "relative" }],
318
- ["absolute", { position: "absolute" }],
319
- ["fixed", { position: "fixed" }],
320
- ["sticky", { position: "sticky" }],
321
- ["static", { position: "static" }]
360
+ [/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v })],
361
+ [/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
322
362
  ];
323
363
  const justifies = [
324
364
  ["justify-start", { "justify-content": "flex-start" }],
@@ -369,8 +409,8 @@ function handleInsetValue(v) {
369
409
  return { auto: "auto", full: "100%" }[v] ?? utilities.handler.bracket.fraction.cssvar.auto.rem(v);
370
410
  }
371
411
  const insets = [
372
- [/^(top|left|right|bottom|inset)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })],
373
- [/^inset-([xy])-(.+)$/, ([, d, v]) => {
412
+ [/^(?:position-|pos-)?(top|left|right|bottom|inset)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })],
413
+ [/^(?:position-|pos-)?inset-([xy])-(.+)$/, ([, d, v]) => {
374
414
  const r = handleInsetValue(v);
375
415
  if (r != null && d in utilities.directionMap)
376
416
  return utilities.directionMap[d].map((i) => [i.slice(1), r]);
@@ -524,10 +564,8 @@ const boxShadows = [
524
564
  "box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
525
565
  };
526
566
  }
527
- const color = colorResolver(d, theme);
528
- if (color)
529
- return color;
530
- }]
567
+ }],
568
+ [/^shadow-(.+)$/, ([, d], { theme }) => colorResolver(d, theme)]
531
569
  ];
532
570
 
533
571
  function getPropName(minmax, hw) {
@@ -600,6 +638,8 @@ const transforms = [
600
638
  [/^scale-([xyz])-(.+)$/, handleScale],
601
639
  [/^rotate-(.+)$/, handleRotate],
602
640
  [/^rotate-((?!\[)[^-]+?)(?:deg)?$/, handleRotateWithUnit],
641
+ [/^skew-([xy])-(.+)$/, handleSkew],
642
+ [/^skew-([xy])-((?!\[)[^-]+?)(?:deg)?$/, handleSkewWithUnit],
603
643
  ["transform-gpu", transformGpu],
604
644
  ["transform-cpu", transformCpu],
605
645
  ["transform-none", { transform: "none" }],
@@ -653,6 +693,24 @@ function handleRotate([, b]) {
653
693
  ];
654
694
  }
655
695
  }
696
+ function handleSkewWithUnit([, d, b]) {
697
+ const v = utilities.handler.bracket.number(b);
698
+ if (v != null) {
699
+ return [
700
+ transformBase,
701
+ { [`--un-skew-${d}`]: `${v}deg` }
702
+ ];
703
+ }
704
+ }
705
+ function handleSkew([, d, b]) {
706
+ const v = utilities.handler.bracket(b);
707
+ if (v != null) {
708
+ return [
709
+ transformBase,
710
+ { [`--un-skew-${d}`]: v }
711
+ ];
712
+ }
713
+ }
656
714
 
657
715
  const variablesAbbrMap = {
658
716
  "visible": "visibility",
@@ -1,4 +1,4 @@
1
- import { h as handler, c as colorResolver$1, d as directionMap, a as cornerMap, p as parseColor, b as capitalize, e as directionSize, x as xyzMap } from './utilities.mjs';
1
+ import { h as handler, c as colorResolver$1, d as directionMap, p as parseColor, a as cornerMap, b as capitalize, e as directionSize, x as xyzMap } from './utilities.mjs';
2
2
  import { toArray } from '@unocss/core';
3
3
  import { C as CONTROL_BYPASS_PSEUDO_CLASS } from './pseudo.mjs';
4
4
 
@@ -44,6 +44,12 @@ const borders = [
44
44
  [/^(?:border|b)()-(.+)$/, handlerBorderColor],
45
45
  [/^(?:border|b)-([^-]+)(?:-(.+))?$/, handlerBorderColor],
46
46
  [/^(?:border|b)-op(?:acity)?-?(.+)$/, ([, opacity]) => ({ "--un-border-opacity": handler.bracket.percent(opacity) })],
47
+ [/^(?:border|b)-([^-]+)-op(?:acity)?-?(.+)$/, ([, a, opacity]) => {
48
+ const v = handler.bracket.percent(opacity);
49
+ const d = directionMap[a];
50
+ if (v !== void 0 && d)
51
+ return d.map((i) => [`--un-border${i}-opacity`, v]);
52
+ }],
47
53
  [/^(?:border-)?(?:rounded|rd)$/, handlerRounded],
48
54
  [/^(?:border-)?(?:rounded|rd)(?:-(.+))?$/, handlerRounded],
49
55
  [/^(?:border-)?(?:rounded|rd)(?:-([^-]+))?(?:-(.+))?$/, handlerRounded],
@@ -53,6 +59,43 @@ const borders = [
53
59
  ["border-double", { "border-style": "double" }],
54
60
  ["border-none", { "border-style": "none" }]
55
61
  ];
62
+ const borderHasColor = (color, { theme }) => {
63
+ return color !== void 0 && !!parseColor(color, theme)?.color;
64
+ };
65
+ const borderColorResolver = (direction) => ([, body], { theme }) => {
66
+ const data = parseColor(body, theme);
67
+ if (!data)
68
+ return;
69
+ const { opacity, color, rgba } = data;
70
+ if (!color)
71
+ return;
72
+ const a = opacity ? opacity[0] === "[" ? handler.bracket.percent(opacity) : parseFloat(opacity) / 100 : rgba?.[3];
73
+ if (rgba) {
74
+ if (a != null && !Number.isNaN(a)) {
75
+ rgba[3] = typeof a === "string" && !a.includes("%") ? parseFloat(a) : a;
76
+ return {
77
+ [`border${direction}-color`]: `rgba(${rgba.join(",")})`
78
+ };
79
+ } else {
80
+ if (direction === "") {
81
+ return {
82
+ "--un-border-opacity": 1,
83
+ [`border${direction}-color`]: `rgba(${rgba.slice(0, 3).join(",")},var(--un-border${direction}-opacity))`
84
+ };
85
+ } else {
86
+ return {
87
+ "--un-border-opacity": 1,
88
+ [`--un-border${direction}-opacity`]: "var(--un-border-opacity)",
89
+ [`border${direction}-color`]: `rgba(${rgba.slice(0, 3).join(",")},var(--un-border${direction}-opacity))`
90
+ };
91
+ }
92
+ }
93
+ } else {
94
+ return {
95
+ [`border${direction}-color`]: color.replace("%alpha", `${a || 1}`)
96
+ };
97
+ }
98
+ };
56
99
  function handlerBorder(m) {
57
100
  const borderSizes = handlerBorderSize(m);
58
101
  if (borderSizes) {
@@ -69,8 +112,8 @@ function handlerBorderSize([, a, b]) {
69
112
  return directionMap[d].map((i) => [`border${i}-width`, v]);
70
113
  }
71
114
  function handlerBorderColor([, a, c], ctx) {
72
- if (c !== void 0 && colorResolver$1("border-color", "border")(["", c], ctx)) {
73
- return Object.assign({}, ...directionMap[directionMap[a] ? a : ""].map((i) => colorResolver$1(`border${i}-color`, "border")(["", c], ctx)));
115
+ if (borderHasColor(c, ctx)) {
116
+ return Object.assign({}, ...directionMap[directionMap[a] ? a : ""].map((i) => borderColorResolver(i)(["", c], ctx)));
74
117
  }
75
118
  }
76
119
  function handlerRounded([, a, b], { theme }) {
@@ -128,7 +171,7 @@ const flex = [
128
171
  ["flex-auto", { flex: "1 1 auto" }],
129
172
  ["flex-initial", { flex: "0 1 auto" }],
130
173
  ["flex-none", { flex: "none" }],
131
- [/^flex-\[(.+)\]$/, ([, d]) => ({ flex: d })],
174
+ [/^flex-(\[.+\])$/, ([, d]) => ({ flex: handler.bracket(d).replace(/\d+\/\d+/, ($1) => handler.fraction($1)) })],
132
175
  ["flex-shrink", { "flex-shrink": 1 }],
133
176
  ["flex-shrink-0", { "flex-shrink": 0 }],
134
177
  ["flex-grow", { "flex-grow": 1 }],
@@ -291,12 +334,12 @@ const grids = [
291
334
  [/^(?:grid-)?auto-cols-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-columns": autoDirection(v, theme) })],
292
335
  [/^(?:grid-)?auto-flow-([\w.-]+)$/, ([, v]) => ({ "grid-auto-flow": v.replace("col", "column").split("-").join(" ") })],
293
336
  [/^(?:grid-)?auto-rows-([\w.-]+)$/, ([, v], { theme }) => ({ "grid-auto-rows": autoDirection(v, theme) })],
337
+ [/^grid-cols-(.+)$/, ([, v]) => ({ "grid-template-columns": handler.bracket(v) })],
338
+ [/^grid-rows-(.+)$/, ([, v]) => ({ "grid-template-rows": handler.bracket(v) })],
294
339
  [/^grid-cols-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-columns": `repeat(auto-fill,minmax(${d},1fr))` })],
295
340
  [/^grid-rows-minmax-([\w.-]+)$/, ([, d]) => ({ "grid-template-rows": `repeat(auto-fill,minmax(${d},1fr))` })],
296
341
  [/^grid-cols-(\d+)$/, ([, d]) => ({ "grid-template-columns": `repeat(${d},minmax(0,1fr))` })],
297
- [/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d},minmax(0,1fr))` })],
298
- [/^grid-cols-\[(.+)\]$/, ([, v]) => ({ "grid-template-columns": v.replace(/,/g, " ") })],
299
- [/^grid-rows-\[(.+)\]$/, ([, v]) => ({ "grid-template-rows": v.replace(/,/g, " ") })]
342
+ [/^grid-rows-(\d+)$/, ([, d]) => ({ "grid-template-rows": `repeat(${d},minmax(0,1fr))` })]
300
343
  ];
301
344
 
302
345
  const overflowValues = [
@@ -312,11 +355,8 @@ const overflows = [
312
355
 
313
356
  const basicSet = ["auto", "start", "end", "center", "stretch"];
314
357
  const positions = [
315
- ["relative", { position: "relative" }],
316
- ["absolute", { position: "absolute" }],
317
- ["fixed", { position: "fixed" }],
318
- ["sticky", { position: "sticky" }],
319
- ["static", { position: "static" }]
358
+ [/^(?:position-|pos-)?(relative|absolute|fixed|sticky)$/, ([, v]) => ({ position: v })],
359
+ [/^(?:position-|pos-)?(static)$/, ([, v]) => ({ position: v })]
320
360
  ];
321
361
  const justifies = [
322
362
  ["justify-start", { "justify-content": "flex-start" }],
@@ -367,8 +407,8 @@ function handleInsetValue(v) {
367
407
  return { auto: "auto", full: "100%" }[v] ?? handler.bracket.fraction.cssvar.auto.rem(v);
368
408
  }
369
409
  const insets = [
370
- [/^(top|left|right|bottom|inset)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })],
371
- [/^inset-([xy])-(.+)$/, ([, d, v]) => {
410
+ [/^(?:position-|pos-)?(top|left|right|bottom|inset)-(.+)$/, ([, d, v]) => ({ [d]: handleInsetValue(v) })],
411
+ [/^(?:position-|pos-)?inset-([xy])-(.+)$/, ([, d, v]) => {
372
412
  const r = handleInsetValue(v);
373
413
  if (r != null && d in directionMap)
374
414
  return directionMap[d].map((i) => [i.slice(1), r]);
@@ -522,10 +562,8 @@ const boxShadows = [
522
562
  "box-shadow": "var(--un-ring-offset-shadow, 0 0 #0000), var(--un-ring-shadow, 0 0 #0000), var(--un-shadow)"
523
563
  };
524
564
  }
525
- const color = colorResolver(d, theme);
526
- if (color)
527
- return color;
528
- }]
565
+ }],
566
+ [/^shadow-(.+)$/, ([, d], { theme }) => colorResolver(d, theme)]
529
567
  ];
530
568
 
531
569
  function getPropName(minmax, hw) {
@@ -598,6 +636,8 @@ const transforms = [
598
636
  [/^scale-([xyz])-(.+)$/, handleScale],
599
637
  [/^rotate-(.+)$/, handleRotate],
600
638
  [/^rotate-((?!\[)[^-]+?)(?:deg)?$/, handleRotateWithUnit],
639
+ [/^skew-([xy])-(.+)$/, handleSkew],
640
+ [/^skew-([xy])-((?!\[)[^-]+?)(?:deg)?$/, handleSkewWithUnit],
601
641
  ["transform-gpu", transformGpu],
602
642
  ["transform-cpu", transformCpu],
603
643
  ["transform-none", { transform: "none" }],
@@ -651,6 +691,24 @@ function handleRotate([, b]) {
651
691
  ];
652
692
  }
653
693
  }
694
+ function handleSkewWithUnit([, d, b]) {
695
+ const v = handler.bracket.number(b);
696
+ if (v != null) {
697
+ return [
698
+ transformBase,
699
+ { [`--un-skew-${d}`]: `${v}deg` }
700
+ ];
701
+ }
702
+ }
703
+ function handleSkew([, d, b]) {
704
+ const v = handler.bracket(b);
705
+ if (v != null) {
706
+ return [
707
+ transformBase,
708
+ { [`--un-skew-${d}`]: v }
709
+ ];
710
+ }
711
+ }
654
712
 
655
713
  const variablesAbbrMap = {
656
714
  "visible": "visibility",
@@ -4,7 +4,7 @@ const variants$1 = require('./variants.cjs');
4
4
  const pseudo = require('./pseudo.cjs');
5
5
 
6
6
  const regexCache = {};
7
- const variantBreakpoints = (matcher, _, theme) => {
7
+ const variantBreakpoints = (matcher, { theme }) => {
8
8
  const variantEntries = Object.entries(theme.breakpoints || {}).map(([point, size], idx) => [point, size, idx]);
9
9
  for (const [point, size, idx] of variantEntries) {
10
10
  if (!regexCache[point])
@@ -46,25 +46,41 @@ const variantCombinators = [
46
46
  variants$1.variantMatcher("svg", (input) => `${input} svg *`)
47
47
  ];
48
48
 
49
- const variantColorsClass = [
50
- variants$1.variantMatcher("dark", (input) => `.dark $$ ${input}`),
51
- variants$1.variantMatcher("light", (input) => `.light $$ ${input}`)
52
- ];
53
- const variantColorsMedia = [
54
- (v) => {
55
- const dark = variants$1.variantMatcher("dark")(v);
56
- if (dark) {
57
- return {
58
- ...dark,
59
- parent: "@media (prefers-color-scheme: dark)"
60
- };
49
+ const variantColorsMediaOrClass = [
50
+ (v, { options: { dark } }) => {
51
+ if (dark === "class") {
52
+ const match = variants$1.variantMatcher("dark", (input) => `.dark $$ ${input}`)(v);
53
+ if (match)
54
+ return match;
61
55
  }
62
- const light = variants$1.variantMatcher("light")(v);
63
- if (light) {
64
- return {
65
- ...light,
66
- parent: "@media (prefers-color-scheme: light)"
67
- };
56
+ },
57
+ (v, { options: { dark } }) => {
58
+ if (dark === "class") {
59
+ const match = variants$1.variantMatcher("light", (input) => `.light $$ ${input}`)(v);
60
+ if (match)
61
+ return match;
62
+ }
63
+ },
64
+ (v, { options: { dark } }) => {
65
+ if (dark === "media") {
66
+ const match = variants$1.variantMatcher("dark")(v);
67
+ if (match) {
68
+ return {
69
+ ...match,
70
+ parent: "@media (prefers-color-scheme: dark)"
71
+ };
72
+ }
73
+ }
74
+ },
75
+ (v, { options: { dark } }) => {
76
+ if (dark === "media") {
77
+ const match = variants$1.variantMatcher("light")(v);
78
+ if (match) {
79
+ return {
80
+ ...match,
81
+ parent: "@media (prefers-color-scheme: light)"
82
+ };
83
+ }
68
84
  }
69
85
  }
70
86
  ];
@@ -113,22 +129,36 @@ const variantSpace = (matcher) => {
113
129
  }
114
130
  };
115
131
 
132
+ const variantPrint = (v) => {
133
+ const print = variants$1.variantMatcher("print")(v);
134
+ if (print) {
135
+ return {
136
+ ...print,
137
+ parent: "@media print"
138
+ };
139
+ }
140
+ };
141
+
116
142
  const variants = [
117
143
  variantSpace,
118
144
  variantNegative,
119
145
  variantImportant,
146
+ variantPrint,
120
147
  variantBreakpoints,
121
148
  ...variantCombinators,
122
149
  pseudo.variantPseudoClasses,
150
+ pseudo.variantPseudoClassFunctions,
151
+ pseudo.variantTaggedPseudoClasses,
123
152
  pseudo.variantPseudoElements,
124
- pseudo.partClasses
153
+ pseudo.partClasses,
154
+ ...variantColorsMediaOrClass
125
155
  ];
126
156
 
127
157
  exports.variantBreakpoints = variantBreakpoints;
128
- exports.variantColorsClass = variantColorsClass;
129
- exports.variantColorsMedia = variantColorsMedia;
158
+ exports.variantColorsMediaOrClass = variantColorsMediaOrClass;
130
159
  exports.variantCombinators = variantCombinators;
131
160
  exports.variantImportant = variantImportant;
132
161
  exports.variantNegative = variantNegative;
162
+ exports.variantPrint = variantPrint;
133
163
  exports.variantSpace = variantSpace;
134
164
  exports.variants = variants;
@@ -1,8 +1,8 @@
1
1
  import { v as variantMatcher } from './variants.mjs';
2
- import { v as variantPseudoClasses, a as variantPseudoElements, p as partClasses } from './pseudo.mjs';
2
+ import { v as variantPseudoClasses, a as variantPseudoClassFunctions, b as variantTaggedPseudoClasses, c as variantPseudoElements, p as partClasses } from './pseudo.mjs';
3
3
 
4
4
  const regexCache = {};
5
- const variantBreakpoints = (matcher, _, theme) => {
5
+ const variantBreakpoints = (matcher, { theme }) => {
6
6
  const variantEntries = Object.entries(theme.breakpoints || {}).map(([point, size], idx) => [point, size, idx]);
7
7
  for (const [point, size, idx] of variantEntries) {
8
8
  if (!regexCache[point])
@@ -44,25 +44,41 @@ const variantCombinators = [
44
44
  variantMatcher("svg", (input) => `${input} svg *`)
45
45
  ];
46
46
 
47
- const variantColorsClass = [
48
- variantMatcher("dark", (input) => `.dark $$ ${input}`),
49
- variantMatcher("light", (input) => `.light $$ ${input}`)
50
- ];
51
- const variantColorsMedia = [
52
- (v) => {
53
- const dark = variantMatcher("dark")(v);
54
- if (dark) {
55
- return {
56
- ...dark,
57
- parent: "@media (prefers-color-scheme: dark)"
58
- };
47
+ const variantColorsMediaOrClass = [
48
+ (v, { options: { dark } }) => {
49
+ if (dark === "class") {
50
+ const match = variantMatcher("dark", (input) => `.dark $$ ${input}`)(v);
51
+ if (match)
52
+ return match;
59
53
  }
60
- const light = variantMatcher("light")(v);
61
- if (light) {
62
- return {
63
- ...light,
64
- parent: "@media (prefers-color-scheme: light)"
65
- };
54
+ },
55
+ (v, { options: { dark } }) => {
56
+ if (dark === "class") {
57
+ const match = variantMatcher("light", (input) => `.light $$ ${input}`)(v);
58
+ if (match)
59
+ return match;
60
+ }
61
+ },
62
+ (v, { options: { dark } }) => {
63
+ if (dark === "media") {
64
+ const match = variantMatcher("dark")(v);
65
+ if (match) {
66
+ return {
67
+ ...match,
68
+ parent: "@media (prefers-color-scheme: dark)"
69
+ };
70
+ }
71
+ }
72
+ },
73
+ (v, { options: { dark } }) => {
74
+ if (dark === "media") {
75
+ const match = variantMatcher("light")(v);
76
+ if (match) {
77
+ return {
78
+ ...match,
79
+ parent: "@media (prefers-color-scheme: light)"
80
+ };
81
+ }
66
82
  }
67
83
  }
68
84
  ];
@@ -111,15 +127,29 @@ const variantSpace = (matcher) => {
111
127
  }
112
128
  };
113
129
 
130
+ const variantPrint = (v) => {
131
+ const print = variantMatcher("print")(v);
132
+ if (print) {
133
+ return {
134
+ ...print,
135
+ parent: "@media print"
136
+ };
137
+ }
138
+ };
139
+
114
140
  const variants = [
115
141
  variantSpace,
116
142
  variantNegative,
117
143
  variantImportant,
144
+ variantPrint,
118
145
  variantBreakpoints,
119
146
  ...variantCombinators,
120
147
  variantPseudoClasses,
148
+ variantPseudoClassFunctions,
149
+ variantTaggedPseudoClasses,
121
150
  variantPseudoElements,
122
- partClasses
151
+ partClasses,
152
+ ...variantColorsMediaOrClass
123
153
  ];
124
154
 
125
- export { variantColorsMedia as a, variantColorsClass as b, variantBreakpoints as c, variantCombinators as d, variantImportant as e, variantNegative as f, variantSpace as g, variants as v };
155
+ export { variantBreakpoints as a, variantCombinators as b, variantColorsMediaOrClass as c, variantImportant as d, variantNegative as e, variantSpace as f, variantPrint as g, variants as v };
@@ -47,13 +47,39 @@ const PseudoElements = [
47
47
  "first-line",
48
48
  "selection"
49
49
  ];
50
+ const PseudoClassFunctions = [
51
+ "not",
52
+ "is",
53
+ "where",
54
+ "has"
55
+ ];
50
56
  const PartClassesRE = /(part-\[(.+)]:)(.+)/;
51
57
  const PseudoElementsRE = new RegExp(`^(${PseudoElements.join("|")})[:-]`);
52
58
  const PseudoClassesStr = Object.keys(PseudoClasses).join("|");
59
+ const PseudoClassFunctionsStr = PseudoClassFunctions.join("|");
53
60
  const PseudoClassesRE = new RegExp(`^(${PseudoClassesStr})[:-]`);
54
- const PseudoClassesNotRE = new RegExp(`^not-(${PseudoClassesStr})[:-]`);
55
- const PseudoClassesGroupRE = new RegExp(`^group-((not-)?(${PseudoClassesStr}))[:-]`);
56
- const PseudoClassesPeerRE = new RegExp(`^peer-((not-)?(${PseudoClassesStr}))[:-]`);
61
+ const PseudoClassFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesStr})[:-]`);
62
+ function shouldAdd(entires) {
63
+ return !entires.find((i) => i[0] === CONTROL_BYPASS_PSEUDO_CLASS) || void 0;
64
+ }
65
+ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
66
+ const re = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
67
+ const rawRe = new RegExp(`^${core.escapeRegExp(parent)}:`);
68
+ return (input) => {
69
+ const match = input.match(re);
70
+ if (match) {
71
+ let pseudo = PseudoClasses[match[3]] || match[3];
72
+ if (match[2])
73
+ pseudo = `${match[2]}(:${pseudo})`;
74
+ return {
75
+ matcher: input.slice(match[1].length + tag.length + 2),
76
+ selector: (s, body) => {
77
+ return shouldAdd(body) && rawRe.test(s) ? s.replace(rawRe, `${parent}:${pseudo}:`) : `${parent}:${pseudo}${combinator}${s}`;
78
+ }
79
+ };
80
+ }
81
+ };
82
+ };
57
83
  const variantPseudoElements = (input) => {
58
84
  const match = input.match(PseudoElementsRE);
59
85
  if (match) {
@@ -63,12 +89,9 @@ const variantPseudoElements = (input) => {
63
89
  };
64
90
  }
65
91
  };
66
- function shouldAdd(entires) {
67
- return !entires.find((i) => i[0] === CONTROL_BYPASS_PSEUDO_CLASS) || void 0;
68
- }
69
92
  const variantPseudoClasses = {
70
93
  match: (input) => {
71
- let match = input.match(PseudoClassesRE);
94
+ const match = input.match(PseudoClassesRE);
72
95
  if (match) {
73
96
  const pseudo = PseudoClasses[match[1]] || match[1];
74
97
  return {
@@ -76,37 +99,34 @@ const variantPseudoClasses = {
76
99
  selector: (s, body) => shouldAdd(body) && `${s}:${pseudo}`
77
100
  };
78
101
  }
79
- match = input.match(PseudoClassesNotRE);
80
- if (match) {
81
- const pseudo = PseudoClasses[match[1]] || match[1];
82
- return {
83
- matcher: input.slice(match[1].length + 5),
84
- selector: (s, body) => shouldAdd(body) && `${s}:not(:${pseudo})`
85
- };
86
- }
87
- match = input.match(PseudoClassesGroupRE);
88
- if (match) {
89
- let pseudo = PseudoClasses[match[3]] || match[3];
90
- if (match[2])
91
- pseudo = `not(:${pseudo})`;
92
- return {
93
- matcher: input.slice(match[1].length + 7),
94
- selector: (s, body) => shouldAdd(body) && s.includes(".group:") ? s.replace(/\.group:/, `.group:${pseudo}:`) : `.group:${pseudo} ${s}`
95
- };
96
- }
97
- match = input.match(PseudoClassesPeerRE);
102
+ },
103
+ multiPass: true
104
+ };
105
+ const variantPseudoClassFunctions = {
106
+ match: (input) => {
107
+ const match = input.match(PseudoClassFunctionsRE);
98
108
  if (match) {
99
- let pseudo = PseudoClasses[match[3]] || match[3];
100
- if (match[2])
101
- pseudo = `not(:${pseudo})`;
109
+ const fn = match[1];
110
+ const pseudo = PseudoClasses[match[2]] || match[2];
102
111
  return {
103
- matcher: input.slice(match[1].length + 6),
104
- selector: (s, body) => shouldAdd(body) && s.includes(".peer:") ? s.replace(/\.peer:/, `.peer:${pseudo}:`) : `.peer:${pseudo}~${s}`
112
+ matcher: input.slice(match[1].length + match[2].length + 2),
113
+ selector: (s, body) => shouldAdd(body) && `${s}:${fn}(:${pseudo})`
105
114
  };
106
115
  }
107
116
  },
108
117
  multiPass: true
109
118
  };
119
+ const variantTaggedPseudoClasses = {
120
+ match: (input, { options: { attributifyPseudo } }) => {
121
+ const g = taggedPseudoClassMatcher("group", attributifyPseudo ? '[group=""]' : ".group", " ")(input);
122
+ if (g)
123
+ return g;
124
+ const p = taggedPseudoClassMatcher("peer", attributifyPseudo ? '[peer=""]' : ".peer", "~")(input);
125
+ if (p)
126
+ return p;
127
+ },
128
+ multiPass: true
129
+ };
110
130
  const partClasses = {
111
131
  match: (input) => {
112
132
  const match = input.match(PartClassesRE);
@@ -124,7 +144,8 @@ const partClasses = {
124
144
  };
125
145
 
126
146
  exports.CONTROL_BYPASS_PSEUDO_CLASS = CONTROL_BYPASS_PSEUDO_CLASS;
127
- exports.PseudoClasses = PseudoClasses;
128
147
  exports.partClasses = partClasses;
148
+ exports.variantPseudoClassFunctions = variantPseudoClassFunctions;
129
149
  exports.variantPseudoClasses = variantPseudoClasses;
130
150
  exports.variantPseudoElements = variantPseudoElements;
151
+ exports.variantTaggedPseudoClasses = variantTaggedPseudoClasses;
@@ -1,4 +1,4 @@
1
- import { toArray } from '@unocss/core';
1
+ import { toArray, escapeRegExp } from '@unocss/core';
2
2
 
3
3
  const CONTROL_BYPASS_PSEUDO_CLASS = "$$no-pseudo";
4
4
  const PseudoClasses = Object.fromEntries([
@@ -45,13 +45,39 @@ const PseudoElements = [
45
45
  "first-line",
46
46
  "selection"
47
47
  ];
48
+ const PseudoClassFunctions = [
49
+ "not",
50
+ "is",
51
+ "where",
52
+ "has"
53
+ ];
48
54
  const PartClassesRE = /(part-\[(.+)]:)(.+)/;
49
55
  const PseudoElementsRE = new RegExp(`^(${PseudoElements.join("|")})[:-]`);
50
56
  const PseudoClassesStr = Object.keys(PseudoClasses).join("|");
57
+ const PseudoClassFunctionsStr = PseudoClassFunctions.join("|");
51
58
  const PseudoClassesRE = new RegExp(`^(${PseudoClassesStr})[:-]`);
52
- const PseudoClassesNotRE = new RegExp(`^not-(${PseudoClassesStr})[:-]`);
53
- const PseudoClassesGroupRE = new RegExp(`^group-((not-)?(${PseudoClassesStr}))[:-]`);
54
- const PseudoClassesPeerRE = new RegExp(`^peer-((not-)?(${PseudoClassesStr}))[:-]`);
59
+ const PseudoClassFunctionsRE = new RegExp(`^(${PseudoClassFunctionsStr})-(${PseudoClassesStr})[:-]`);
60
+ function shouldAdd(entires) {
61
+ return !entires.find((i) => i[0] === CONTROL_BYPASS_PSEUDO_CLASS) || void 0;
62
+ }
63
+ const taggedPseudoClassMatcher = (tag, parent, combinator) => {
64
+ const re = new RegExp(`^${tag}-((?:(${PseudoClassFunctionsStr})-)?(${PseudoClassesStr}))[:-]`);
65
+ const rawRe = new RegExp(`^${escapeRegExp(parent)}:`);
66
+ return (input) => {
67
+ const match = input.match(re);
68
+ if (match) {
69
+ let pseudo = PseudoClasses[match[3]] || match[3];
70
+ if (match[2])
71
+ pseudo = `${match[2]}(:${pseudo})`;
72
+ return {
73
+ matcher: input.slice(match[1].length + tag.length + 2),
74
+ selector: (s, body) => {
75
+ return shouldAdd(body) && rawRe.test(s) ? s.replace(rawRe, `${parent}:${pseudo}:`) : `${parent}:${pseudo}${combinator}${s}`;
76
+ }
77
+ };
78
+ }
79
+ };
80
+ };
55
81
  const variantPseudoElements = (input) => {
56
82
  const match = input.match(PseudoElementsRE);
57
83
  if (match) {
@@ -61,12 +87,9 @@ const variantPseudoElements = (input) => {
61
87
  };
62
88
  }
63
89
  };
64
- function shouldAdd(entires) {
65
- return !entires.find((i) => i[0] === CONTROL_BYPASS_PSEUDO_CLASS) || void 0;
66
- }
67
90
  const variantPseudoClasses = {
68
91
  match: (input) => {
69
- let match = input.match(PseudoClassesRE);
92
+ const match = input.match(PseudoClassesRE);
70
93
  if (match) {
71
94
  const pseudo = PseudoClasses[match[1]] || match[1];
72
95
  return {
@@ -74,37 +97,34 @@ const variantPseudoClasses = {
74
97
  selector: (s, body) => shouldAdd(body) && `${s}:${pseudo}`
75
98
  };
76
99
  }
77
- match = input.match(PseudoClassesNotRE);
78
- if (match) {
79
- const pseudo = PseudoClasses[match[1]] || match[1];
80
- return {
81
- matcher: input.slice(match[1].length + 5),
82
- selector: (s, body) => shouldAdd(body) && `${s}:not(:${pseudo})`
83
- };
84
- }
85
- match = input.match(PseudoClassesGroupRE);
86
- if (match) {
87
- let pseudo = PseudoClasses[match[3]] || match[3];
88
- if (match[2])
89
- pseudo = `not(:${pseudo})`;
90
- return {
91
- matcher: input.slice(match[1].length + 7),
92
- selector: (s, body) => shouldAdd(body) && s.includes(".group:") ? s.replace(/\.group:/, `.group:${pseudo}:`) : `.group:${pseudo} ${s}`
93
- };
94
- }
95
- match = input.match(PseudoClassesPeerRE);
100
+ },
101
+ multiPass: true
102
+ };
103
+ const variantPseudoClassFunctions = {
104
+ match: (input) => {
105
+ const match = input.match(PseudoClassFunctionsRE);
96
106
  if (match) {
97
- let pseudo = PseudoClasses[match[3]] || match[3];
98
- if (match[2])
99
- pseudo = `not(:${pseudo})`;
107
+ const fn = match[1];
108
+ const pseudo = PseudoClasses[match[2]] || match[2];
100
109
  return {
101
- matcher: input.slice(match[1].length + 6),
102
- selector: (s, body) => shouldAdd(body) && s.includes(".peer:") ? s.replace(/\.peer:/, `.peer:${pseudo}:`) : `.peer:${pseudo}~${s}`
110
+ matcher: input.slice(match[1].length + match[2].length + 2),
111
+ selector: (s, body) => shouldAdd(body) && `${s}:${fn}(:${pseudo})`
103
112
  };
104
113
  }
105
114
  },
106
115
  multiPass: true
107
116
  };
117
+ const variantTaggedPseudoClasses = {
118
+ match: (input, { options: { attributifyPseudo } }) => {
119
+ const g = taggedPseudoClassMatcher("group", attributifyPseudo ? '[group=""]' : ".group", " ")(input);
120
+ if (g)
121
+ return g;
122
+ const p = taggedPseudoClassMatcher("peer", attributifyPseudo ? '[peer=""]' : ".peer", "~")(input);
123
+ if (p)
124
+ return p;
125
+ },
126
+ multiPass: true
127
+ };
108
128
  const partClasses = {
109
129
  match: (input) => {
110
130
  const match = input.match(PartClassesRE);
@@ -121,4 +141,4 @@ const partClasses = {
121
141
  multiPass: true
122
142
  };
123
143
 
124
- export { CONTROL_BYPASS_PSEUDO_CLASS as C, PseudoClasses as P, variantPseudoElements as a, partClasses as p, variantPseudoClasses as v };
144
+ export { CONTROL_BYPASS_PSEUDO_CLASS as C, variantPseudoClassFunctions as a, variantTaggedPseudoClasses as b, variantPseudoElements as c, partClasses as p, variantPseudoClasses as v };
@@ -1,4 +1,4 @@
1
- import { T as Theme } from './types-7963d0b3';
1
+ import { T as Theme } from './types-a2d2b52f';
2
2
 
3
3
  declare const colors: Theme['colors'];
4
4
 
package/dist/colors.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { c as colors } from './colors-d6b5a5b4';
2
- import './types-7963d0b3';
1
+ export { c as colors } from './colors-6d634692';
2
+ import './types-a2d2b52f';
@@ -1,4 +1,4 @@
1
- import { T as Theme } from './types-7963d0b3';
1
+ import { T as Theme } from './types-a2d2b52f';
2
2
 
3
3
  declare const theme: Theme;
4
4
 
package/dist/index.cjs CHANGED
@@ -11,16 +11,27 @@ require('@unocss/core');
11
11
  require('./chunks/pseudo.cjs');
12
12
  require('./chunks/variants.cjs');
13
13
 
14
- const presetMini = (options = {}) => ({
15
- name: "@unocss/preset-mini",
16
- theme: _default.theme,
17
- rules: _default$1.rules,
18
- variants: [
19
- ..._default$2.variants,
20
- ...options.dark === "media" ? _default$2.variantColorsMedia : _default$2.variantColorsClass
21
- ],
22
- options
23
- });
14
+ const presetMini = (options = {}) => {
15
+ options.dark = options.dark ?? "class";
16
+ options.attributifyPseudo = options.attributifyPseudo ?? false;
17
+ return {
18
+ name: "@unocss/preset-mini",
19
+ theme: _default.theme,
20
+ rules: _default$1.rules,
21
+ variants: _default$2.variants,
22
+ options,
23
+ postprocess: options.variablePrefix && options.variablePrefix !== "un-" ? VarPrefixPostprocessor(options.variablePrefix) : void 0
24
+ };
25
+ };
26
+ function VarPrefixPostprocessor(prefix) {
27
+ return (obj) => {
28
+ obj.entries.forEach((i) => {
29
+ i[0] = i[0].replace(/^--un-/, `--${prefix}`);
30
+ if (typeof i[1] === "string")
31
+ i[1] = i[1].replace(/var\(--un-/g, `var(--${prefix}`);
32
+ });
33
+ };
34
+ }
24
35
 
25
36
  exports.theme = _default.theme;
26
37
  exports.colors = colors.colors;
package/dist/index.d.ts CHANGED
@@ -1,14 +1,22 @@
1
- import { Preset } from '@unocss/core';
2
- import { T as Theme } from './types-7963d0b3';
3
- export { T as Theme } from './types-7963d0b3';
4
- export { t as theme } from './default-c7c67d23';
5
- export { c as colors } from './colors-d6b5a5b4';
1
+ import { PresetOptions, Preset } from '@unocss/core';
2
+ import { T as Theme } from './types-a2d2b52f';
3
+ export { T as Theme, a as ThemeAnimation } from './types-a2d2b52f';
4
+ export { t as theme } from './default-958434b6';
5
+ export { c as colors } from './colors-6d634692';
6
6
 
7
- interface PresetMiniOptions {
7
+ interface PresetMiniOptions extends PresetOptions {
8
8
  /**
9
9
  * @default 'class'
10
10
  */
11
11
  dark?: 'class' | 'media';
12
+ /**
13
+ * @default false
14
+ */
15
+ attributifyPseudo?: Boolean;
16
+ /**
17
+ * @default 'un-'
18
+ */
19
+ variablePrefix?: string;
12
20
  }
13
21
  declare const presetMini: (options?: PresetMiniOptions) => Preset<Theme>;
14
22
 
package/dist/index.mjs CHANGED
@@ -1,22 +1,33 @@
1
1
  import { t as theme } from './chunks/default.mjs';
2
2
  export { t as theme } from './chunks/default.mjs';
3
3
  import { r as rules } from './chunks/default2.mjs';
4
- import { v as variants, a as variantColorsMedia, b as variantColorsClass } from './chunks/default3.mjs';
4
+ import { v as variants } from './chunks/default3.mjs';
5
5
  export { c as colors } from './chunks/colors.mjs';
6
6
  import './chunks/utilities.mjs';
7
7
  import '@unocss/core';
8
8
  import './chunks/pseudo.mjs';
9
9
  import './chunks/variants.mjs';
10
10
 
11
- const presetMini = (options = {}) => ({
12
- name: "@unocss/preset-mini",
13
- theme,
14
- rules,
15
- variants: [
16
- ...variants,
17
- ...options.dark === "media" ? variantColorsMedia : variantColorsClass
18
- ],
19
- options
20
- });
11
+ const presetMini = (options = {}) => {
12
+ options.dark = options.dark ?? "class";
13
+ options.attributifyPseudo = options.attributifyPseudo ?? false;
14
+ return {
15
+ name: "@unocss/preset-mini",
16
+ theme,
17
+ rules,
18
+ variants,
19
+ options,
20
+ postprocess: options.variablePrefix && options.variablePrefix !== "un-" ? VarPrefixPostprocessor(options.variablePrefix) : void 0
21
+ };
22
+ };
23
+ function VarPrefixPostprocessor(prefix) {
24
+ return (obj) => {
25
+ obj.entries.forEach((i) => {
26
+ i[0] = i[0].replace(/^--un-/, `--${prefix}`);
27
+ if (typeof i[1] === "string")
28
+ i[1] = i[1].replace(/var\(--un-/g, `var(--${prefix}`);
29
+ });
30
+ };
31
+ }
21
32
 
22
33
  export { presetMini as default, presetMini };
package/dist/rules.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Rule } from '@unocss/core';
2
- import { T as Theme } from './types-7963d0b3';
2
+ import { T as Theme } from './types-a2d2b52f';
3
3
 
4
4
  declare const verticalAligns: Rule[];
5
5
  declare const textAligns: Rule[];
package/dist/theme.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { c as colors } from './colors-d6b5a5b4';
2
- export { t as theme } from './default-c7c67d23';
3
- import { T as Theme } from './types-7963d0b3';
4
- export { T as Theme } from './types-7963d0b3';
1
+ export { c as colors } from './colors-6d634692';
2
+ export { t as theme } from './default-958434b6';
3
+ import { T as Theme } from './types-a2d2b52f';
4
+ export { T as Theme, a as ThemeAnimation } from './types-a2d2b52f';
5
5
 
6
6
  declare const blur: {
7
7
  DEFAULT: string;
@@ -1,3 +1,9 @@
1
+ interface ThemeAnimation {
2
+ keyframes?: Record<string, string>;
3
+ durations?: Record<string, string>;
4
+ timingFns?: Record<string, string>;
5
+ properties?: Record<string, object>;
6
+ }
1
7
  interface Theme {
2
8
  width?: Record<string, string>;
3
9
  height?: Record<string, string>;
@@ -19,6 +25,7 @@ interface Theme {
19
25
  textStrokeWidth?: Record<string, string>;
20
26
  blur?: Record<string, string>;
21
27
  dropShadow?: Record<string, string | string[]>;
28
+ animation?: ThemeAnimation;
22
29
  }
23
30
 
24
- export { Theme as T };
31
+ export { Theme as T, ThemeAnimation as a };
package/dist/utils.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as _unocss_core from '@unocss/core';
2
2
  import { VariantHandler, DynamicMatcher, ParsedColorValue } from '@unocss/core';
3
- import { T as Theme } from './types-7963d0b3';
3
+ import { T as Theme } from './types-a2d2b52f';
4
4
 
5
5
  declare const directionMap: Record<string, string[]>;
6
6
  declare const cornerMap: Record<string, string[]>;
package/dist/variants.cjs CHANGED
@@ -10,15 +10,16 @@ require('@unocss/core');
10
10
 
11
11
 
12
12
  exports.variantBreakpoints = _default.variantBreakpoints;
13
- exports.variantColorsClass = _default.variantColorsClass;
14
- exports.variantColorsMedia = _default.variantColorsMedia;
13
+ exports.variantColorsMediaOrClass = _default.variantColorsMediaOrClass;
15
14
  exports.variantCombinators = _default.variantCombinators;
16
15
  exports.variantImportant = _default.variantImportant;
17
16
  exports.variantNegative = _default.variantNegative;
17
+ exports.variantPrint = _default.variantPrint;
18
18
  exports.variantSpace = _default.variantSpace;
19
19
  exports.variants = _default.variants;
20
20
  exports.CONTROL_BYPASS_PSEUDO_CLASS = pseudo.CONTROL_BYPASS_PSEUDO_CLASS;
21
- exports.PseudoClasses = pseudo.PseudoClasses;
22
21
  exports.partClasses = pseudo.partClasses;
22
+ exports.variantPseudoClassFunctions = pseudo.variantPseudoClassFunctions;
23
23
  exports.variantPseudoClasses = pseudo.variantPseudoClasses;
24
24
  exports.variantPseudoElements = pseudo.variantPseudoElements;
25
+ exports.variantTaggedPseudoClasses = pseudo.variantTaggedPseudoClasses;
@@ -1,12 +1,11 @@
1
1
  import { Variant, VariantFunction, VariantObject } from '@unocss/core';
2
- import { T as Theme } from './types-7963d0b3';
2
+ import { T as Theme } from './types-a2d2b52f';
3
3
 
4
4
  declare const variantBreakpoints: Variant<Theme>;
5
5
 
6
6
  declare const variantCombinators: Variant[];
7
7
 
8
- declare const variantColorsClass: Variant[];
9
- declare const variantColorsMedia: Variant[];
8
+ declare const variantColorsMediaOrClass: Variant[];
10
9
 
11
10
  declare const variants: Variant<Theme>[];
12
11
 
@@ -14,10 +13,13 @@ declare const variantImportant: Variant;
14
13
  declare const variantNegative: Variant;
15
14
  declare const variantSpace: Variant;
16
15
 
16
+ declare const variantPrint: VariantFunction;
17
+
17
18
  declare const CONTROL_BYPASS_PSEUDO_CLASS = "$$no-pseudo";
18
- declare const PseudoClasses: Record<string, string | undefined>;
19
19
  declare const variantPseudoElements: VariantFunction;
20
20
  declare const variantPseudoClasses: VariantObject;
21
+ declare const variantPseudoClassFunctions: VariantObject;
22
+ declare const variantTaggedPseudoClasses: VariantObject;
21
23
  declare const partClasses: VariantObject;
22
24
 
23
- export { CONTROL_BYPASS_PSEUDO_CLASS, PseudoClasses, partClasses, variantBreakpoints, variantColorsClass, variantColorsMedia, variantCombinators, variantImportant, variantNegative, variantPseudoClasses, variantPseudoElements, variantSpace, variants };
25
+ export { CONTROL_BYPASS_PSEUDO_CLASS, partClasses, variantBreakpoints, variantColorsMediaOrClass, variantCombinators, variantImportant, variantNegative, variantPrint, variantPseudoClassFunctions, variantPseudoClasses, variantPseudoElements, variantSpace, variantTaggedPseudoClasses, variants };
package/dist/variants.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as variantBreakpoints, b as variantColorsClass, a as variantColorsMedia, d as variantCombinators, e as variantImportant, f as variantNegative, g as variantSpace, v as variants } from './chunks/default3.mjs';
2
- export { C as CONTROL_BYPASS_PSEUDO_CLASS, P as PseudoClasses, p as partClasses, v as variantPseudoClasses, a as variantPseudoElements } from './chunks/pseudo.mjs';
1
+ export { a as variantBreakpoints, c as variantColorsMediaOrClass, b as variantCombinators, d as variantImportant, e as variantNegative, g as variantPrint, f as variantSpace, v as variants } from './chunks/default3.mjs';
2
+ export { C as CONTROL_BYPASS_PSEUDO_CLASS, p as partClasses, a as variantPseudoClassFunctions, v as variantPseudoClasses, c as variantPseudoElements, b as variantTaggedPseudoClasses } from './chunks/pseudo.mjs';
3
3
  import './chunks/variants.mjs';
4
4
  import '@unocss/core';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-mini",
3
- "version": "0.17.3",
3
+ "version": "0.20.0",
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.17.3"
64
+ "@unocss/core": "0.20.0"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "unbuild",