@unocss/preset-mini 0.50.8 → 0.51.1

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
@@ -2,13 +2,14 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ const extractorArbitraryVariants = require('@unocss/extractor-arbitrary-variants');
5
6
  const core = require('@unocss/core');
6
7
  require('./shared/preset-mini.fea712fb.cjs');
7
8
  const _default$1 = require('./shared/preset-mini.4b2d3970.cjs');
8
9
  const colors$1 = require('./shared/preset-mini.2be263e2.cjs');
9
10
  const colors = require('./shared/preset-mini.bb7dc365.cjs');
10
11
  const _default = require('./shared/preset-mini.2c84a1da.cjs');
11
- const _default$2 = require('./shared/preset-mini.a8322582.cjs');
12
+ const _default$2 = require('./shared/preset-mini.d5c98806.cjs');
12
13
  require('./shared/preset-mini.c4fc86b9.cjs');
13
14
 
14
15
  const preflights = [
@@ -35,9 +36,10 @@ function presetMini(options = {}) {
35
36
  rules: _default$1.rules,
36
37
  variants: _default$2.variants(options),
37
38
  options,
39
+ prefix: options.prefix,
38
40
  postprocess: VarPrefixPostprocessor(options.variablePrefix),
39
41
  preflights: options.preflight ? normalizePreflights(preflights, options.variablePrefix) : [],
40
- prefix: options.prefix
42
+ extractorDefault: options.arbitraryVariants === false ? void 0 : extractorArbitraryVariants.extractorArbitraryVariants
41
43
  };
42
44
  }
43
45
  function VarPrefixPostprocessor(prefix) {
package/dist/index.d.ts CHANGED
@@ -29,7 +29,7 @@ interface PresetMiniOptions extends PresetOptions {
29
29
  */
30
30
  dark?: 'class' | 'media' | DarkModeSelectors;
31
31
  /**
32
- * Generate psuedo selector as `[group=""]` instead of `.group`
32
+ * Generate pseudo selector as `[group=""]` instead of `.group`
33
33
  *
34
34
  * @default false
35
35
  */
@@ -52,6 +52,14 @@ interface PresetMiniOptions extends PresetOptions {
52
52
  * @default true
53
53
  */
54
54
  preflight?: boolean;
55
+ /**
56
+ * Enable arbitrary variants, for example `<div class="[&>*]:m-1 [&[open]]:p-2"></div>`.
57
+ *
58
+ * Disable this might slightly improve the performance.
59
+ *
60
+ * @default true
61
+ */
62
+ arbitraryVariants?: boolean;
55
63
  }
56
64
  declare function presetMini(options?: PresetMiniOptions): Preset<Theme>;
57
65
 
package/dist/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { extractorArbitraryVariants } from '@unocss/extractor-arbitrary-variants';
1
2
  import { entriesToCss, toArray } from '@unocss/core';
2
3
  import './shared/preset-mini.94514c53.mjs';
3
4
  import { r as rules } from './shared/preset-mini.b53c93f8.mjs';
@@ -5,7 +6,7 @@ export { p as parseColor } from './shared/preset-mini.617e6696.mjs';
5
6
  export { c as colors } from './shared/preset-mini.74b45c11.mjs';
6
7
  import { t as theme } from './shared/preset-mini.d3cd9ef2.mjs';
7
8
  export { t as theme } from './shared/preset-mini.d3cd9ef2.mjs';
8
- import { v as variants } from './shared/preset-mini.b68b942d.mjs';
9
+ import { v as variants } from './shared/preset-mini.6c99525c.mjs';
9
10
  import './shared/preset-mini.6c20780a.mjs';
10
11
 
11
12
  const preflights = [
@@ -32,9 +33,10 @@ function presetMini(options = {}) {
32
33
  rules,
33
34
  variants: variants(options),
34
35
  options,
36
+ prefix: options.prefix,
35
37
  postprocess: VarPrefixPostprocessor(options.variablePrefix),
36
38
  preflights: options.preflight ? normalizePreflights(preflights, options.variablePrefix) : [],
37
- prefix: options.prefix
39
+ extractorDefault: options.arbitraryVariants === false ? void 0 : extractorArbitraryVariants
38
40
  };
39
41
  }
40
42
  function VarPrefixPostprocessor(prefix) {
@@ -475,9 +475,15 @@ const PseudoClassesStr = Object.entries(PseudoClasses).filter(([, pseudo]) => !p
475
475
  const PseudoClassesColonStr = Object.entries(PseudoClassesColon).filter(([, pseudo]) => !pseudo.startsWith("::")).map(([key]) => key).join("|");
476
476
  const PseudoClassFunctionsStr = PseudoClassFunctions.join("|");
477
477
  function pseudoModifier(pseudo) {
478
+ if (pseudo === "focus") {
479
+ return {
480
+ sort: 10,
481
+ noMerge: true
482
+ };
483
+ }
478
484
  if (pseudo === "active") {
479
485
  return {
480
- sort: 1,
486
+ sort: 20,
481
487
  noMerge: true
482
488
  };
483
489
  }
@@ -477,9 +477,15 @@ const PseudoClassesStr = Object.entries(PseudoClasses).filter(([, pseudo]) => !p
477
477
  const PseudoClassesColonStr = Object.entries(PseudoClassesColon).filter(([, pseudo]) => !pseudo.startsWith("::")).map(([key]) => key).join("|");
478
478
  const PseudoClassFunctionsStr = PseudoClassFunctions.join("|");
479
479
  function pseudoModifier(pseudo) {
480
+ if (pseudo === "focus") {
481
+ return {
482
+ sort: 10,
483
+ noMerge: true
484
+ };
485
+ }
480
486
  if (pseudo === "active") {
481
487
  return {
482
- sort: 1,
488
+ sort: 20,
483
489
  noMerge: true
484
490
  };
485
491
  }
package/dist/variants.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const _default = require('./shared/preset-mini.a8322582.cjs');
5
+ const _default = require('./shared/preset-mini.d5c98806.cjs');
6
6
  require('./shared/preset-mini.2be263e2.cjs');
7
7
  require('@unocss/core');
8
8
  require('./shared/preset-mini.c4fc86b9.cjs');
package/dist/variants.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { c as calcMaxWidthBySize, u as partClasses, a as variantAria, b as variantBreakpoints, f as variantColorsMediaOrClass, d as variantCombinators, e as variantContainerQuery, m as variantCssLayer, k as variantCustomMedia, g as variantDataAttribute, i as variantImportant, n as variantInternalLayer, h as variantLanguageDirections, q as variantNegative, j as variantPrint, s as variantPseudoClassFunctions, r as variantPseudoClassesAndElements, o as variantScope, l as variantSelector, w as variantSupports, t as variantTaggedPseudoClasses, p as variantVariables, v as variants } from './shared/preset-mini.b68b942d.mjs';
1
+ export { c as calcMaxWidthBySize, u as partClasses, a as variantAria, b as variantBreakpoints, f as variantColorsMediaOrClass, d as variantCombinators, e as variantContainerQuery, m as variantCssLayer, k as variantCustomMedia, g as variantDataAttribute, i as variantImportant, n as variantInternalLayer, h as variantLanguageDirections, q as variantNegative, j as variantPrint, s as variantPseudoClassFunctions, r as variantPseudoClassesAndElements, o as variantScope, l as variantSelector, w as variantSupports, t as variantTaggedPseudoClasses, p as variantVariables, v as variants } from './shared/preset-mini.6c99525c.mjs';
2
2
  import './shared/preset-mini.617e6696.mjs';
3
3
  import '@unocss/core';
4
4
  import './shared/preset-mini.6c20780a.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-mini",
3
- "version": "0.50.8",
3
+ "version": "0.51.1",
4
4
  "description": "The minimal preset for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -61,7 +61,8 @@
61
61
  "*.css"
62
62
  ],
63
63
  "dependencies": {
64
- "@unocss/core": "0.50.8"
64
+ "@unocss/core": "0.51.1",
65
+ "@unocss/extractor-arbitrary-variants": "0.51.1"
65
66
  },
66
67
  "scripts": {
67
68
  "build": "unbuild",