unocss-preset-magicolor 0.1.0 → 0.3.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.
@@ -0,0 +1,59 @@
1
+ import { mc as f } from "magic-color";
2
+ function r(t) {
3
+ return t && Number.parseFloat(t.toString()) || 0;
4
+ }
5
+ function g(t) {
6
+ if (!t)
7
+ return;
8
+ if (t.type === "oklch")
9
+ return t.components[0].toString().includes("%") && (t.components[0] = r(t.components[0]) / 100), t.components = t.components.map(r), t;
10
+ const n = f(
11
+ t.type === "hex" ? t.components[0].toString() : t.components,
12
+ t.type
13
+ ).toOklch().values;
14
+ if (n)
15
+ return {
16
+ type: "oklch",
17
+ components: [n[0] / 100, n[1], n[2]],
18
+ alpha: t.alpha
19
+ };
20
+ }
21
+ function u(t) {
22
+ return Math.round(t * 1e3) / 1e3;
23
+ }
24
+ const m = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
25
+ function b(t) {
26
+ let n = Number(t);
27
+ n = n <= 50 ? 50 : n, n = n >= 950 ? 950 : n;
28
+ let o = Math.floor(n / 100) * 100;
29
+ o = o <= 50 ? 50 : o;
30
+ let e = Math.floor((n + 100) / 100) * 100;
31
+ return e = e >= 950 ? 950 : e, { originDepth: n, beforeDepth: o, afterDepth: e };
32
+ }
33
+ function N(t) {
34
+ return !t || !Number.isNaN(Number(t)) ? (console.error(`[unocss-preset-margicolor] The color '${t}' is invalid.`), !0) : !1;
35
+ }
36
+ function $(t) {
37
+ const { originDepth: n, beforeDepth: o, beforeComponents: e, afterComponents: i } = t, a = (n - o) / (n < 100 || n > 900 ? 50 : 100);
38
+ return `oklch(${Array.from({ length: 3 }).map((l, c) => {
39
+ const p = r(e[c]) + (r(i[c]) - r(e[c])) * a;
40
+ return u(p);
41
+ }).join(" ")})`;
42
+ }
43
+ function k(t, n) {
44
+ const o = {};
45
+ for (const e of m)
46
+ if (n[e]) {
47
+ const i = n[e].components;
48
+ o[`--mc-${t}-${e}-l`] = u(r(i[0])), o[`--mc-${t}-${e}-c`] = u(r(i[1])), o[`--mc-${t}-${e}-h`] = u(r(i[2]));
49
+ }
50
+ return o;
51
+ }
52
+ export {
53
+ g as a,
54
+ $ as c,
55
+ k as g,
56
+ N as i,
57
+ b as r,
58
+ m as t
59
+ };
package/dist/helper.js CHANGED
@@ -1,5 +1,40 @@
1
- function o() {
1
+ import { mc as m } from "magic-color";
2
+ import { i as h, t as C, a as g, c as d, g as u, r as b } from "./common-Dv0krm1V.js";
3
+ function M(p) {
4
+ const { name: c, color: a, dom: i } = p;
5
+ if (!i)
6
+ return;
7
+ const s = a?.split(/-\d+-?/)[0];
8
+ if (h(s))
9
+ return;
10
+ const e = {}, t = {};
11
+ try {
12
+ if (m.valid(s)) {
13
+ e[`--mc-${c}-color`] = s;
14
+ const o = m.theme(s, { type: "hex" });
15
+ for (const r of C) {
16
+ const n = g({ type: "hex", components: [o[r]], alpha: 1 });
17
+ t[r] = n;
18
+ }
19
+ }
20
+ } catch (o) {
21
+ console.error(`[updateMagicColor] get ${s} theme fail, please use another color.`), console.error(o);
22
+ }
23
+ const l = a.match(/.*-(\d+)/)?.[1];
24
+ if (l) {
25
+ const { originDepth: o, beforeDepth: r, afterDepth: n } = b(l);
26
+ t[r] && t[n] && (e[`--mc-${c}-color`] = d({
27
+ originDepth: o,
28
+ beforeDepth: r,
29
+ beforeComponents: t[r].components,
30
+ afterComponents: t[n].components
31
+ }));
32
+ }
33
+ const f = u(c, t);
34
+ Object.assign(e, f);
35
+ for (const o in e)
36
+ e[o] && i.style.setProperty(o, e[o].toString());
2
37
  }
3
38
  export {
4
- o as updateMagicColor
39
+ M as updateMagicColor
5
40
  };
package/dist/index.js CHANGED
@@ -1,136 +1,111 @@
1
- import { notLastChildSelectorVariant as A } from "@unocss/preset-wind4/rules";
2
- import { colorCSSGenerator as H, parseColor as y, defineProperty as f, generateThemeVariable as B, themeTracking as I, detectThemeValue as G, h as x, SpecialColorKey as F, numberResolver as R, hyphenate as D } from "@unocss/preset-wind4/utils";
3
- import { converter as q, formatHex as K } from "culori";
4
- import { mc as N } from "magic-color";
5
- import { notNull as J } from "unocss";
6
- const Q = q("oklch");
7
- function h(r) {
8
- return r && Number.parseFloat(r.toString()) || 0;
9
- }
10
- function C(r) {
11
- if (!r)
12
- return;
13
- if (r.type === "oklch")
14
- return r.components[0].toString().includes("%") && (r.components[0] = h(r.components[0]) / 100), r.components = r.components.map(h), r;
15
- const o = r.components.join(" "), e = Q(r.type === "hex" ? o : `${r.type}(${o})`);
16
- if (e)
17
- return {
18
- type: "oklch",
19
- components: [e.l, e.c, e.h ?? 0],
20
- alpha: r.alpha
21
- };
22
- }
23
- const M = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
24
- function O(r) {
25
- let o = Number(r);
26
- o = o <= 50 ? 50 : o, o = o >= 950 ? 950 : o;
27
- let e = Math.floor(o / 100) * 100;
28
- e = e <= 50 ? 50 : e;
29
- let n = Math.floor((o + 100) / 100) * 100;
30
- return n = n >= 950 ? 950 : n, { originDepth: o, beforeDepth: e, afterDepth: n };
31
- }
32
- function U(r, o) {
33
- let e = y(r, o);
34
- if (e?.color)
35
- return e;
36
- const [n, a, c] = r.split(/[:/]/), s = n.match(/.*-(\d+)/)?.[1], t = n?.split(/-\d+-?/)[0];
37
- if (e = {
1
+ import { colorCSSGenerator as R, parseColor as f, defineProperty as m, generateThemeVariable as B, themeTracking as z, detectThemeValue as E, h, SpecialColorKey as G, numberResolver as M, hyphenate as C } from "@unocss/preset-wind4/utils";
2
+ import { mc as y } from "magic-color";
3
+ import { r as V, t as v, i as L, a as x, c as P, g as H } from "./common-Dv0krm1V.js";
4
+ import { notNull as U } from "unocss";
5
+ import { notLastChildSelectorVariant as q } from "@unocss/preset-wind4/rules";
6
+ function A(e, o) {
7
+ let r = f(e, o);
8
+ if (r?.color)
9
+ return r;
10
+ const [t, a, s] = e.split(/[:/]/), c = t.match(/.*-(\d+)/)?.[1], n = t?.split(/-\d+-?/)[0];
11
+ if (r = {
38
12
  opacity: a,
39
- modifier: c,
40
- name: t,
41
- no: s,
13
+ modifier: s,
14
+ name: n,
15
+ no: c,
42
16
  color: "",
43
17
  alpha: a && `${a}%`,
44
18
  keys: void 0,
45
19
  cssColor: void 0
46
- }, !t || !Number.isNaN(Number(t)))
47
- return console.error(`[unocss-preset-margicolor][mc-${r}] The color '${t}' is invalid.`), e;
48
- if (!s)
49
- return e;
50
- const { originDepth: i, beforeDepth: u, afterDepth: $ } = O(s);
51
- let l = y(`${t}-${u}`, o)?.cssColor, m = y(`${t}-${$}`, o)?.cssColor;
52
- if (!l || !m)
20
+ }, L(n) || !c)
21
+ return r;
22
+ const { originDepth: i, beforeDepth: l, afterDepth: p } = V(c);
23
+ let $ = f(`${n}-${l}`, o)?.cssColor, d = f(`${n}-${p}`, o)?.cssColor;
24
+ if (!$ || !d)
53
25
  try {
54
- const g = y(t, o)?.color, k = g ? K(g) : void 0;
55
- if (k && N.valid(k)) {
56
- const v = N.theme(k);
57
- l || (l = C({ type: "hex", components: [v[u]], alpha: 1 })), m || (m = C({ type: "hex", components: [v[$]], alpha: 1 }));
26
+ const g = f(n, o);
27
+ if (g?.color && y.valid(g.color)) {
28
+ const b = y.theme(g.color, { type: "hex" });
29
+ $ || ($ = { type: "hex", components: [b[l]], alpha: 1 }), d || (d = { type: "hex", components: [b[p]], alpha: 1 });
58
30
  }
59
31
  } catch (g) {
60
- console.error(`[unocss-preset-margicolor] Error parsing ${r}: get ${t} theme fail, please use another color.`), console.error(g);
32
+ console.error(`[unocss-preset-margicolor] Error parsing ${e}: get ${n} theme fail, please use another color.`), console.error(g);
61
33
  }
62
- if (l = C(l), m = C(m), !l || !m)
63
- return e;
64
- const b = (i - u) / (i < 100 || i > 950 ? 50 : 100), d = Array.from({ length: 3 }).map((g, k) => {
65
- const v = l.components, w = m.components, S = h(v[k]) + (h(w[k]) - h(v[k])) * b;
66
- return `${Math.round(S * 1e3) / 1e3}`;
67
- });
68
- return e.color = `oklch(${d.join(" ")})`, e;
34
+ return $ = x($), d = x(d), !$ || !d || (r.color = P({
35
+ originDepth: i,
36
+ beforeDepth: l,
37
+ beforeComponents: $.components,
38
+ afterComponents: d.components
39
+ })), r;
69
40
  }
70
- function W(r) {
71
- const o = {};
72
- if (!r || r.color)
73
- return { colorData: r, cssVariable: o };
74
- const { name: e, no: n } = r;
75
- if (!n)
76
- return r.color = `var(--mc-${e}-color)`, { colorData: r, cssVariable: o };
77
- const { originDepth: a, beforeDepth: c, afterDepth: s } = O(n), t = `--mc-${e}-${a}-l`, i = `--mc-${e}-${a}-c`, u = `--mc-${e}-${a}-h`;
78
- if (!M.includes(a)) {
79
- const $ = (a - c) / (a < 100 || a > 950 ? 50 : 100), [l, m, b] = ["l", "c", "h"].map((d) => `calc(var(--mc-${e}-${c}-${d}) + ${$} * (var(--mc-${e}-${s}-${d}) - var(--mc-${e}-${c}-${d})))`);
80
- Object.assign(o, { [t]: l, [i]: m, [u]: b });
41
+ function F(e) {
42
+ const o = [];
43
+ if (!e || e.color)
44
+ return { colorData: e, cssVariables: o };
45
+ const { name: r, no: t } = e;
46
+ if (!t)
47
+ return e.color = `var(--mc-${r}-color)`, { colorData: e, cssVariables: o };
48
+ const { originDepth: a, beforeDepth: s, afterDepth: c } = V(t), n = `--mc-${r}-${a}-l`, i = `--mc-${r}-${a}-c`, l = `--mc-${r}-${a}-h`;
49
+ if (!v.includes(a)) {
50
+ const p = (a - s) / (a < 100 || a > 900 ? 50 : 100), [$, d, g] = ["l", "c", "h"].map((b) => {
51
+ const O = `var(--mc-${r}-${s}-${b})`, N = `var(--mc-${r}-${c}-${b})`;
52
+ return `calc(${O} + ${p} * (${N} - ${O}))`;
53
+ });
54
+ o.push({ [n]: $, [i]: d, [l]: g });
81
55
  }
82
- return r.color = `oklch(var(${t}) var(${i}) var(${u}))`, { colorData: r, cssVariable: o };
56
+ return e.color = `oklch(var(${n}) var(${i}) var(${l}))`, { colorData: e, cssVariables: o };
83
57
  }
84
- function j(r, o) {
85
- const e = U(r, o);
86
- return W(e);
58
+ function w(e, o) {
59
+ return F(
60
+ A(e, o)
61
+ );
87
62
  }
88
- function p(r, o) {
89
- return ([, e], n) => {
90
- const { colorData: a, cssVariable: c } = j(e ?? "", n.theme);
63
+ function u(e, o) {
64
+ return ([, r], t) => {
65
+ const { colorData: a, cssVariables: s } = w(r ?? "", t.theme);
91
66
  if (a?.color) {
92
- const s = H(a, r, o, n);
93
- return s && s.push({
94
- [n.symbols.selector]: (t) => t,
95
- ...c
96
- }), s;
67
+ const c = R(a, e, o, t);
68
+ return c && s.length && c.push(...s.map((n) => ({
69
+ [t.symbols.selector]: (i) => i,
70
+ ...n
71
+ }))), c;
97
72
  }
98
73
  };
99
74
  }
100
- const X = {
75
+ const J = {
101
76
  transparent: "transparent",
102
77
  current: "currentColor",
103
78
  inherit: "inherit"
104
- }, Y = {
105
- "gradient-position": f("--un-gradient-position"),
106
- "gradient-from": f("--un-gradient-from", { syntax: "<color>", initialValue: "#0000" }),
107
- "gradient-via": f("--un-gradient-via", { syntax: "<color>", initialValue: "#0000" }),
108
- "gradient-to": f("--un-gradient-to", { syntax: "<color>", initialValue: "#0000" }),
109
- "gradient-stops": f("--un-gradient-stops"),
110
- "gradient-via-stops": f("--un-gradient-via-stops"),
111
- "gradient-from-position": f("--un-gradient-from-position", { syntax: "<length-percentage>", initialValue: "0%" }),
112
- "gradient-via-position": f("--un-gradient-via-position", { syntax: "<length-percentage>", initialValue: "50%" }),
113
- "gradient-to-position": f("--un-gradient-to-position", { syntax: "<length-percentage>", initialValue: "100%" })
79
+ }, Q = {
80
+ "gradient-position": m("--un-gradient-position"),
81
+ "gradient-from": m("--un-gradient-from", { syntax: "<color>", initialValue: "#0000" }),
82
+ "gradient-via": m("--un-gradient-via", { syntax: "<color>", initialValue: "#0000" }),
83
+ "gradient-to": m("--un-gradient-to", { syntax: "<color>", initialValue: "#0000" }),
84
+ "gradient-stops": m("--un-gradient-stops"),
85
+ "gradient-via-stops": m("--un-gradient-via-stops"),
86
+ "gradient-from-position": m("--un-gradient-from-position", { syntax: "<length-percentage>", initialValue: "0%" }),
87
+ "gradient-via-position": m("--un-gradient-via-position", { syntax: "<length-percentage>", initialValue: "50%" }),
88
+ "gradient-to-position": m("--un-gradient-to-position", { syntax: "<length-percentage>", initialValue: "100%" })
114
89
  };
115
- function Z() {
116
- return function* ([, r, o], { theme: e, symbols: n }) {
117
- const a = {}, { colorData: c, cssVariable: s } = j(o, e);
118
- if (c) {
119
- const { color: t, keys: i, alpha: u } = c;
120
- if (t) {
121
- if (Object.values(X).includes(t))
122
- a[`--un-gradient-${r}`] = t;
90
+ function W() {
91
+ return function* ([, e, o], { theme: r, symbols: t }) {
92
+ const a = {}, { colorData: s, cssVariables: c } = w(o, r);
93
+ if (s) {
94
+ const { color: n, keys: i, alpha: l } = s;
95
+ if (n) {
96
+ if (Object.values(J).includes(n))
97
+ a[`--un-gradient-${e}`] = n;
123
98
  else {
124
- a[`--un-${r}-opacity`] = u;
125
- const $ = i ? B("colors", i) : t;
126
- a[`--un-gradient-${r}`] = `color-mix(in oklab, ${$} var(--un-${r}-opacity), transparent)`, yield f(`--un-${r}-opacity`, { syntax: "<percentage>", initialValue: "100%" });
99
+ a[`--un-${e}-opacity`] = l;
100
+ const p = i ? B("colors", i) : n;
101
+ a[`--un-gradient-${e}`] = `color-mix(in oklab, ${p} var(--un-${e}-opacity), transparent)`, yield m(`--un-${e}-opacity`, { syntax: "<percentage>", initialValue: "100%" });
127
102
  }
128
- i && I("colors", i), e && G(t, e);
103
+ i && z("colors", i), r && E(n, r);
129
104
  }
130
105
  } else
131
- a[`--un-gradient-${r}`] = x.bracket.cssvar(o);
132
- if (a[`--un-gradient-${r}`]) {
133
- switch (r) {
106
+ a[`--un-gradient-${e}`] = h.bracket.cssvar(o);
107
+ if (a[`--un-gradient-${e}`]) {
108
+ switch (e) {
134
109
  case "from":
135
110
  yield {
136
111
  ...a,
@@ -154,16 +129,17 @@ function Z() {
154
129
  yield { ...a };
155
130
  break;
156
131
  }
157
- for (const t of Object.values(Y))
158
- yield t;
159
- yield {
160
- [n.selector]: (t) => t,
161
- ...s
162
- };
132
+ for (const n of Object.values(Q))
133
+ yield n;
134
+ for (const n of c)
135
+ yield {
136
+ [t.selector]: (i) => i,
137
+ ...n
138
+ };
163
139
  }
164
140
  };
165
141
  }
166
- const T = {
142
+ const S = {
167
143
  l: ["-left"],
168
144
  r: ["-right"],
169
145
  t: ["-top"],
@@ -182,202 +158,218 @@ const T = {
182
158
  block: ["-block-start", "-block-end"],
183
159
  inline: ["-inline-start", "-inline-end"]
184
160
  };
185
- function V([, r = "", o], e) {
186
- if (r in T) {
187
- const { colorData: n, cssVariable: a } = j(o ?? "", e.theme);
188
- if (n) {
189
- const c = T[r].map((s) => oo(s)(n, e)).filter(J);
161
+ function k([, e = "", o], r) {
162
+ if (e in S) {
163
+ const { colorData: t, cssVariables: a } = w(o ?? "", r.theme);
164
+ if (t) {
165
+ const s = S[e].map((c) => X(c)(t, r)).filter(U);
190
166
  return [
191
- c.map((s) => s[0]).reduce((s, t) => (Object.assign(s, t), s), {}),
192
- ...c.flatMap((s) => s.slice(1)),
193
- {
194
- [e.symbols.selector]: (s) => s,
195
- ...a
196
- }
167
+ s.map((c) => c[0]).reduce((c, n) => (Object.assign(c, n), c), {}),
168
+ ...s.flatMap((c) => c.slice(1)),
169
+ ...a.map((c) => ({
170
+ [r.symbols.selector]: (n) => n,
171
+ ...c
172
+ }))
197
173
  ];
198
174
  }
199
175
  }
200
176
  }
201
- function oo(r) {
202
- return (o, e) => {
203
- const n = H(o, `border${r}-color`, `border${r}`, e);
204
- if (n) {
205
- const a = n[0];
206
- return o?.color && !Object.values(F).includes(o.color) && !o.alpha && r && r !== "" && (a[`--un-border${r}-opacity`] = "var(--un-border-opacity)"), n;
177
+ function X(e) {
178
+ return (o, r) => {
179
+ const t = R(o, `border${e}-color`, `border${e}`, r);
180
+ if (t) {
181
+ const a = t[0];
182
+ return o?.color && !Object.values(G).includes(o.color) && !o.alpha && e && e !== "" && (a[`--un-border${e}-opacity`] = "var(--un-border-opacity)"), t;
207
183
  }
208
184
  };
209
185
  }
210
- const ro = {
186
+ const Y = {
211
187
  "mask-image": "var(--un-mask-linear), var(--un-mask-radial), var(--un-mask-conic)",
212
188
  "mask-composite": "intersect"
213
- }, z = {
189
+ }, j = {
214
190
  t: ["top"],
215
191
  b: ["bottom"],
216
192
  l: ["left"],
217
193
  r: ["right"],
218
194
  x: ["left", "right"],
219
195
  y: ["top", "bottom"]
220
- }, L = "linear-gradient(#fff, #fff)";
221
- function P([r, o = "", e, n], a) {
222
- const c = { ...ro }, s = [];
223
- if (s.push(...["linear", "radial", "conic"].map((t) => f(`--un-mask-${t}`, { initialValue: L }))), o in z) {
224
- c["--un-mask-linear"] = "var(--un-mask-left), var(--un-mask-right), var(--un-mask-bottom), var(--un-mask-top)";
225
- for (const t of z[o]) {
226
- c[`--un-mask-${t}`] = `linear-gradient(to ${t}, var(--un-mask-${t}-from-color) var(--un-mask-${t}-from-position), var(--un-mask-${t}-to-color) var(--un-mask-${t}-to-position))`, R(n) != null ? (I("spacing"), c[`--un-mask-${t}-${e}-position`] = `calc(var(--spacing) * ${x.bracket.cssvar.fraction.number(n)})`) : c[`--un-mask-${t}-${e}-position`] = x.bracket.cssvar.fraction.rem(n);
227
- const i = p(`--un-mask-${t}-${e}-color`, D("colors"))([r, n], a);
196
+ }, D = "linear-gradient(#fff, #fff)";
197
+ function T([e, o = "", r, t], a) {
198
+ const s = { ...Y }, c = [];
199
+ if (c.push(...["linear", "radial", "conic"].map((n) => m(`--un-mask-${n}`, { initialValue: D }))), o in j) {
200
+ s["--un-mask-linear"] = "var(--un-mask-left), var(--un-mask-right), var(--un-mask-bottom), var(--un-mask-top)";
201
+ for (const n of j[o]) {
202
+ s[`--un-mask-${n}`] = `linear-gradient(to ${n}, var(--un-mask-${n}-from-color) var(--un-mask-${n}-from-position), var(--un-mask-${n}-to-color) var(--un-mask-${n}-to-position))`, M(t) != null ? (z("spacing"), s[`--un-mask-${n}-${r}-position`] = `calc(var(--spacing) * ${h.bracket.cssvar.fraction.number(t)})`) : s[`--un-mask-${n}-${r}-position`] = h.bracket.cssvar.fraction.rem(t);
203
+ const i = u(`--un-mask-${n}-${r}-color`, C("colors"))([e, t], a);
228
204
  if (i) {
229
- const [u, ...$] = i;
230
- Object.assign(c, u), s.push(...$);
205
+ const [l, ...p] = i;
206
+ Object.assign(s, l), c.push(...p);
231
207
  }
232
- s.push(...["from", "to"].flatMap((u) => [
233
- f(`--un-mask-${t}-${u}-position`, { syntax: "<length-percentage>", initialValue: u === "from" ? "0%" : "100%" }),
234
- f(`--un-mask-${t}-${u}-color`, { syntax: "<color>", initialValue: u === "from" ? "black" : "transparent" })
208
+ c.push(...["from", "to"].flatMap((l) => [
209
+ m(`--un-mask-${n}-${l}-position`, { syntax: "<length-percentage>", initialValue: l === "from" ? "0%" : "100%" }),
210
+ m(`--un-mask-${n}-${l}-color`, { syntax: "<color>", initialValue: l === "from" ? "black" : "transparent" })
235
211
  ]));
236
212
  }
237
- s.push(...["top", "right", "bottom", "left"].map((t) => f(`--un-mask-${t}`, { initialValue: L })));
213
+ c.push(...["top", "right", "bottom", "left"].map((n) => m(`--un-mask-${n}`, { initialValue: D })));
238
214
  } else {
239
- if (e == null)
240
- o === "radial" ? (c["--un-mask-radial"] = "radial-gradient(var(--un-mask-radial-stops, var(--un-mask-radial-size)))", c["--un-mask-radial-size"] = x.bracket.cssvar.rem(n)) : (c[`--un-mask-${o}`] = `${o}-gradient(var(--un-mask-${o}-stops, var(--un-mask-${o}-position)))`, c[`--un-mask-${o}-position`] = R(n) ? `calc(1deg * ${x.bracket.cssvar.number(n)})` : x.bracket.cssvar.fraction(n));
215
+ if (r == null)
216
+ o === "radial" ? (s["--un-mask-radial"] = "radial-gradient(var(--un-mask-radial-stops, var(--un-mask-radial-size)))", s["--un-mask-radial-size"] = h.bracket.cssvar.rem(t)) : (s[`--un-mask-${o}`] = `${o}-gradient(var(--un-mask-${o}-stops, var(--un-mask-${o}-position)))`, s[`--un-mask-${o}-position`] = M(t) ? `calc(1deg * ${h.bracket.cssvar.number(t)})` : h.bracket.cssvar.fraction(t));
241
217
  else {
242
- const t = {
218
+ const n = {
243
219
  linear: "",
244
220
  radial: "var(--un-mask-radial-shape) var(--un-mask-radial-size) at ",
245
221
  conic: "from "
246
222
  };
247
- c[`--un-mask-${o}-stops`] = `${t[o]}var(--un-mask-${o}-position), var(--un-mask-${o}-from-color) var(--un-mask-${o}-from-position), var(--un-mask-${o}-to-color) var(--un-mask-${o}-to-position)`, c[`--un-mask-${o}`] = `${o}-gradient(var(--un-mask-${o}-stops))`;
248
- const i = p(`--un-mask-${o}-${e}-color`, D("colors"))([r, n], a);
223
+ s[`--un-mask-${o}-stops`] = `${n[o]}var(--un-mask-${o}-position), var(--un-mask-${o}-from-color) var(--un-mask-${o}-from-position), var(--un-mask-${o}-to-color) var(--un-mask-${o}-to-position)`, s[`--un-mask-${o}`] = `${o}-gradient(var(--un-mask-${o}-stops))`;
224
+ const i = u(`--un-mask-${o}-${r}-color`, C("colors"))([e, t], a);
249
225
  if (i) {
250
- const [u, ...$] = i;
251
- Object.assign(c, u), s.push(...$);
226
+ const [l, ...p] = i;
227
+ Object.assign(s, l), c.push(...p);
252
228
  }
253
229
  }
254
- o === "radial" && s.push(f("--un-mask-radial-shape", { initialValue: "ellipse" }), f("--un-mask-radial-size", { initialValue: "farthest-corner" })), s.push(...["from", "to"].flatMap((t) => [
255
- f(`--un-mask-${o}-position`, { initialValue: o === "radial" ? "center" : "0deg" }),
256
- f(`--un-mask-${o}-${t}-position`, { syntax: "<length-percentage>", initialValue: t === "from" ? "0%" : "100%" }),
257
- f(`--un-mask-${o}-${t}-color`, { syntax: "<color>", initialValue: t === "from" ? "black" : "transparent" })
230
+ o === "radial" && c.push(m("--un-mask-radial-shape", { initialValue: "ellipse" }), m("--un-mask-radial-size", { initialValue: "farthest-corner" })), c.push(...["from", "to"].flatMap((n) => [
231
+ m(`--un-mask-${o}-position`, { initialValue: o === "radial" ? "center" : "0deg" }),
232
+ m(`--un-mask-${o}-${n}-position`, { syntax: "<length-percentage>", initialValue: n === "from" ? "0%" : "100%" }),
233
+ m(`--un-mask-${o}-${n}-color`, { syntax: "<color>", initialValue: n === "from" ? "black" : "transparent" })
258
234
  ]));
259
235
  }
260
- return [c, ...s];
236
+ return [s, ...c];
261
237
  }
262
- function E(r) {
263
- return (o, e) => {
264
- const n = D(r);
265
- return p(`--un-${n}-color`, n)(o, e);
238
+ function I(e) {
239
+ return (o, r) => {
240
+ const t = C(e);
241
+ return u(`--un-${t}-color`, t)(o, r);
266
242
  };
267
243
  }
268
- const eo = [
244
+ function Z(e, o) {
245
+ const r = e?.split(/-\d+-?/)[0];
246
+ if (L(r))
247
+ return;
248
+ const t = {};
249
+ let a = !1;
250
+ for (const s of v) {
251
+ const c = f(`${r}-${s}`, o)?.cssColor;
252
+ c ? t[s] = c : a = !0;
253
+ }
254
+ if (a)
255
+ try {
256
+ let s = f(r, o);
257
+ if (s?.color || (s = f(`[${r}]`, o)), s?.color && y.valid(s.color)) {
258
+ const c = y.theme(s.color, { type: "hex" });
259
+ for (const n of v)
260
+ t[n] || (t[n] = { type: "hex", components: [c[n]], alpha: 1 });
261
+ }
262
+ } catch (s) {
263
+ console.error(`[unocss-preset-margicolor] get ${r} theme fail, please use another color.`), console.error(s);
264
+ }
265
+ for (const s of v)
266
+ t[s] = x(t[s]);
267
+ return t;
268
+ }
269
+ function _(e, o, r, t) {
270
+ const a = o.match(/.*-(\d+)/)?.[1], s = {};
271
+ let c = f(o, t)?.color;
272
+ if (!c && !a && (c = f(`[${o}]`, t)?.color), c)
273
+ s[`--mc-${e}-color`] = c;
274
+ else if (a) {
275
+ const { originDepth: i, beforeDepth: l, afterDepth: p } = V(a);
276
+ r[l] && r[p] && (s[`--mc-${e}-color`] = P({
277
+ originDepth: i,
278
+ beforeDepth: l,
279
+ beforeComponents: r[l].components,
280
+ afterComponents: r[p].components
281
+ }));
282
+ }
283
+ const n = H(e, r);
284
+ return Object.assign(s, n);
285
+ }
286
+ function K(e, o, r = {}) {
287
+ if (f(e, r)?.color) {
288
+ console.error(`[unocss-preset-margicolor] The color name '${e}' has been configured in the theme, please use the another name.`);
289
+ return;
290
+ }
291
+ const [t] = o.split(/[:/]/), a = Z(t, r);
292
+ if (a)
293
+ return _(e, t, a, r);
294
+ }
295
+ function oo(e) {
296
+ return e.colors ? [{
297
+ getCSS: ({ theme: o }) => {
298
+ const r = {};
299
+ for (const t in e.colors)
300
+ Object.assign(r, K(t, e.colors[t], o));
301
+ return `
302
+ :root {
303
+ ${Object.entries(r).map(([t, a]) => `${t}: ${a};`).join(`
304
+ `)}
305
+ }
306
+ `;
307
+ }
308
+ }] : [];
309
+ }
310
+ const ro = [
269
311
  // common style colors
270
- [/^(?:color|c)-mc-(.+)$/, p("color", "text"), { autocomplete: "(color|c)-mc-$colors" }],
271
- [/^text-(?:color-)?mc-(.+)$/, p("color", "text"), { autocomplete: "(text|text-color)-mc-$colors" }],
272
- [/^outline-(?:color-)?mc-(.+)$/, p("outline-color", "outline"), { autocomplete: "(outline|outline-color)-mc-$colors" }],
273
- [/^accent-mc-(.+)$/, p("accent-color", "accent"), { autocomplete: "accent-mc-$colors" }],
274
- [/^caret-mc-(.+)$/, p("caret-color", "caret"), { autocomplete: "caret-mc-$colors" }],
275
- [/^bg-mc-(.+)$/, p("background-color", "bg"), { autocomplete: "bg-mc-$colors" }],
312
+ [/^(?:color|c)-mc-(.+)$/, u("color", "text"), { autocomplete: "(color|c)-mc-$colors" }],
313
+ [/^text-(?:color-)?mc-(.+)$/, u("color", "text"), { autocomplete: "(text|text-color)-mc-$colors" }],
314
+ [/^outline-(?:color-)?mc-(.+)$/, u("outline-color", "outline"), { autocomplete: "(outline|outline-color)-mc-$colors" }],
315
+ [/^accent-mc-(.+)$/, u("accent-color", "accent"), { autocomplete: "accent-mc-$colors" }],
316
+ [/^caret-mc-(.+)$/, u("caret-color", "caret"), { autocomplete: "caret-mc-$colors" }],
317
+ [/^bg-mc-(.+)$/, u("background-color", "bg"), { autocomplete: "bg-mc-$colors" }],
276
318
  // from https://github.com/unocss/unocss/blob/main/packages-presets/preset-wind4/src/rules/decoration.ts
277
- [/^(?:underline|decoration)-mc-(.+)$/, (r, o) => {
278
- const e = p("text-decoration-color", "line")(r, o);
279
- if (e) {
280
- const n = e[0];
281
- return n["-webkit-text-decoration-color"] = n["text-decoration-color"], e;
319
+ [/^(?:underline|decoration)-mc-(.+)$/, (e, o) => {
320
+ const r = u("text-decoration-color", "line")(e, o);
321
+ if (r) {
322
+ const t = r[0];
323
+ return t["-webkit-text-decoration-color"] = t["text-decoration-color"], r;
282
324
  }
283
325
  }, { autocomplete: "(underline|decoration)-mc-$colors" }],
284
326
  // from https://github.com/unocss/unocss/blob/main/packages-presets/preset-wind4/src/rules/divide.ts
285
- [/^divide-mc-(.+)$/, function* (r, o) {
286
- const e = p("border-color", "divide")(r, o);
287
- e && (yield {
288
- [o.symbols.variants]: [A(r[0])],
289
- ...e[0]
290
- }, yield e[1]);
327
+ [/^divide-mc-(.+)$/, function* (e, o) {
328
+ const r = u("border-color", "divide")(e, o);
329
+ r && (yield {
330
+ [o.symbols.variants]: [q(e[0])],
331
+ ...r[0]
332
+ }, yield r[1]);
291
333
  }, { autocomplete: "divide-mc-$colors" }],
292
- [/^(?:filter-)?drop-shadow-color-mc-(.+)$/, p("--un-drop-shadow-color", "drop-shadow"), { autocomplete: "divide-mc-$colors" }],
293
- [/^\$ placeholder-mc-(.+)$/, p("color", "placeholder"), { autocomplete: "placeholder-mc-$colors" }],
294
- [/^ring-mc-(.+)$/, p("--un-ring-color", "ring"), { autocomplete: "ring-mc-$colors" }],
295
- [/^inset-ring-mc-(.+)$/, p("--un-inset-ring-color", "inset-ring"), { autocomplete: "inset-ring-mc-$colors" }],
296
- [/^ring-offset-mc-(.+)$/, p("--un-ring-offset-color", "ring-offset"), { autocomplete: "ring-offset-mc-$colors" }],
297
- [/^shadow-mc-(.+)$/, E("shadow"), { autocomplete: ["shadow-$colors", "shadow-mc-$shadow"] }],
298
- [/^inset-shadow-mc(.+)$/, E("insetShadow"), { autocomplete: ["inset-shadow-mc-$colors", "inset-shadow-mc-$insetShadow"] }],
299
- [/^fill-mc-(.+)$/, p("fill", "fill"), { autocomplete: "fill-mc-$colors" }],
300
- [/^stroke-mc-(.+)$/, p("stroke", "stroke"), { autocomplete: "stroke-mc-$colors" }],
301
- [/^text-stroke-mc-(.+)$/, p("-webkit-text-stroke-color", "text-stroke"), { autocomplete: "text-stroke-mc-$colors" }],
302
- [/^text-shadow-(?:color-)?mc-(.+)$/, p("--un-text-shadow-color", "text-shadow"), { autocomplete: ["text-shadow(-color)?-mc-$colors"] }],
303
- [/^mask-(linear|radial|conic)-(from|to)-mc-(.+)$/, P, { autocomplete: ["mask-(linear|radial|conic)-(from|to)-mc-$colors"] }],
304
- [/^mask-([trblxy])-(from|to)-mc-(.+)$/, P, { autocomplete: ["mask-(x|y|t|b|l|r)-(from|to)-mc-$colors"] }],
334
+ [/^(?:filter-)?drop-shadow-color-mc-(.+)$/, u("--un-drop-shadow-color", "drop-shadow"), { autocomplete: "divide-mc-$colors" }],
335
+ [/^\$ placeholder-mc-(.+)$/, u("color", "placeholder"), { autocomplete: "placeholder-mc-$colors" }],
336
+ [/^ring-mc-(.+)$/, u("--un-ring-color", "ring"), { autocomplete: "ring-mc-$colors" }],
337
+ [/^inset-ring-mc-(.+)$/, u("--un-inset-ring-color", "inset-ring"), { autocomplete: "inset-ring-mc-$colors" }],
338
+ [/^ring-offset-mc-(.+)$/, u("--un-ring-offset-color", "ring-offset"), { autocomplete: "ring-offset-mc-$colors" }],
339
+ [/^shadow-mc-(.+)$/, I("shadow"), { autocomplete: ["shadow-$colors", "shadow-mc-$shadow"] }],
340
+ [/^inset-shadow-mc(.+)$/, I("insetShadow"), { autocomplete: ["inset-shadow-mc-$colors", "inset-shadow-mc-$insetShadow"] }],
341
+ [/^fill-mc-(.+)$/, u("fill", "fill"), { autocomplete: "fill-mc-$colors" }],
342
+ [/^stroke-mc-(.+)$/, u("stroke", "stroke"), { autocomplete: "stroke-mc-$colors" }],
343
+ [/^text-stroke-mc-(.+)$/, u("-webkit-text-stroke-color", "text-stroke"), { autocomplete: "text-stroke-mc-$colors" }],
344
+ [/^text-shadow-(?:color-)?mc-(.+)$/, u("--un-text-shadow-color", "text-shadow"), { autocomplete: ["text-shadow(-color)?-mc-$colors"] }],
345
+ [/^mask-(linear|radial|conic)-(from|to)-mc-(.+)$/, T, { autocomplete: ["mask-(linear|radial|conic)-(from|to)-mc-$colors"] }],
346
+ [/^mask-([trblxy])-(from|to)-mc-(.+)$/, T, { autocomplete: ["mask-(x|y|t|b|l|r)-(from|to)-mc-$colors"] }],
305
347
  // border style colors
306
- [/^(?:border|b)-()(?:color-)?mc-(.+)$/, V, { autocomplete: ["(border|b)-mc-$colors", "(border|b)-<directions>-mc-$colors"] }],
307
- [/^(?:border|b)-([xy])-(?:color-)?mc-(.+)$/, V],
308
- [/^(?:border|b)-([rltbse])-(?:color-)?mc-(.+)$/, V],
309
- [/^(?:border|b)-(block|inline)-(?:color-)?mc-(.+)$/, V],
310
- [/^(?:border|b)-([bi][se])-(?:color-)?mc-(.+)$/, V],
348
+ [/^(?:border|b)-()(?:color-)?mc-(.+)$/, k, { autocomplete: ["(border|b)-mc-$colors", "(border|b)-<directions>-mc-$colors"] }],
349
+ [/^(?:border|b)-([xy])-(?:color-)?mc-(.+)$/, k],
350
+ [/^(?:border|b)-([rltbse])-(?:color-)?mc-(.+)$/, k],
351
+ [/^(?:border|b)-(block|inline)-(?:color-)?mc-(.+)$/, k],
352
+ [/^(?:border|b)-([bi][se])-(?:color-)?mc-(.+)$/, k],
311
353
  // bg gradient color
312
- [/^(from|via|to|stops)-mc-(.+)$/, Z()]
313
- ], to = [
314
- [/^mc-(.+)$/, no]
354
+ [/^(from|via|to|stops)-mc-(.+)$/, W()]
355
+ ], eo = [
356
+ [/^mc-(.+)$/, to]
315
357
  ];
316
- function no([, r], { theme: o }) {
317
- const e = {}, [n, a] = r.split("_");
318
- if (!a)
319
- return;
320
- if (y(n, o)?.color) {
321
- console.error(`[unocss-preset-margicolor][mc-${r}] The color name '${n}' has been configured in the theme, please use the another name.`);
322
- return;
323
- }
324
- const [c] = a.split(/[:/]/), s = c.match(/.*-(\d+)/)?.[1], t = c?.split(/-\d+-?/)[0];
325
- if (!t || !Number.isNaN(Number(t))) {
326
- console.error(`[unocss-preset-margicolor][mc-${r}] The color '${t}' is invalid.`);
327
- return;
328
- }
329
- const i = {};
330
- let u = !1;
331
- for (const l of M) {
332
- const m = y(`${t}-${l}`, o)?.cssColor;
333
- m ? i[l] = m : u = !0;
334
- }
335
- if (u)
336
- try {
337
- const l = y(t, o)?.color, m = l ? K(l) : void 0;
338
- if (m && N.valid(m)) {
339
- const b = N.theme(m);
340
- for (const d of M)
341
- if (!i[d]) {
342
- const g = C({ type: "hex", components: [b[d]], alpha: 1 });
343
- i[d] = g;
344
- }
345
- }
346
- } catch (l) {
347
- console.error(`[unocss-preset-margicolor] Error parsing ${r}: get ${t} theme fail, please use another color.`), console.error(l);
348
- }
349
- for (const l of M)
350
- i[l] = C(i[l]);
351
- const $ = y(c, o);
352
- if ($?.color)
353
- e[`--mc-${n}-color`] = $.color;
354
- else if (s) {
355
- const { originDepth: l, beforeDepth: m, afterDepth: b } = O(s);
356
- if (i[m] && i[b]) {
357
- const d = (l - m) / 100, g = Array.from({ length: 3 }).map((k, v) => {
358
- const w = i[m].components, S = i[b].components, _ = h(w[v]) + (h(S[v]) - h(w[v])) * d;
359
- return `${Math.round(_ * 1e3) / 1e3}`;
360
- });
361
- e[`--mc-${n}-color`] = `oklch(${g.join(" ")})`;
362
- }
363
- }
364
- for (const l of M)
365
- if (i[l]) {
366
- const m = i[l].components;
367
- e[`--mc-${n}-${l}-l`] = Math.round(h(m[0]) * 1e3) / 1e3, e[`--mc-${n}-${l}-c`] = Math.round(h(m[1]) * 1e3) / 1e3, e[`--mc-${n}-${l}-h`] = Math.round(h(m[2]) * 1e3) / 1e3;
368
- }
369
- return e;
358
+ function to([, e], { theme: o }) {
359
+ const r = e.indexOf("_"), t = e.substring(0, r), a = e.substring(r + 1);
360
+ return a ? K(t, a, o) : void 0;
370
361
  }
371
- const ao = [
372
- eo,
373
- to
362
+ const no = [
363
+ ro,
364
+ eo
374
365
  ].flat();
375
- function uo(r) {
366
+ function uo(e = {}) {
376
367
  return {
377
368
  name: "unocss-preset-magicolor",
378
369
  layer: "unocss-preset-magicolor",
379
370
  layers: { "unocss-preset-magicolor": -100 },
380
- rules: ao
371
+ rules: no,
372
+ preflights: oo(e)
381
373
  };
382
374
  }
383
375
  export {
@@ -1 +1,12 @@
1
- export declare function updateMagicColor(): void;
1
+ /**
2
+ * Modify the value of the color variable
3
+ * @param params params Parameter object
4
+ * @param params.name Color name
5
+ * @param params.color Color
6
+ * @param params.dom params.dom Target element, modifying the entire page theme when passing `document.documentElement`
7
+ */
8
+ export declare function updateMagicColor(params: {
9
+ name: string;
10
+ color: string;
11
+ dom?: HTMLElement;
12
+ }): void;
@@ -1,5 +1,5 @@
1
1
  import { Preset } from 'unocss';
2
2
  import { PresetMcOptions } from './types';
3
- export declare function presetMagicolor(_options?: PresetMcOptions): Preset;
3
+ export declare function presetMagicolor(options?: PresetMcOptions): Preset;
4
4
  export * from './types';
5
5
  export default presetMagicolor;
@@ -0,0 +1,3 @@
1
+ import { Preflight } from 'unocss';
2
+ import { PresetMcOptions } from '../types';
3
+ export declare function preflights(options: PresetMcOptions): Preflight[];
@@ -1,2 +1,3 @@
1
+ import { Theme } from '@unocss/preset-wind4';
1
2
  import { Rule } from 'unocss';
2
- export declare const colorStyle: Rule[];
3
+ export declare const colorStyle: Rule<Theme>[];
@@ -0,0 +1,3 @@
1
+ import { Theme } from '@unocss/preset-wind4';
2
+ import { CSSEntries, CSSValueInput, RuleContext } from 'unocss';
3
+ export declare function handlerBorderColor([, a, b]: string[], ctx: RuleContext<Theme>): CSSEntries | (CSSValueInput | string)[] | undefined;
@@ -0,0 +1,6 @@
1
+ export * from './bg-gradient';
2
+ export * from './border';
3
+ export * from './mask';
4
+ export * from './shadow';
5
+ export * from './theme-colors';
6
+ export * from './utilities';
@@ -0,0 +1,10 @@
1
+ import { Theme } from '@unocss/preset-wind4';
2
+ import { CSSObject } from 'unocss';
3
+ /**
4
+ * resolve color variable
5
+ * @param name color name
6
+ * @param hue `color-depth`: color can be theme color or css color
7
+ * @param theme unocss theme
8
+ * @returns css variables
9
+ */
10
+ export declare function resolveThemeColorVariable(name: string, hue: string, theme?: Theme): CSSObject | undefined;
@@ -1,12 +1,5 @@
1
1
  import { Theme } from '@unocss/preset-wind4';
2
2
  import { CSSObject, CSSValueInput, RuleContext } from 'unocss';
3
- import { ThemeKey } from '../typing';
4
- export declare const themeMetaList: ThemeKey[];
5
- export declare function resolveDepth(no: string): {
6
- originDepth: number;
7
- beforeDepth: number;
8
- afterDepth: number;
9
- };
10
3
  export declare function parseMagicColor(body: string, theme: Theme): {
11
4
  colorData: {
12
5
  opacity: string | undefined;
@@ -18,6 +11,6 @@ export declare function parseMagicColor(body: string, theme: Theme): {
18
11
  keys: string[] | undefined;
19
12
  readonly cssColor: import('@unocss/preset-wind4/utils').CSSColorValue | undefined;
20
13
  } | undefined;
21
- cssVariable: CSSObject;
14
+ cssVariables: CSSObject[];
22
15
  };
23
16
  export declare function mcColorResolver(property: string, varName: string): ([, body]: string[], ctx: RuleContext<Theme>) => (CSSValueInput | string)[] | undefined;
@@ -1,3 +1,5 @@
1
1
  /** PresetMcOptions */
2
2
  export interface PresetMcOptions {
3
+ /** global colors variables */
4
+ colors?: Record<string, string>;
3
5
  }
@@ -0,0 +1,20 @@
1
+ import { CSSColorValue } from '@unocss/preset-wind4/utils';
2
+ import { CSSObject } from 'unocss';
3
+ import { ThemeKey } from '../typing';
4
+ export declare const themeMetaList: ThemeKey[];
5
+ export declare function resolveDepth(no: string): {
6
+ originDepth: keyof import('magic-color').ThemeMetas;
7
+ beforeDepth: keyof import('magic-color').ThemeMetas;
8
+ afterDepth: keyof import('magic-color').ThemeMetas;
9
+ };
10
+ /**
11
+ * is invalid color
12
+ */
13
+ export declare function isInvalidColor(color?: string): boolean;
14
+ export declare function countDiffColor(params: {
15
+ originDepth: number;
16
+ beforeDepth: number;
17
+ beforeComponents: (string | number)[];
18
+ afterComponents: (string | number)[];
19
+ }): string;
20
+ export declare function generateOklchVariable(name: string, themeMetaColors: Partial<Record<ThemeKey, CSSColorValue>>): CSSObject;
@@ -1,6 +1,2 @@
1
- export * from './bg-gradient';
2
- export * from './border';
3
- export * from './mask';
4
- export * from './shadow';
1
+ export * from './common';
5
2
  export * from './transforms';
6
- export * from './utilities';
@@ -3,3 +3,5 @@ import { CSSColorValue } from '@unocss/preset-wind4/utils';
3
3
  export declare function toNum(value?: string | number): number;
4
4
  /** to oklch color */
5
5
  export declare function toOklch(cssColor?: CSSColorValue): CSSColorValue | undefined;
6
+ /** Math.round(num * 1000) / 1000 */
7
+ export declare function roundNum(num: number): number;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "unocss-preset-magicolor",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.3.0",
5
5
  "description": "Unocss预设",
6
6
  "author": "nxy",
7
7
  "license": "MIT",
@@ -26,12 +26,10 @@
26
26
  "dist"
27
27
  ],
28
28
  "dependencies": {
29
- "@unocss/preset-wind4": "66.5.4",
30
- "culori": "^4.0.2",
31
- "magic-color": "^2.1.0"
29
+ "@unocss/preset-wind4": "~66.5.9",
30
+ "magic-color": "^2.2.3"
32
31
  },
33
32
  "devDependencies": {
34
- "@types/culori": "^4.0.1",
35
- "unocss": "^66.5.4"
33
+ "unocss": "^66.5.9"
36
34
  }
37
35
  }
@@ -1,3 +0,0 @@
1
- import { Theme } from '@unocss/preset-wind4';
2
- import { CSSEntries, CSSValueInput, RuleContext } from 'unocss';
3
- export declare function mcBorderColorResolver([, a, b]: string[], ctx: RuleContext<Theme>): CSSEntries | (CSSValueInput | string)[] | undefined;
File without changes
File without changes