@terrazzo/plugin-tailwind 0.1.0 → 0.2.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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @terrazzo/plugin-tailwind
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#502](https://github.com/terrazzoapp/terrazzo/pull/502) [`c9792bd`](https://github.com/terrazzoapp/terrazzo/commit/c9792bdef27aa2edab3f9f74b37a794f0a14da59) Thanks [@drwpow](https://github.com/drwpow)! - Fix bug in parsing LAB colors
8
+
9
+ - [#502](https://github.com/terrazzoapp/terrazzo/pull/502) [`c9792bd`](https://github.com/terrazzoapp/terrazzo/commit/c9792bdef27aa2edab3f9f74b37a794f0a14da59) Thanks [@drwpow](https://github.com/drwpow)! - Add support for lab65 colors (not technically part of CSS Module 4 spec, but a nice convenience)
10
+
11
+ - Updated dependencies [[`c9792bd`](https://github.com/terrazzoapp/terrazzo/commit/c9792bdef27aa2edab3f9f74b37a794f0a14da59), [`c9792bd`](https://github.com/terrazzoapp/terrazzo/commit/c9792bdef27aa2edab3f9f74b37a794f0a14da59)]:
12
+ - @terrazzo/token-tools@0.9.1
13
+ - @terrazzo/cli@0.9.1
14
+ - @terrazzo/plugin-css@0.9.1
15
+
16
+ ## 0.2.0
17
+
18
+ ### Minor Changes
19
+
20
+ - [#497](https://github.com/terrazzoapp/terrazzo/pull/497) [`9b80fd4`](https://github.com/terrazzoapp/terrazzo/commit/9b80fd4edd1198021d8e309483e8cd8551fe79dc) Thanks [@bschlenk](https://github.com/bschlenk)! - - potential 5x speedup for @terrazzo/plugin-css
21
+ - removed isTokenMatch from @terrazzo/token-tools
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [[`9b80fd4`](https://github.com/terrazzoapp/terrazzo/commit/9b80fd4edd1198021d8e309483e8cd8551fe79dc)]:
26
+ - @terrazzo/cli@0.9.0
27
+ - @terrazzo/plugin-css@0.9.0
28
+ - @terrazzo/token-tools@0.9.0
29
+
3
30
  ## 0.1.0
4
31
 
5
32
  ### Minor Changes
package/dist/index.js CHANGED
@@ -231,28 +231,28 @@ const modes = {};
231
231
  const parsers = [];
232
232
  const colorProfiles = {};
233
233
  const identity = (v) => v;
234
- const useMode = (definition$15) => {
235
- converters$1[definition$15.mode] = {
236
- ...converters$1[definition$15.mode],
237
- ...definition$15.toMode
234
+ const useMode = (definition$16) => {
235
+ converters$1[definition$16.mode] = {
236
+ ...converters$1[definition$16.mode],
237
+ ...definition$16.toMode
238
238
  };
239
- Object.keys(definition$15.fromMode || {}).forEach((k$2) => {
240
- if (!converters$1[k$2]) converters$1[k$2] = {};
241
- converters$1[k$2][definition$15.mode] = definition$15.fromMode[k$2];
239
+ Object.keys(definition$16.fromMode || {}).forEach((k$3) => {
240
+ if (!converters$1[k$3]) converters$1[k$3] = {};
241
+ converters$1[k$3][definition$16.mode] = definition$16.fromMode[k$3];
242
242
  });
243
- if (!definition$15.ranges) definition$15.ranges = {};
244
- if (!definition$15.difference) definition$15.difference = {};
245
- definition$15.channels.forEach((channel) => {
246
- if (definition$15.ranges[channel] === void 0) definition$15.ranges[channel] = [0, 1];
247
- if (!definition$15.interpolate[channel]) throw new Error(`Missing interpolator for: ${channel}`);
248
- if (typeof definition$15.interpolate[channel] === "function") definition$15.interpolate[channel] = { use: definition$15.interpolate[channel] };
249
- if (!definition$15.interpolate[channel].fixup) definition$15.interpolate[channel].fixup = identity;
243
+ if (!definition$16.ranges) definition$16.ranges = {};
244
+ if (!definition$16.difference) definition$16.difference = {};
245
+ definition$16.channels.forEach((channel) => {
246
+ if (definition$16.ranges[channel] === void 0) definition$16.ranges[channel] = [0, 1];
247
+ if (!definition$16.interpolate[channel]) throw new Error(`Missing interpolator for: ${channel}`);
248
+ if (typeof definition$16.interpolate[channel] === "function") definition$16.interpolate[channel] = { use: definition$16.interpolate[channel] };
249
+ if (!definition$16.interpolate[channel].fixup) definition$16.interpolate[channel].fixup = identity;
250
250
  });
251
- modes[definition$15.mode] = definition$15;
252
- (definition$15.parse || []).forEach((parser) => {
253
- useParser(parser, definition$15.mode);
251
+ modes[definition$16.mode] = definition$16;
252
+ (definition$16.parse || []).forEach((parser) => {
253
+ useParser(parser, definition$16.mode);
254
254
  });
255
- return converter_default(definition$15.mode);
255
+ return converter_default(definition$16.mode);
256
256
  };
257
257
  const getMode = (mode) => modes[mode];
258
258
  const useParser = (parser, mode) => {
@@ -567,7 +567,7 @@ const fixupAlpha = (arr) => {
567
567
  });
568
568
  return some_defined ? res : arr;
569
569
  };
570
- const definition$14 = {
570
+ const definition$15 = {
571
571
  mode: "rgb",
572
572
  channels: [
573
573
  "r",
@@ -605,7 +605,7 @@ const definition$14 = {
605
605
  b: 0
606
606
  }
607
607
  };
608
- var definition_default$12 = definition$14;
608
+ var definition_default$13 = definition$15;
609
609
  const linearize$2 = (v = 0) => Math.pow(Math.abs(v), 563 / 256) * Math.sign(v);
610
610
  const convertA98ToXyz65 = (a98) => {
611
611
  let r$1 = linearize$2(a98.r);
@@ -636,7 +636,7 @@ const convertXyz65ToA98 = ({ x, y, z, alpha }) => {
636
636
  return res;
637
637
  };
638
638
  var convertXyz65ToA98_default = convertXyz65ToA98;
639
- const fn$2 = (c$1 = 0) => {
639
+ const fn$3 = (c$1 = 0) => {
640
640
  const abs = Math.abs(c$1);
641
641
  if (abs <= .04045) return c$1 / 12.92;
642
642
  return (Math.sign(c$1) || 1) * Math.pow((abs + .055) / 1.055, 2.4);
@@ -644,9 +644,9 @@ const fn$2 = (c$1 = 0) => {
644
644
  const convertRgbToLrgb = ({ r: r$1, g, b, alpha }) => {
645
645
  let res = {
646
646
  mode: "lrgb",
647
- r: fn$2(r$1),
648
- g: fn$2(g),
649
- b: fn$2(b)
647
+ r: fn$3(r$1),
648
+ g: fn$3(g),
649
+ b: fn$3(b)
650
650
  };
651
651
  if (alpha !== void 0) res.alpha = alpha;
652
652
  return res;
@@ -664,7 +664,7 @@ const convertRgbToXyz65 = (rgb$2) => {
664
664
  return res;
665
665
  };
666
666
  var convertRgbToXyz65_default = convertRgbToXyz65;
667
- const fn$1 = (c$1 = 0) => {
667
+ const fn$2 = (c$1 = 0) => {
668
668
  const abs = Math.abs(c$1);
669
669
  if (abs > .0031308) return (Math.sign(c$1) || 1) * (1.055 * Math.pow(abs, 1 / 2.4) - .055);
670
670
  return c$1 * 12.92;
@@ -672,9 +672,9 @@ const fn$1 = (c$1 = 0) => {
672
672
  const convertLrgbToRgb = ({ r: r$1, g, b, alpha }, mode = "rgb") => {
673
673
  let res = {
674
674
  mode,
675
- r: fn$1(r$1),
676
- g: fn$1(g),
677
- b: fn$1(b)
675
+ r: fn$2(r$1),
676
+ g: fn$2(g),
677
+ b: fn$2(b)
678
678
  };
679
679
  if (alpha !== void 0) res.alpha = alpha;
680
680
  return res;
@@ -693,8 +693,8 @@ const convertXyz65ToRgb = ({ x, y, z, alpha }) => {
693
693
  return res;
694
694
  };
695
695
  var convertXyz65ToRgb_default = convertXyz65ToRgb;
696
- const definition$13 = {
697
- ...definition_default$12,
696
+ const definition$14 = {
697
+ ...definition_default$13,
698
698
  mode: "a98",
699
699
  parse: ["a98-rgb"],
700
700
  serialize: "a98-rgb",
@@ -707,7 +707,7 @@ const definition$13 = {
707
707
  xyz65: convertA98ToXyz65_default
708
708
  }
709
709
  };
710
- var definition_default = definition$13;
710
+ var definition_default = definition$14;
711
711
  const normalizeHue = (hue$2) => (hue$2 = hue$2 % 360) < 0 ? hue$2 + 360 : hue$2;
712
712
  var normalizeHue_default = normalizeHue;
713
713
  function convertHslToRgb({ h, s, l, alpha }) {
@@ -827,12 +827,12 @@ function parseHsl(color, parsed) {
827
827
  return res;
828
828
  }
829
829
  var parseHsl_default = parseHsl;
830
- const hue = (hues, fn$3) => {
830
+ const hue = (hues, fn$4) => {
831
831
  return hues.map((hue$2, idx, arr) => {
832
832
  if (hue$2 === void 0) return hue$2;
833
833
  let normalized = normalizeHue_default(hue$2);
834
834
  if (idx === 0 || hues[idx - 1] === void 0) return normalized;
835
- return fn$3(normalized - normalizeHue_default(arr[idx - 1]));
835
+ return fn$4(normalized - normalizeHue_default(arr[idx - 1]));
836
836
  }).reduce((acc, curr) => {
837
837
  if (!acc.length || curr === void 0 || acc[acc.length - 1] === void 0) {
838
838
  acc.push(curr);
@@ -879,7 +879,7 @@ const averageAngle = (val) => {
879
879
  let angle = Math.atan2(sum.sin, sum.cos) * 180 / Math.PI;
880
880
  return angle < 0 ? 360 + angle : angle;
881
881
  };
882
- const definition$12 = {
882
+ const definition$13 = {
883
883
  mode: "hsl",
884
884
  toMode: { rgb: convertHslToRgb },
885
885
  fromMode: { rgb: convertRgbToHsl },
@@ -908,24 +908,24 @@ const definition$12 = {
908
908
  difference: { h: differenceHueSaturation },
909
909
  average: { h: averageAngle }
910
910
  };
911
- var definition_default$1 = definition$12;
911
+ var definition_default$1 = definition$13;
912
912
  function convertHsvToRgb({ h, s, v, alpha }) {
913
913
  h = normalizeHue_default(h !== void 0 ? h : 0);
914
914
  if (s === void 0) s = 0;
915
915
  if (v === void 0) v = 0;
916
- let f$1 = Math.abs(h / 60 % 2 - 1);
916
+ let f$2 = Math.abs(h / 60 % 2 - 1);
917
917
  let res;
918
918
  switch (Math.floor(h / 60)) {
919
919
  case 0:
920
920
  res = {
921
921
  r: v,
922
- g: v * (1 - s * f$1),
922
+ g: v * (1 - s * f$2),
923
923
  b: v * (1 - s)
924
924
  };
925
925
  break;
926
926
  case 1:
927
927
  res = {
928
- r: v * (1 - s * f$1),
928
+ r: v * (1 - s * f$2),
929
929
  g: v,
930
930
  b: v * (1 - s)
931
931
  };
@@ -934,19 +934,19 @@ function convertHsvToRgb({ h, s, v, alpha }) {
934
934
  res = {
935
935
  r: v * (1 - s),
936
936
  g: v,
937
- b: v * (1 - s * f$1)
937
+ b: v * (1 - s * f$2)
938
938
  };
939
939
  break;
940
940
  case 3:
941
941
  res = {
942
942
  r: v * (1 - s),
943
- g: v * (1 - s * f$1),
943
+ g: v * (1 - s * f$2),
944
944
  b: v
945
945
  };
946
946
  break;
947
947
  case 4:
948
948
  res = {
949
- r: v * (1 - s * f$1),
949
+ r: v * (1 - s * f$2),
950
950
  g: v * (1 - s),
951
951
  b: v
952
952
  };
@@ -955,7 +955,7 @@ function convertHsvToRgb({ h, s, v, alpha }) {
955
955
  res = {
956
956
  r: v,
957
957
  g: v * (1 - s),
958
- b: v * (1 - s * f$1)
958
+ b: v * (1 - s * f$2)
959
959
  };
960
960
  break;
961
961
  default: res = {
@@ -982,7 +982,7 @@ function convertRgbToHsv({ r: r$1, g, b, alpha }) {
982
982
  if (alpha !== void 0) res.alpha = alpha;
983
983
  return res;
984
984
  }
985
- const definition$11 = {
985
+ const definition$12 = {
986
986
  mode: "hsv",
987
987
  toMode: { rgb: convertHsvToRgb },
988
988
  parse: ["--hsv"],
@@ -1011,7 +1011,7 @@ const definition$11 = {
1011
1011
  difference: { h: differenceHueSaturation },
1012
1012
  average: { h: averageAngle }
1013
1013
  };
1014
- var definition_default$2 = definition$11;
1014
+ var definition_default$2 = definition$12;
1015
1015
  function convertHwbToRgb({ h, w, b, alpha }) {
1016
1016
  if (w === void 0) w = 0;
1017
1017
  if (b === void 0) b = 0;
@@ -1061,7 +1061,7 @@ function ParseHwb(color, parsed) {
1061
1061
  return res;
1062
1062
  }
1063
1063
  var parseHwb_default = ParseHwb;
1064
- const definition$10 = {
1064
+ const definition$11 = {
1065
1065
  mode: "hwb",
1066
1066
  toMode: { rgb: convertHwbToRgb },
1067
1067
  fromMode: { rgb: convertRgbToHwb },
@@ -1090,9 +1090,9 @@ const definition$10 = {
1090
1090
  difference: { h: differenceHueNaive },
1091
1091
  average: { h: averageAngle }
1092
1092
  };
1093
- var definition_default$3 = definition$10;
1094
- const k = Math.pow(29, 3) / Math.pow(3, 3);
1095
- const e = Math.pow(6, 3) / Math.pow(29, 3);
1093
+ var definition_default$3 = definition$11;
1094
+ const k$1 = Math.pow(29, 3) / Math.pow(3, 3);
1095
+ const e$1 = Math.pow(6, 3) / Math.pow(29, 3);
1096
1096
  const D50 = {
1097
1097
  X: .3457 / .3585,
1098
1098
  Y: 1,
@@ -1103,9 +1103,9 @@ const D65 = {
1103
1103
  Y: 1,
1104
1104
  Z: .3583 / .329
1105
1105
  };
1106
- const k$1 = Math.pow(29, 3) / Math.pow(3, 3);
1107
- const e$1 = Math.pow(6, 3) / Math.pow(29, 3);
1108
- let fn = (v) => Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k;
1106
+ const k$2 = Math.pow(29, 3) / Math.pow(3, 3);
1107
+ const e$2 = Math.pow(6, 3) / Math.pow(29, 3);
1108
+ let fn$1 = (v) => Math.pow(v, 3) > e$1 ? Math.pow(v, 3) : (116 * v - 16) / k$1;
1109
1109
  const convertLabToXyz50 = ({ l, a, b, alpha }) => {
1110
1110
  if (l === void 0) l = 0;
1111
1111
  if (a === void 0) a = 0;
@@ -1115,9 +1115,9 @@ const convertLabToXyz50 = ({ l, a, b, alpha }) => {
1115
1115
  let fz = fy - b / 200;
1116
1116
  let res = {
1117
1117
  mode: "xyz50",
1118
- x: fn(fx) * D50.X,
1119
- y: fn(fy) * D50.Y,
1120
- z: fn(fz) * D50.Z
1118
+ x: fn$1(fx) * D50.X,
1119
+ y: fn$1(fy) * D50.Y,
1120
+ z: fn$1(fz) * D50.Z
1121
1121
  };
1122
1122
  if (alpha !== void 0) res.alpha = alpha;
1123
1123
  return res;
@@ -1150,14 +1150,14 @@ const convertRgbToXyz50 = (rgb$2) => {
1150
1150
  return res;
1151
1151
  };
1152
1152
  var convertRgbToXyz50_default = convertRgbToXyz50;
1153
- const f = (value) => value > e ? Math.cbrt(value) : (k * value + 16) / 116;
1153
+ const f$1 = (value) => value > e$1 ? Math.cbrt(value) : (k$1 * value + 16) / 116;
1154
1154
  const convertXyz50ToLab = ({ x, y, z, alpha }) => {
1155
1155
  if (x === void 0) x = 0;
1156
1156
  if (y === void 0) y = 0;
1157
1157
  if (z === void 0) z = 0;
1158
- let f0 = f(x / D50.X);
1159
- let f1 = f(y / D50.Y);
1160
- let f2 = f(z / D50.Z);
1158
+ let f0 = f$1(x / D50.X);
1159
+ let f1 = f$1(y / D50.Y);
1160
+ let f2 = f$1(z / D50.Z);
1161
1161
  let res = {
1162
1162
  mode: "lab",
1163
1163
  l: 116 * f1 - 16,
@@ -1186,7 +1186,7 @@ function parseLab(color, parsed) {
1186
1186
  return res;
1187
1187
  }
1188
1188
  var parseLab_default = parseLab;
1189
- const definition$9 = {
1189
+ const definition$10 = {
1190
1190
  mode: "lab",
1191
1191
  toMode: {
1192
1192
  xyz50: convertLabToXyz50_default,
@@ -1219,7 +1219,73 @@ const definition$9 = {
1219
1219
  }
1220
1220
  }
1221
1221
  };
1222
- var definition_default$4 = definition$9;
1222
+ var definition_default$4 = definition$10;
1223
+ const k = Math.pow(29, 3) / Math.pow(3, 3);
1224
+ const e = Math.pow(6, 3) / Math.pow(29, 3);
1225
+ let fn = (v) => Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k;
1226
+ const convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
1227
+ if (l === void 0) l = 0;
1228
+ if (a === void 0) a = 0;
1229
+ if (b === void 0) b = 0;
1230
+ let fy = (l + 16) / 116;
1231
+ let fx = a / 500 + fy;
1232
+ let fz = fy - b / 200;
1233
+ let res = {
1234
+ mode: "xyz65",
1235
+ x: fn(fx) * D65.X,
1236
+ y: fn(fy) * D65.Y,
1237
+ z: fn(fz) * D65.Z
1238
+ };
1239
+ if (alpha !== void 0) res.alpha = alpha;
1240
+ return res;
1241
+ };
1242
+ var convertLab65ToXyz65_default = convertLab65ToXyz65;
1243
+ const convertLab65ToRgb = (lab) => convertXyz65ToRgb_default(convertLab65ToXyz65_default(lab));
1244
+ var convertLab65ToRgb_default = convertLab65ToRgb;
1245
+ const f = (value) => value > e ? Math.cbrt(value) : (k * value + 16) / 116;
1246
+ const convertXyz65ToLab65 = ({ x, y, z, alpha }) => {
1247
+ if (x === void 0) x = 0;
1248
+ if (y === void 0) y = 0;
1249
+ if (z === void 0) z = 0;
1250
+ let f0 = f(x / D65.X);
1251
+ let f1 = f(y / D65.Y);
1252
+ let f2 = f(z / D65.Z);
1253
+ let res = {
1254
+ mode: "lab65",
1255
+ l: 116 * f1 - 16,
1256
+ a: 500 * (f0 - f1),
1257
+ b: 200 * (f1 - f2)
1258
+ };
1259
+ if (alpha !== void 0) res.alpha = alpha;
1260
+ return res;
1261
+ };
1262
+ var convertXyz65ToLab65_default = convertXyz65ToLab65;
1263
+ const convertRgbToLab65 = (rgb$2) => {
1264
+ let res = convertXyz65ToLab65_default(convertRgbToXyz65_default(rgb$2));
1265
+ if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
1266
+ return res;
1267
+ };
1268
+ var convertRgbToLab65_default = convertRgbToLab65;
1269
+ const definition$9 = {
1270
+ ...definition_default$4,
1271
+ mode: "lab65",
1272
+ parse: ["--lab-d65"],
1273
+ serialize: "--lab-d65",
1274
+ toMode: {
1275
+ xyz65: convertLab65ToXyz65_default,
1276
+ rgb: convertLab65ToRgb_default
1277
+ },
1278
+ fromMode: {
1279
+ xyz65: convertXyz65ToLab65_default,
1280
+ rgb: convertRgbToLab65_default
1281
+ },
1282
+ ranges: {
1283
+ l: [0, 100],
1284
+ a: [-86.182, 98.234],
1285
+ b: [-107.86, 94.477]
1286
+ }
1287
+ };
1288
+ var definition_default$5 = definition$9;
1223
1289
  const convertLabToLch = ({ l, a, b, alpha }, mode = "lch") => {
1224
1290
  if (a === void 0) a = 0;
1225
1291
  if (b === void 0) b = 0;
@@ -1301,16 +1367,16 @@ const definition$8 = {
1301
1367
  difference: { h: differenceHueChroma },
1302
1368
  average: { h: averageAngle }
1303
1369
  };
1304
- var definition_default$5 = definition$8;
1370
+ var definition_default$6 = definition$8;
1305
1371
  const definition$7 = {
1306
- ...definition_default$12,
1372
+ ...definition_default$13,
1307
1373
  mode: "lrgb",
1308
1374
  toMode: { rgb: convertLrgbToRgb_default },
1309
1375
  fromMode: { rgb: convertRgbToLrgb_default },
1310
1376
  parse: ["srgb-linear"],
1311
1377
  serialize: "srgb-linear"
1312
1378
  };
1313
- var definition_default$6 = definition$7;
1379
+ var definition_default$7 = definition$7;
1314
1380
  const convertOklabToLrgb = ({ l, a, b, alpha }) => {
1315
1381
  if (l === void 0) l = 0;
1316
1382
  if (a === void 0) a = 0;
@@ -1384,7 +1450,7 @@ const definition$6 = {
1384
1450
  parse: [parseOklab_default],
1385
1451
  serialize: (c$1) => `oklab(${c$1.l !== void 0 ? c$1.l : "none"} ${c$1.a !== void 0 ? c$1.a : "none"} ${c$1.b !== void 0 ? c$1.b : "none"}${c$1.alpha < 1 ? ` / ${c$1.alpha}` : ""})`
1386
1452
  };
1387
- var definition_default$7 = definition$6;
1453
+ var definition_default$8 = definition$6;
1388
1454
  function parseOklch(color, parsed) {
1389
1455
  if (!parsed || parsed[0] !== "oklch") return void 0;
1390
1456
  const res = { mode: "oklch" };
@@ -1403,7 +1469,7 @@ function parseOklch(color, parsed) {
1403
1469
  }
1404
1470
  var parseOklch_default = parseOklch;
1405
1471
  const definition$5 = {
1406
- ...definition_default$5,
1472
+ ...definition_default$6,
1407
1473
  mode: "oklch",
1408
1474
  toMode: {
1409
1475
  oklab: (c$1) => convertLchToLab_default(c$1, "oklab"),
@@ -1421,7 +1487,7 @@ const definition$5 = {
1421
1487
  h: [0, 360]
1422
1488
  }
1423
1489
  };
1424
- var definition_default$8 = definition$5;
1490
+ var definition_default$9 = definition$5;
1425
1491
  const convertP3ToXyz65 = (rgb$2) => {
1426
1492
  let { r: r$1, g, b, alpha } = convertRgbToLrgb_default(rgb$2);
1427
1493
  let res = {
@@ -1448,7 +1514,7 @@ const convertXyz65ToP3 = ({ x, y, z, alpha }) => {
1448
1514
  };
1449
1515
  var convertXyz65ToP3_default = convertXyz65ToP3;
1450
1516
  const definition$4 = {
1451
- ...definition_default$12,
1517
+ ...definition_default$13,
1452
1518
  mode: "p3",
1453
1519
  parse: ["display-p3"],
1454
1520
  serialize: "display-p3",
@@ -1461,7 +1527,7 @@ const definition$4 = {
1461
1527
  xyz65: convertP3ToXyz65_default
1462
1528
  }
1463
1529
  };
1464
- var definition_default$9 = definition$4;
1530
+ var definition_default$10 = definition$4;
1465
1531
  const gamma$1 = (v) => {
1466
1532
  let abs = Math.abs(v);
1467
1533
  if (abs >= 1 / 512) return Math.sign(v) * Math.pow(abs, 1 / 1.8);
@@ -1501,7 +1567,7 @@ const convertProphotoToXyz50 = (prophoto) => {
1501
1567
  };
1502
1568
  var convertProphotoToXyz50_default = convertProphotoToXyz50;
1503
1569
  const definition$3 = {
1504
- ...definition_default$12,
1570
+ ...definition_default$13,
1505
1571
  mode: "prophoto",
1506
1572
  parse: ["prophoto-rgb"],
1507
1573
  serialize: "prophoto-rgb",
@@ -1514,7 +1580,7 @@ const definition$3 = {
1514
1580
  rgb: (color) => convertXyz50ToRgb_default(convertProphotoToXyz50_default(color))
1515
1581
  }
1516
1582
  };
1517
- var definition_default$10 = definition$3;
1583
+ var definition_default$11 = definition$3;
1518
1584
  const α$1 = 1.09929682680944;
1519
1585
  const β$1 = .018053968510807;
1520
1586
  const gamma = (v) => {
@@ -1558,7 +1624,7 @@ const convertRec2020ToXyz65 = (rec2020) => {
1558
1624
  };
1559
1625
  var convertRec2020ToXyz65_default = convertRec2020ToXyz65;
1560
1626
  const definition$2 = {
1561
- ...definition_default$12,
1627
+ ...definition_default$13,
1562
1628
  mode: "rec2020",
1563
1629
  fromMode: {
1564
1630
  xyz65: convertXyz65ToRec2020_default,
@@ -1571,7 +1637,7 @@ const definition$2 = {
1571
1637
  parse: ["rec2020"],
1572
1638
  serialize: "rec2020"
1573
1639
  };
1574
- var definition_default$11 = definition$2;
1640
+ var definition_default$12 = definition$2;
1575
1641
  const definition$1 = {
1576
1642
  mode: "xyz50",
1577
1643
  parse: ["xyz-d50"],
@@ -1605,7 +1671,7 @@ const definition$1 = {
1605
1671
  }
1606
1672
  }
1607
1673
  };
1608
- var definition_default$13 = definition$1;
1674
+ var definition_default$14 = definition$1;
1609
1675
  const convertXyz65ToXyz50 = (xyz65) => {
1610
1676
  let { x, y, z, alpha } = xyz65;
1611
1677
  if (x === void 0) x = 0;
@@ -1669,7 +1735,7 @@ const definition = {
1669
1735
  }
1670
1736
  }
1671
1737
  };
1672
- var definition_default$14 = definition;
1738
+ var definition_default$15 = definition;
1673
1739
  const r = (value, precision) => Math.round(value * (precision = Math.pow(10, precision))) / precision;
1674
1740
  const round = (precision = 4) => (value) => typeof value === "number" ? r(value, precision) : value;
1675
1741
  var round_default = round;
@@ -1683,16 +1749,17 @@ const converters = {
1683
1749
  hsv: useMode(definition_default$2),
1684
1750
  hwb: useMode(definition_default$3),
1685
1751
  lab: useMode(definition_default$4),
1686
- lch: useMode(definition_default$5),
1687
- lrgb: useMode(definition_default$6),
1688
- oklab: useMode(definition_default$7),
1689
- oklch: useMode(definition_default$8),
1690
- p3: useMode(definition_default$9),
1691
- prophoto: useMode(definition_default$10),
1692
- rec2020: useMode(definition_default$11),
1693
- rgb: useMode(definition_default$12),
1694
- xyz50: useMode(definition_default$13),
1695
- xyz65: useMode(definition_default$14)
1752
+ lab65: useMode(definition_default$5),
1753
+ lch: useMode(definition_default$6),
1754
+ lrgb: useMode(definition_default$7),
1755
+ oklab: useMode(definition_default$8),
1756
+ oklch: useMode(definition_default$9),
1757
+ p3: useMode(definition_default$10),
1758
+ prophoto: useMode(definition_default$11),
1759
+ rec2020: useMode(definition_default$12),
1760
+ rgb: useMode(definition_default$13),
1761
+ xyz50: useMode(definition_default$14),
1762
+ xyz65: useMode(definition_default$15)
1696
1763
  };
1697
1764
  const FORMAT_ID$1 = "css";
1698
1765
 
@@ -1736,22 +1803,25 @@ function pluginTailwind(options) {
1736
1803
  }, ...options?.modeVariants ?? []];
1737
1804
  for (const { variant, mode } of variants) {
1738
1805
  const flatTheme = flattenThemeObj(options.theme);
1739
- for (const { path, value } of flatTheme) for (const token of getTransforms({
1740
- format: FORMAT_ID$1,
1741
- id: value,
1742
- mode
1743
- })) {
1744
- let relName = token.id.split(".").at(-1);
1745
- for (const subgroup of [...Array.isArray(value) ? value : [value]]) {
1746
- const match = subgroup.replace(/\*.*/, "");
1747
- relName = token.id.replace(match, "");
1748
- }
1749
- setTransform(token.id, {
1750
- format: FORMAT_ID,
1751
- localID: `--${path.join("-")}-${relName.replace(/\./g, "-")}`,
1752
- value: typeof token.value === "object" ? token.value["."] : token.value,
1753
- mode: variant
1806
+ for (const { path, value } of flatTheme) {
1807
+ const tokens = getTransforms({
1808
+ format: FORMAT_ID$1,
1809
+ id: value,
1810
+ mode
1754
1811
  });
1812
+ for (const token of tokens) {
1813
+ let relName = token.id.split(".").at(-1);
1814
+ for (const subgroup of [...Array.isArray(value) ? value : [value]]) {
1815
+ const match = subgroup.replace(/\*.*/, "");
1816
+ relName = token.id.replace(match, "");
1817
+ }
1818
+ setTransform(token.id, {
1819
+ format: FORMAT_ID,
1820
+ localID: `--${path.join("-")}-${relName.replace(/\./g, "-")}`,
1821
+ value: typeof token.value === "object" ? token.value["."] : token.value,
1822
+ mode: variant
1823
+ });
1824
+ }
1755
1825
  }
1756
1826
  }
1757
1827
  },