@unocss/preset-mini 0.44.0 → 0.44.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.
@@ -112,10 +112,11 @@ const variantCustomMedia = {
112
112
  };
113
113
 
114
114
  const variantColorsMediaOrClass = (options = {}) => {
115
- if (options?.dark === "class") {
115
+ if (options?.dark === "class" || typeof options.dark === "object") {
116
+ const { dark = ".dark", light = ".light" } = typeof options.dark === "string" ? {} : options.dark;
116
117
  return [
117
- variants$1.variantMatcher("dark", (input) => ({ prefix: `.dark $$ ${input.prefix}` })),
118
- variants$1.variantMatcher("light", (input) => ({ prefix: `.light $$ ${input.prefix}` }))
118
+ variants$1.variantMatcher("dark", (input) => ({ prefix: `${dark} $$ ${input.prefix}` })),
119
+ variants$1.variantMatcher("light", (input) => ({ prefix: `${light} $$ ${input.prefix}` }))
119
120
  ];
120
121
  }
121
122
  return [
@@ -110,10 +110,11 @@ const variantCustomMedia = {
110
110
  };
111
111
 
112
112
  const variantColorsMediaOrClass = (options = {}) => {
113
- if (options?.dark === "class") {
113
+ if (options?.dark === "class" || typeof options.dark === "object") {
114
+ const { dark = ".dark", light = ".light" } = typeof options.dark === "string" ? {} : options.dark;
114
115
  return [
115
- variantMatcher("dark", (input) => ({ prefix: `.dark $$ ${input.prefix}` })),
116
- variantMatcher("light", (input) => ({ prefix: `.light $$ ${input.prefix}` }))
116
+ variantMatcher("dark", (input) => ({ prefix: `${dark} $$ ${input.prefix}` })),
117
+ variantMatcher("light", (input) => ({ prefix: `${light} $$ ${input.prefix}` }))
117
118
  ];
118
119
  }
119
120
  return [
package/dist/index.d.ts CHANGED
@@ -7,16 +7,36 @@ export { p as parseColor } from './utilities-00da4436.js';
7
7
 
8
8
  declare const preflights: Preflight[];
9
9
 
10
+ interface DarkModeSelectors {
11
+ /**
12
+ * Selector for light variant.
13
+ *
14
+ * @default '.light'
15
+ */
16
+ light?: string;
17
+ /**
18
+ * Selector for dark variant.
19
+ *
20
+ * @default '.dark'
21
+ */
22
+ dark?: string;
23
+ }
10
24
  interface PresetMiniOptions extends PresetOptions {
11
25
  /**
26
+ * Dark mode options
27
+ *
12
28
  * @default 'class'
13
29
  */
14
- dark?: 'class' | 'media';
30
+ dark?: 'class' | 'media' | DarkModeSelectors;
15
31
  /**
32
+ * Generate pesudo selector as `[group=""]` instead of `.group`
33
+ *
16
34
  * @default false
17
35
  */
18
36
  attributifyPseudo?: Boolean;
19
37
  /**
38
+ * Prefix for CSS variables.
39
+ *
20
40
  * @default 'un-'
21
41
  */
22
42
  variablePrefix?: string;
@@ -29,4 +49,4 @@ interface PresetMiniOptions extends PresetOptions {
29
49
  }
30
50
  declare const presetMini: (options?: PresetMiniOptions) => Preset<Theme>;
31
51
 
32
- export { PresetMiniOptions, presetMini as default, preflights, presetMini };
52
+ export { DarkModeSelectors, PresetMiniOptions, presetMini as default, preflights, presetMini };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/preset-mini",
3
- "version": "0.44.0",
3
+ "version": "0.44.3",
4
4
  "description": "The minimal preset for UnoCSS",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -61,7 +61,7 @@
61
61
  "*.css"
62
62
  ],
63
63
  "dependencies": {
64
- "@unocss/core": "0.44.0"
64
+ "@unocss/core": "0.44.3"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "unbuild",