@mlola-ui/engine 1.0.9 → 1.0.10
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/generated/themes.json +1 -1
- package/generated/tokens.css +3 -3
- package/generated/tokens.json +7 -7
- package/package.json +1 -1
- package/src/palette.mjs +7 -5
package/generated/themes.json
CHANGED
package/generated/tokens.css
CHANGED
|
@@ -267,9 +267,9 @@
|
|
|
267
267
|
--ml-text-faint: oklch(0.492 0.018 260);
|
|
268
268
|
--ml-border: oklch(0.878 0.023 80);
|
|
269
269
|
--ml-border-subtle: oklch(0.916 0.018 80);
|
|
270
|
-
--ml-primary: oklch(0.
|
|
271
|
-
--ml-primary-foreground: oklch(0.
|
|
272
|
-
--ml-primary-hover: oklch(0.
|
|
270
|
+
--ml-primary: oklch(0.532 0.127 58);
|
|
271
|
+
--ml-primary-foreground: oklch(0.99 0 0);
|
|
272
|
+
--ml-primary-hover: oklch(0.482 0.115 58);
|
|
273
273
|
--ml-primary-text: oklch(0.497 0.119 58);
|
|
274
274
|
--ml-primary-subtle: oklch(0.95 0.031 58);
|
|
275
275
|
--ml-success: oklch(0.507 0.14 150);
|
package/generated/tokens.json
CHANGED
|
@@ -1361,8 +1361,8 @@
|
|
|
1361
1361
|
"$value": {
|
|
1362
1362
|
"colorSpace": "oklch",
|
|
1363
1363
|
"components": [
|
|
1364
|
-
0.
|
|
1365
|
-
0.
|
|
1364
|
+
0.532,
|
|
1365
|
+
0.127,
|
|
1366
1366
|
58
|
|
1367
1367
|
],
|
|
1368
1368
|
"alpha": 1
|
|
@@ -1373,9 +1373,9 @@
|
|
|
1373
1373
|
"$value": {
|
|
1374
1374
|
"colorSpace": "oklch",
|
|
1375
1375
|
"components": [
|
|
1376
|
-
0.
|
|
1377
|
-
0
|
|
1378
|
-
|
|
1376
|
+
0.99,
|
|
1377
|
+
0,
|
|
1378
|
+
0
|
|
1379
1379
|
],
|
|
1380
1380
|
"alpha": 1
|
|
1381
1381
|
}
|
|
@@ -1385,8 +1385,8 @@
|
|
|
1385
1385
|
"$value": {
|
|
1386
1386
|
"colorSpace": "oklch",
|
|
1387
1387
|
"components": [
|
|
1388
|
-
0.
|
|
1389
|
-
0.
|
|
1388
|
+
0.482,
|
|
1389
|
+
0.115,
|
|
1390
1390
|
58
|
|
1391
1391
|
],
|
|
1392
1392
|
"alpha": 1
|
package/package.json
CHANGED
package/src/palette.mjs
CHANGED
|
@@ -126,13 +126,15 @@ const isAchromatic = (color) => color.C < 0.03;
|
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
128
|
* WCAG 2's ratio favours dark ink on mid-tone saturated colors, but eyes read
|
|
129
|
-
* white on a violet, blue, green or
|
|
130
|
-
*
|
|
131
|
-
*
|
|
129
|
+
* white on a violet, blue, green, red or burnt orange far better: dark ink on
|
|
130
|
+
* a mid orange reads as dark on dark. In light mode a chromatic fill darkens a
|
|
131
|
+
* little (at most 0.12 L) so white clears the target. Ambers and yellows keep
|
|
132
|
+
* dark ink, as convention expects, and so does an orange too bright to reach
|
|
133
|
+
* white within that step.
|
|
132
134
|
*/
|
|
133
135
|
function deepenForWhite(fill, mode) {
|
|
134
|
-
const
|
|
135
|
-
if (mode !== "light" || isAchromatic(fill) ||
|
|
136
|
+
const yellow = fill.H >= 65 && fill.H < 130;
|
|
137
|
+
if (mode !== "light" || isAchromatic(fill) || yellow || contrast(WHITE, fill) >= TARGETS.body) return fill;
|
|
136
138
|
const deeper = solveLightness(fill, WHITE, TARGETS.body, "darker");
|
|
137
139
|
return fill.L - deeper.L <= 0.12 ? deeper : fill;
|
|
138
140
|
}
|