@udixio/theme 2.1.8 → 2.1.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/CHANGELOG.md +14 -0
- package/dist/bin.cjs +1 -1
- package/dist/bin.js +1 -1
- package/dist/browser.cjs +2 -2
- package/dist/browser.js +2 -2
- package/dist/{font.plugin-B-Jmkkm-.cjs → font.plugin-B0SKfA9r.cjs} +1 -1
- package/dist/{font.plugin-D6pbgha-.js → font.plugin-BReTQTWQ.js} +1 -1
- package/dist/{load-from-path-Bbqr4QvZ.cjs → load-from-path-BCkiZx6_.cjs} +2 -2
- package/dist/{load-from-path-G7e3Ww6B.js → load-from-path-C4axFso4.js} +1 -1
- package/dist/{loader-BIZmqdOm.js → loader--tJzL1CC.js} +69 -97
- package/dist/{loader-TiTNDWGP.cjs → loader-1Pp2rd0P.cjs} +69 -97
- package/dist/node.cjs +3 -3
- package/dist/node.js +4 -4
- package/dist/variant/variants/udixio.variant.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/variant/variants/udixio.variant.ts +73 -97
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## 2.1.10 (2026-01-18)
|
|
2
|
+
|
|
3
|
+
This was a version bump only for @udixio/theme to align it with other projects, there were no code changes.
|
|
4
|
+
|
|
5
|
+
## 2.1.9 (2026-01-09)
|
|
6
|
+
|
|
7
|
+
### 🩹 Fixes
|
|
8
|
+
|
|
9
|
+
- **theme:** refactor `udixio` variant for improved clarity and maintainability ([0c1266d](https://github.com/Udixio/UI/commit/0c1266d))
|
|
10
|
+
|
|
11
|
+
### ❤️ Thank You
|
|
12
|
+
|
|
13
|
+
- Joël VIGREUX
|
|
14
|
+
|
|
1
15
|
## 2.1.8 (2026-01-07)
|
|
2
16
|
|
|
3
17
|
### 🩹 Fixes
|
package/dist/bin.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const commander = require("commander");
|
|
3
3
|
const chokidar = require("chokidar");
|
|
4
4
|
const chalk = require("chalk");
|
|
5
|
-
const loadFromPath = require("./load-from-path-
|
|
5
|
+
const loadFromPath = require("./load-from-path-BCkiZx6_.cjs");
|
|
6
6
|
const program = new commander.Command();
|
|
7
7
|
async function runOnce(configPath) {
|
|
8
8
|
try {
|
package/dist/bin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import chokidar from "chokidar";
|
|
3
3
|
import chalk from "chalk";
|
|
4
|
-
import { l as loadFromPath } from "./load-from-path-
|
|
4
|
+
import { l as loadFromPath } from "./load-from-path-C4axFso4.js";
|
|
5
5
|
const program = new Command();
|
|
6
6
|
async function runOnce(configPath) {
|
|
7
7
|
try {
|
package/dist/browser.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const loader = require("./loader-
|
|
4
|
-
const font_plugin = require("./font.plugin-
|
|
3
|
+
const loader = require("./loader-1Pp2rd0P.cjs");
|
|
4
|
+
const font_plugin = require("./font.plugin-B0SKfA9r.cjs");
|
|
5
5
|
exports.API = loader.API;
|
|
6
6
|
exports.AppContainer = loader.AppContainer;
|
|
7
7
|
exports.AppModule = loader.AppModule;
|
package/dist/browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader
|
|
2
|
-
import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-
|
|
1
|
+
import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader--tJzL1CC.js";
|
|
2
|
+
import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-BReTQTWQ.js";
|
|
3
3
|
export {
|
|
4
4
|
A as API,
|
|
5
5
|
a as AppContainer,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
4
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
|
-
require("./loader-
|
|
5
|
+
require("./loader-1Pp2rd0P.cjs");
|
|
6
6
|
class PluginAbstract {
|
|
7
7
|
constructor(options) {
|
|
8
8
|
__publicField(this, "options");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import "./loader
|
|
4
|
+
import "./loader--tJzL1CC.js";
|
|
5
5
|
class PluginAbstract {
|
|
6
6
|
constructor(options) {
|
|
7
7
|
__publicField(this, "options");
|
|
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
21
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
|
-
const loader = require("./loader-
|
|
24
|
+
const loader = require("./loader-1Pp2rd0P.cjs");
|
|
25
25
|
const fs = require("node:fs");
|
|
26
26
|
var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
|
|
27
27
|
function _interopNamespaceDefault(e) {
|
|
@@ -44,7 +44,7 @@ const fs__namespace = /* @__PURE__ */ _interopNamespaceDefault(fs);
|
|
|
44
44
|
async function resolveConfig(configPath = "./theme.config") {
|
|
45
45
|
const { createJiti } = await import("jiti");
|
|
46
46
|
const { resolve } = await import("pathe");
|
|
47
|
-
const jiti = createJiti(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("load-from-path-
|
|
47
|
+
const jiti = createJiti(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("load-from-path-BCkiZx6_.cjs", document.baseURI).href, {
|
|
48
48
|
debug: process.env.NODE_ENV === "development",
|
|
49
49
|
fsCache: true,
|
|
50
50
|
interopDefault: true
|
|
@@ -3254,7 +3254,7 @@ const udixioVariant = variant({
|
|
|
3254
3254
|
});
|
|
3255
3255
|
return colors;
|
|
3256
3256
|
},
|
|
3257
|
-
colors: ({ colors, context:
|
|
3257
|
+
colors: ({ colors, context: ctx, palettes }) => {
|
|
3258
3258
|
const getColor = (key) => {
|
|
3259
3259
|
return colors.get(key);
|
|
3260
3260
|
};
|
|
@@ -3265,7 +3265,7 @@ const udixioVariant = variant({
|
|
|
3265
3265
|
surface: {
|
|
3266
3266
|
palette: () => palettes.get("neutral"),
|
|
3267
3267
|
tone: () => {
|
|
3268
|
-
if (
|
|
3268
|
+
if (ctx.isDark) {
|
|
3269
3269
|
return 2;
|
|
3270
3270
|
} else {
|
|
3271
3271
|
return 99;
|
|
@@ -3273,76 +3273,48 @@ const udixioVariant = variant({
|
|
|
3273
3273
|
},
|
|
3274
3274
|
isBackground: true
|
|
3275
3275
|
},
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
// if (c.isDark) {
|
|
3311
|
-
// return 18;
|
|
3312
|
-
// } else {
|
|
3313
|
-
// if (Hct.isYellow(palettes.get('neutral').hue)) {
|
|
3314
|
-
// return 99;
|
|
3315
|
-
// } else if (c.variant.name === 'vibrant') {
|
|
3316
|
-
// return 97;
|
|
3317
|
-
// } else {
|
|
3318
|
-
// return 98;
|
|
3319
|
-
// }
|
|
3320
|
-
// }
|
|
3321
|
-
// },
|
|
3322
|
-
// isBackground: true,
|
|
3323
|
-
// chromaMultiplier: () => {
|
|
3324
|
-
// if (c.isDark) {
|
|
3325
|
-
// if (c.variant.name === 'neutral') {
|
|
3326
|
-
// return 2.5;
|
|
3327
|
-
// } else if (c.variant.name === 'tonalSpot') {
|
|
3328
|
-
// return 1.7;
|
|
3329
|
-
// } else if (c.variant.name === 'expressive') {
|
|
3330
|
-
// return Hct.isYellow(palettes.get('neutral').hue) ? 2.7 : 1.75;
|
|
3331
|
-
// } else if (c.variant.name === 'vibrant') {
|
|
3332
|
-
// return 1.36;
|
|
3333
|
-
// }
|
|
3334
|
-
// }
|
|
3335
|
-
// return 1;
|
|
3336
|
-
// },
|
|
3337
|
-
// },
|
|
3276
|
+
surfaceDim: {
|
|
3277
|
+
palette: () => palettes.get("neutral"),
|
|
3278
|
+
tone: () => {
|
|
3279
|
+
if (ctx.isDark) {
|
|
3280
|
+
return surfaceContainerTone(0.5, { palettes, context: ctx });
|
|
3281
|
+
} else {
|
|
3282
|
+
return surfaceContainerTone(5, { palettes, context: ctx });
|
|
3283
|
+
}
|
|
3284
|
+
},
|
|
3285
|
+
isBackground: true,
|
|
3286
|
+
chromaMultiplier: () => {
|
|
3287
|
+
if (!ctx.isDark) {
|
|
3288
|
+
return 1.7;
|
|
3289
|
+
}
|
|
3290
|
+
return 1;
|
|
3291
|
+
}
|
|
3292
|
+
},
|
|
3293
|
+
surfaceBright: {
|
|
3294
|
+
palette: () => palettes.get("neutral"),
|
|
3295
|
+
tone: () => {
|
|
3296
|
+
if (ctx.isDark) {
|
|
3297
|
+
return surfaceContainerTone(5, { palettes, context: ctx });
|
|
3298
|
+
} else {
|
|
3299
|
+
return surfaceContainerTone(0.5, { palettes, context: ctx });
|
|
3300
|
+
}
|
|
3301
|
+
},
|
|
3302
|
+
isBackground: true,
|
|
3303
|
+
chromaMultiplier: () => {
|
|
3304
|
+
if (ctx.isDark) {
|
|
3305
|
+
return 1.7;
|
|
3306
|
+
}
|
|
3307
|
+
return 1;
|
|
3308
|
+
}
|
|
3309
|
+
},
|
|
3338
3310
|
surfaceContainerLowest: {
|
|
3339
3311
|
palette: () => palettes.get("neutral"),
|
|
3340
|
-
tone: () => surfaceContainerTone(0, { palettes, context:
|
|
3312
|
+
tone: () => surfaceContainerTone(0, { palettes, context: ctx }),
|
|
3341
3313
|
isBackground: true
|
|
3342
3314
|
},
|
|
3343
3315
|
surfaceContainerLow: {
|
|
3344
3316
|
palette: () => palettes.get("neutral"),
|
|
3345
|
-
tone: () => surfaceContainerTone(1, { palettes, context:
|
|
3317
|
+
tone: () => surfaceContainerTone(1, { palettes, context: ctx }),
|
|
3346
3318
|
isBackground: true,
|
|
3347
3319
|
chromaMultiplier: () => {
|
|
3348
3320
|
return 1.25;
|
|
@@ -3350,7 +3322,7 @@ const udixioVariant = variant({
|
|
|
3350
3322
|
},
|
|
3351
3323
|
surfaceContainer: {
|
|
3352
3324
|
palette: () => palettes.get("neutral"),
|
|
3353
|
-
tone: () => surfaceContainerTone(2, { palettes, context:
|
|
3325
|
+
tone: () => surfaceContainerTone(2, { palettes, context: ctx }),
|
|
3354
3326
|
isBackground: true,
|
|
3355
3327
|
chromaMultiplier: () => {
|
|
3356
3328
|
return 1.4;
|
|
@@ -3358,7 +3330,7 @@ const udixioVariant = variant({
|
|
|
3358
3330
|
},
|
|
3359
3331
|
surfaceContainerHigh: {
|
|
3360
3332
|
palette: () => palettes.get("neutral"),
|
|
3361
|
-
tone: () => surfaceContainerTone(3, { palettes, context:
|
|
3333
|
+
tone: () => surfaceContainerTone(3, { palettes, context: ctx }),
|
|
3362
3334
|
isBackground: true,
|
|
3363
3335
|
chromaMultiplier: () => {
|
|
3364
3336
|
return 1.5;
|
|
@@ -3366,7 +3338,7 @@ const udixioVariant = variant({
|
|
|
3366
3338
|
},
|
|
3367
3339
|
surfaceContainerHighest: {
|
|
3368
3340
|
palette: () => palettes.get("neutral"),
|
|
3369
|
-
tone: () => surfaceContainerTone(4, { palettes, context:
|
|
3341
|
+
tone: () => surfaceContainerTone(4, { palettes, context: ctx }),
|
|
3370
3342
|
isBackground: true,
|
|
3371
3343
|
chromaMultiplier: () => {
|
|
3372
3344
|
return 1.7;
|
|
@@ -3375,28 +3347,28 @@ const udixioVariant = variant({
|
|
|
3375
3347
|
onSurface: {
|
|
3376
3348
|
palette: () => palettes.get("neutral"),
|
|
3377
3349
|
tone: () => {
|
|
3378
|
-
return getInitialToneFromBackground(highestSurface(
|
|
3350
|
+
return getInitialToneFromBackground(highestSurface(ctx, colors));
|
|
3379
3351
|
},
|
|
3380
3352
|
chromaMultiplier: () => {
|
|
3381
3353
|
return 1.7;
|
|
3382
3354
|
},
|
|
3383
|
-
background: () => highestSurface(
|
|
3384
|
-
contrastCurve: () =>
|
|
3355
|
+
background: () => highestSurface(ctx, colors),
|
|
3356
|
+
contrastCurve: () => ctx.isDark ? getCurve(11) : getCurve(9)
|
|
3385
3357
|
},
|
|
3386
3358
|
onSurfaceVariant: {
|
|
3387
3359
|
palette: () => palettes.get("neutralVariant"),
|
|
3388
3360
|
chromaMultiplier: () => {
|
|
3389
3361
|
return 1.7;
|
|
3390
3362
|
},
|
|
3391
|
-
background: () => highestSurface(
|
|
3392
|
-
contrastCurve: () =>
|
|
3363
|
+
background: () => highestSurface(ctx, colors),
|
|
3364
|
+
contrastCurve: () => ctx.isDark ? getCurve(6) : getCurve(4.5)
|
|
3393
3365
|
},
|
|
3394
3366
|
outline: {
|
|
3395
3367
|
palette: () => palettes.get("neutralVariant"),
|
|
3396
3368
|
chromaMultiplier: () => {
|
|
3397
3369
|
return 1.7;
|
|
3398
3370
|
},
|
|
3399
|
-
background: () => highestSurface(
|
|
3371
|
+
background: () => highestSurface(ctx, colors),
|
|
3400
3372
|
contrastCurve: () => getCurve(3)
|
|
3401
3373
|
},
|
|
3402
3374
|
outlineVariant: {
|
|
@@ -3404,7 +3376,7 @@ const udixioVariant = variant({
|
|
|
3404
3376
|
chromaMultiplier: () => {
|
|
3405
3377
|
return 1.7;
|
|
3406
3378
|
},
|
|
3407
|
-
background: () => highestSurface(
|
|
3379
|
+
background: () => highestSurface(ctx, colors),
|
|
3408
3380
|
contrastCurve: () => getCurve(1.5)
|
|
3409
3381
|
},
|
|
3410
3382
|
inverseSurface: {
|
|
@@ -3414,7 +3386,7 @@ const udixioVariant = variant({
|
|
|
3414
3386
|
},
|
|
3415
3387
|
inverseOnSurface: {
|
|
3416
3388
|
palette: () => palettes.get("neutral"),
|
|
3417
|
-
tone: () =>
|
|
3389
|
+
tone: () => ctx.isDark ? 20 : 95,
|
|
3418
3390
|
background: () => colors.get("inverseSurface"),
|
|
3419
3391
|
contrastCurve: () => getCurve(7)
|
|
3420
3392
|
},
|
|
@@ -3424,10 +3396,10 @@ const udixioVariant = variant({
|
|
|
3424
3396
|
primary: {
|
|
3425
3397
|
palette: () => palettes.get("primary"),
|
|
3426
3398
|
tone: () => {
|
|
3427
|
-
return
|
|
3399
|
+
return ctx.sourceColor.tone;
|
|
3428
3400
|
},
|
|
3429
3401
|
isBackground: true,
|
|
3430
|
-
background: () => highestSurface(
|
|
3402
|
+
background: () => highestSurface(ctx, colors),
|
|
3431
3403
|
contrastCurve: () => getCurve(4.5),
|
|
3432
3404
|
adjustTone: () => () => {
|
|
3433
3405
|
const surfaceTone = colors.get("surface").getTone();
|
|
@@ -3477,10 +3449,10 @@ const udixioVariant = variant({
|
|
|
3477
3449
|
primaryContainer: {
|
|
3478
3450
|
palette: () => palettes.get("primary"),
|
|
3479
3451
|
tone: () => {
|
|
3480
|
-
return
|
|
3452
|
+
return ctx.isDark ? tMinC(palettes.get("primary"), 35, 93) : tMaxC(palettes.get("primary"), 0, 90);
|
|
3481
3453
|
},
|
|
3482
3454
|
isBackground: true,
|
|
3483
|
-
background: () => highestSurface(
|
|
3455
|
+
background: () => highestSurface(ctx, colors),
|
|
3484
3456
|
adjustTone: () => toneDeltaPair(
|
|
3485
3457
|
colors.get("primary"),
|
|
3486
3458
|
colors.get("primaryContainer"),
|
|
@@ -3489,7 +3461,7 @@ const udixioVariant = variant({
|
|
|
3489
3461
|
true,
|
|
3490
3462
|
"farther"
|
|
3491
3463
|
),
|
|
3492
|
-
contrastCurve: () =>
|
|
3464
|
+
contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
|
|
3493
3465
|
},
|
|
3494
3466
|
onPrimaryContainer: {
|
|
3495
3467
|
palette: () => palettes.get("primary"),
|
|
@@ -3550,10 +3522,10 @@ const udixioVariant = variant({
|
|
|
3550
3522
|
secondary: {
|
|
3551
3523
|
palette: () => palettes.get("secondary"),
|
|
3552
3524
|
tone: () => {
|
|
3553
|
-
return
|
|
3525
|
+
return ctx.isDark ? 80 : tMaxC(palettes.get("secondary"));
|
|
3554
3526
|
},
|
|
3555
3527
|
isBackground: true,
|
|
3556
|
-
background: () => highestSurface(
|
|
3528
|
+
background: () => highestSurface(ctx, colors),
|
|
3557
3529
|
contrastCurve: () => getCurve(4.5),
|
|
3558
3530
|
adjustTone: () => toneDeltaPair(
|
|
3559
3531
|
getColor("secondaryContainer"),
|
|
@@ -3594,12 +3566,12 @@ const udixioVariant = variant({
|
|
|
3594
3566
|
secondaryContainer: {
|
|
3595
3567
|
palette: () => palettes.get("secondary"),
|
|
3596
3568
|
tone: () => {
|
|
3597
|
-
return
|
|
3569
|
+
return ctx.isDark ? 25 : 90;
|
|
3598
3570
|
},
|
|
3599
3571
|
isBackground: true,
|
|
3600
|
-
background: () => highestSurface(
|
|
3572
|
+
background: () => highestSurface(ctx, colors),
|
|
3601
3573
|
adjustTone: () => void 0,
|
|
3602
|
-
contrastCurve: () =>
|
|
3574
|
+
contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
|
|
3603
3575
|
},
|
|
3604
3576
|
onSecondaryContainer: {
|
|
3605
3577
|
palette: () => palettes.get("secondary"),
|
|
@@ -3654,10 +3626,10 @@ const udixioVariant = variant({
|
|
|
3654
3626
|
tertiary: {
|
|
3655
3627
|
palette: () => palettes.get("tertiary"),
|
|
3656
3628
|
tone: () => {
|
|
3657
|
-
return
|
|
3629
|
+
return ctx.isDark ? tMaxC(palettes.get("tertiary"), 0, 98) : tMaxC(palettes.get("tertiary"));
|
|
3658
3630
|
},
|
|
3659
3631
|
isBackground: true,
|
|
3660
|
-
background: () => highestSurface(
|
|
3632
|
+
background: () => highestSurface(ctx, colors),
|
|
3661
3633
|
contrastCurve: () => getCurve(4.5),
|
|
3662
3634
|
adjustTone: () => toneDeltaPair(
|
|
3663
3635
|
getColor("tertiaryContainer"),
|
|
@@ -3698,12 +3670,12 @@ const udixioVariant = variant({
|
|
|
3698
3670
|
tertiaryContainer: {
|
|
3699
3671
|
palette: () => palettes.get("tertiary"),
|
|
3700
3672
|
tone: () => {
|
|
3701
|
-
return tMaxC(palettes.get("tertiary"), 0,
|
|
3673
|
+
return tMaxC(palettes.get("tertiary"), 0, ctx.isDark ? 93 : 100);
|
|
3702
3674
|
},
|
|
3703
3675
|
isBackground: true,
|
|
3704
|
-
background: () => highestSurface(
|
|
3676
|
+
background: () => highestSurface(ctx, colors),
|
|
3705
3677
|
adjustTone: () => void 0,
|
|
3706
|
-
contrastCurve: () =>
|
|
3678
|
+
contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
|
|
3707
3679
|
},
|
|
3708
3680
|
onTertiaryContainer: {
|
|
3709
3681
|
palette: () => palettes.get("tertiary"),
|
|
@@ -3758,10 +3730,10 @@ const udixioVariant = variant({
|
|
|
3758
3730
|
error: {
|
|
3759
3731
|
palette: () => palettes.get("error"),
|
|
3760
3732
|
tone: () => {
|
|
3761
|
-
return
|
|
3733
|
+
return ctx.isDark ? tMinC(palettes.get("error"), 0, 98) : tMaxC(palettes.get("error"));
|
|
3762
3734
|
},
|
|
3763
3735
|
isBackground: true,
|
|
3764
|
-
background: () => highestSurface(
|
|
3736
|
+
background: () => highestSurface(ctx, colors),
|
|
3765
3737
|
contrastCurve: () => getCurve(4.5),
|
|
3766
3738
|
adjustTone: () => toneDeltaPair(
|
|
3767
3739
|
colors.get("errorContainer"),
|
|
@@ -3796,12 +3768,12 @@ const udixioVariant = variant({
|
|
|
3796
3768
|
errorContainer: {
|
|
3797
3769
|
palette: () => palettes.get("error"),
|
|
3798
3770
|
tone: () => {
|
|
3799
|
-
return
|
|
3771
|
+
return ctx.isDark ? tMinC(palettes.get("error"), 30, 93) : tMaxC(palettes.get("error"), 0, 90);
|
|
3800
3772
|
},
|
|
3801
3773
|
isBackground: true,
|
|
3802
|
-
background: () => highestSurface(
|
|
3774
|
+
background: () => highestSurface(ctx, colors),
|
|
3803
3775
|
adjustTone: () => void 0,
|
|
3804
|
-
contrastCurve: () =>
|
|
3776
|
+
contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
|
|
3805
3777
|
},
|
|
3806
3778
|
onErrorContainer: {
|
|
3807
3779
|
palette: () => palettes.get("error"),
|
|
@@ -3255,7 +3255,7 @@ const udixioVariant = variant({
|
|
|
3255
3255
|
});
|
|
3256
3256
|
return colors;
|
|
3257
3257
|
},
|
|
3258
|
-
colors: ({ colors, context:
|
|
3258
|
+
colors: ({ colors, context: ctx, palettes }) => {
|
|
3259
3259
|
const getColor = (key) => {
|
|
3260
3260
|
return colors.get(key);
|
|
3261
3261
|
};
|
|
@@ -3266,7 +3266,7 @@ const udixioVariant = variant({
|
|
|
3266
3266
|
surface: {
|
|
3267
3267
|
palette: () => palettes.get("neutral"),
|
|
3268
3268
|
tone: () => {
|
|
3269
|
-
if (
|
|
3269
|
+
if (ctx.isDark) {
|
|
3270
3270
|
return 2;
|
|
3271
3271
|
} else {
|
|
3272
3272
|
return 99;
|
|
@@ -3274,76 +3274,48 @@ const udixioVariant = variant({
|
|
|
3274
3274
|
},
|
|
3275
3275
|
isBackground: true
|
|
3276
3276
|
},
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
// if (c.isDark) {
|
|
3312
|
-
// return 18;
|
|
3313
|
-
// } else {
|
|
3314
|
-
// if (Hct.isYellow(palettes.get('neutral').hue)) {
|
|
3315
|
-
// return 99;
|
|
3316
|
-
// } else if (c.variant.name === 'vibrant') {
|
|
3317
|
-
// return 97;
|
|
3318
|
-
// } else {
|
|
3319
|
-
// return 98;
|
|
3320
|
-
// }
|
|
3321
|
-
// }
|
|
3322
|
-
// },
|
|
3323
|
-
// isBackground: true,
|
|
3324
|
-
// chromaMultiplier: () => {
|
|
3325
|
-
// if (c.isDark) {
|
|
3326
|
-
// if (c.variant.name === 'neutral') {
|
|
3327
|
-
// return 2.5;
|
|
3328
|
-
// } else if (c.variant.name === 'tonalSpot') {
|
|
3329
|
-
// return 1.7;
|
|
3330
|
-
// } else if (c.variant.name === 'expressive') {
|
|
3331
|
-
// return Hct.isYellow(palettes.get('neutral').hue) ? 2.7 : 1.75;
|
|
3332
|
-
// } else if (c.variant.name === 'vibrant') {
|
|
3333
|
-
// return 1.36;
|
|
3334
|
-
// }
|
|
3335
|
-
// }
|
|
3336
|
-
// return 1;
|
|
3337
|
-
// },
|
|
3338
|
-
// },
|
|
3277
|
+
surfaceDim: {
|
|
3278
|
+
palette: () => palettes.get("neutral"),
|
|
3279
|
+
tone: () => {
|
|
3280
|
+
if (ctx.isDark) {
|
|
3281
|
+
return surfaceContainerTone(0.5, { palettes, context: ctx });
|
|
3282
|
+
} else {
|
|
3283
|
+
return surfaceContainerTone(5, { palettes, context: ctx });
|
|
3284
|
+
}
|
|
3285
|
+
},
|
|
3286
|
+
isBackground: true,
|
|
3287
|
+
chromaMultiplier: () => {
|
|
3288
|
+
if (!ctx.isDark) {
|
|
3289
|
+
return 1.7;
|
|
3290
|
+
}
|
|
3291
|
+
return 1;
|
|
3292
|
+
}
|
|
3293
|
+
},
|
|
3294
|
+
surfaceBright: {
|
|
3295
|
+
palette: () => palettes.get("neutral"),
|
|
3296
|
+
tone: () => {
|
|
3297
|
+
if (ctx.isDark) {
|
|
3298
|
+
return surfaceContainerTone(5, { palettes, context: ctx });
|
|
3299
|
+
} else {
|
|
3300
|
+
return surfaceContainerTone(0.5, { palettes, context: ctx });
|
|
3301
|
+
}
|
|
3302
|
+
},
|
|
3303
|
+
isBackground: true,
|
|
3304
|
+
chromaMultiplier: () => {
|
|
3305
|
+
if (ctx.isDark) {
|
|
3306
|
+
return 1.7;
|
|
3307
|
+
}
|
|
3308
|
+
return 1;
|
|
3309
|
+
}
|
|
3310
|
+
},
|
|
3339
3311
|
surfaceContainerLowest: {
|
|
3340
3312
|
palette: () => palettes.get("neutral"),
|
|
3341
|
-
tone: () => surfaceContainerTone(0, { palettes, context:
|
|
3313
|
+
tone: () => surfaceContainerTone(0, { palettes, context: ctx }),
|
|
3342
3314
|
isBackground: true
|
|
3343
3315
|
},
|
|
3344
3316
|
surfaceContainerLow: {
|
|
3345
3317
|
palette: () => palettes.get("neutral"),
|
|
3346
|
-
tone: () => surfaceContainerTone(1, { palettes, context:
|
|
3318
|
+
tone: () => surfaceContainerTone(1, { palettes, context: ctx }),
|
|
3347
3319
|
isBackground: true,
|
|
3348
3320
|
chromaMultiplier: () => {
|
|
3349
3321
|
return 1.25;
|
|
@@ -3351,7 +3323,7 @@ const udixioVariant = variant({
|
|
|
3351
3323
|
},
|
|
3352
3324
|
surfaceContainer: {
|
|
3353
3325
|
palette: () => palettes.get("neutral"),
|
|
3354
|
-
tone: () => surfaceContainerTone(2, { palettes, context:
|
|
3326
|
+
tone: () => surfaceContainerTone(2, { palettes, context: ctx }),
|
|
3355
3327
|
isBackground: true,
|
|
3356
3328
|
chromaMultiplier: () => {
|
|
3357
3329
|
return 1.4;
|
|
@@ -3359,7 +3331,7 @@ const udixioVariant = variant({
|
|
|
3359
3331
|
},
|
|
3360
3332
|
surfaceContainerHigh: {
|
|
3361
3333
|
palette: () => palettes.get("neutral"),
|
|
3362
|
-
tone: () => surfaceContainerTone(3, { palettes, context:
|
|
3334
|
+
tone: () => surfaceContainerTone(3, { palettes, context: ctx }),
|
|
3363
3335
|
isBackground: true,
|
|
3364
3336
|
chromaMultiplier: () => {
|
|
3365
3337
|
return 1.5;
|
|
@@ -3367,7 +3339,7 @@ const udixioVariant = variant({
|
|
|
3367
3339
|
},
|
|
3368
3340
|
surfaceContainerHighest: {
|
|
3369
3341
|
palette: () => palettes.get("neutral"),
|
|
3370
|
-
tone: () => surfaceContainerTone(4, { palettes, context:
|
|
3342
|
+
tone: () => surfaceContainerTone(4, { palettes, context: ctx }),
|
|
3371
3343
|
isBackground: true,
|
|
3372
3344
|
chromaMultiplier: () => {
|
|
3373
3345
|
return 1.7;
|
|
@@ -3376,28 +3348,28 @@ const udixioVariant = variant({
|
|
|
3376
3348
|
onSurface: {
|
|
3377
3349
|
palette: () => palettes.get("neutral"),
|
|
3378
3350
|
tone: () => {
|
|
3379
|
-
return getInitialToneFromBackground(highestSurface(
|
|
3351
|
+
return getInitialToneFromBackground(highestSurface(ctx, colors));
|
|
3380
3352
|
},
|
|
3381
3353
|
chromaMultiplier: () => {
|
|
3382
3354
|
return 1.7;
|
|
3383
3355
|
},
|
|
3384
|
-
background: () => highestSurface(
|
|
3385
|
-
contrastCurve: () =>
|
|
3356
|
+
background: () => highestSurface(ctx, colors),
|
|
3357
|
+
contrastCurve: () => ctx.isDark ? getCurve(11) : getCurve(9)
|
|
3386
3358
|
},
|
|
3387
3359
|
onSurfaceVariant: {
|
|
3388
3360
|
palette: () => palettes.get("neutralVariant"),
|
|
3389
3361
|
chromaMultiplier: () => {
|
|
3390
3362
|
return 1.7;
|
|
3391
3363
|
},
|
|
3392
|
-
background: () => highestSurface(
|
|
3393
|
-
contrastCurve: () =>
|
|
3364
|
+
background: () => highestSurface(ctx, colors),
|
|
3365
|
+
contrastCurve: () => ctx.isDark ? getCurve(6) : getCurve(4.5)
|
|
3394
3366
|
},
|
|
3395
3367
|
outline: {
|
|
3396
3368
|
palette: () => palettes.get("neutralVariant"),
|
|
3397
3369
|
chromaMultiplier: () => {
|
|
3398
3370
|
return 1.7;
|
|
3399
3371
|
},
|
|
3400
|
-
background: () => highestSurface(
|
|
3372
|
+
background: () => highestSurface(ctx, colors),
|
|
3401
3373
|
contrastCurve: () => getCurve(3)
|
|
3402
3374
|
},
|
|
3403
3375
|
outlineVariant: {
|
|
@@ -3405,7 +3377,7 @@ const udixioVariant = variant({
|
|
|
3405
3377
|
chromaMultiplier: () => {
|
|
3406
3378
|
return 1.7;
|
|
3407
3379
|
},
|
|
3408
|
-
background: () => highestSurface(
|
|
3380
|
+
background: () => highestSurface(ctx, colors),
|
|
3409
3381
|
contrastCurve: () => getCurve(1.5)
|
|
3410
3382
|
},
|
|
3411
3383
|
inverseSurface: {
|
|
@@ -3415,7 +3387,7 @@ const udixioVariant = variant({
|
|
|
3415
3387
|
},
|
|
3416
3388
|
inverseOnSurface: {
|
|
3417
3389
|
palette: () => palettes.get("neutral"),
|
|
3418
|
-
tone: () =>
|
|
3390
|
+
tone: () => ctx.isDark ? 20 : 95,
|
|
3419
3391
|
background: () => colors.get("inverseSurface"),
|
|
3420
3392
|
contrastCurve: () => getCurve(7)
|
|
3421
3393
|
},
|
|
@@ -3425,10 +3397,10 @@ const udixioVariant = variant({
|
|
|
3425
3397
|
primary: {
|
|
3426
3398
|
palette: () => palettes.get("primary"),
|
|
3427
3399
|
tone: () => {
|
|
3428
|
-
return
|
|
3400
|
+
return ctx.sourceColor.tone;
|
|
3429
3401
|
},
|
|
3430
3402
|
isBackground: true,
|
|
3431
|
-
background: () => highestSurface(
|
|
3403
|
+
background: () => highestSurface(ctx, colors),
|
|
3432
3404
|
contrastCurve: () => getCurve(4.5),
|
|
3433
3405
|
adjustTone: () => () => {
|
|
3434
3406
|
const surfaceTone = colors.get("surface").getTone();
|
|
@@ -3478,10 +3450,10 @@ const udixioVariant = variant({
|
|
|
3478
3450
|
primaryContainer: {
|
|
3479
3451
|
palette: () => palettes.get("primary"),
|
|
3480
3452
|
tone: () => {
|
|
3481
|
-
return
|
|
3453
|
+
return ctx.isDark ? tMinC(palettes.get("primary"), 35, 93) : tMaxC(palettes.get("primary"), 0, 90);
|
|
3482
3454
|
},
|
|
3483
3455
|
isBackground: true,
|
|
3484
|
-
background: () => highestSurface(
|
|
3456
|
+
background: () => highestSurface(ctx, colors),
|
|
3485
3457
|
adjustTone: () => toneDeltaPair(
|
|
3486
3458
|
colors.get("primary"),
|
|
3487
3459
|
colors.get("primaryContainer"),
|
|
@@ -3490,7 +3462,7 @@ const udixioVariant = variant({
|
|
|
3490
3462
|
true,
|
|
3491
3463
|
"farther"
|
|
3492
3464
|
),
|
|
3493
|
-
contrastCurve: () =>
|
|
3465
|
+
contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
|
|
3494
3466
|
},
|
|
3495
3467
|
onPrimaryContainer: {
|
|
3496
3468
|
palette: () => palettes.get("primary"),
|
|
@@ -3551,10 +3523,10 @@ const udixioVariant = variant({
|
|
|
3551
3523
|
secondary: {
|
|
3552
3524
|
palette: () => palettes.get("secondary"),
|
|
3553
3525
|
tone: () => {
|
|
3554
|
-
return
|
|
3526
|
+
return ctx.isDark ? 80 : tMaxC(palettes.get("secondary"));
|
|
3555
3527
|
},
|
|
3556
3528
|
isBackground: true,
|
|
3557
|
-
background: () => highestSurface(
|
|
3529
|
+
background: () => highestSurface(ctx, colors),
|
|
3558
3530
|
contrastCurve: () => getCurve(4.5),
|
|
3559
3531
|
adjustTone: () => toneDeltaPair(
|
|
3560
3532
|
getColor("secondaryContainer"),
|
|
@@ -3595,12 +3567,12 @@ const udixioVariant = variant({
|
|
|
3595
3567
|
secondaryContainer: {
|
|
3596
3568
|
palette: () => palettes.get("secondary"),
|
|
3597
3569
|
tone: () => {
|
|
3598
|
-
return
|
|
3570
|
+
return ctx.isDark ? 25 : 90;
|
|
3599
3571
|
},
|
|
3600
3572
|
isBackground: true,
|
|
3601
|
-
background: () => highestSurface(
|
|
3573
|
+
background: () => highestSurface(ctx, colors),
|
|
3602
3574
|
adjustTone: () => void 0,
|
|
3603
|
-
contrastCurve: () =>
|
|
3575
|
+
contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
|
|
3604
3576
|
},
|
|
3605
3577
|
onSecondaryContainer: {
|
|
3606
3578
|
palette: () => palettes.get("secondary"),
|
|
@@ -3655,10 +3627,10 @@ const udixioVariant = variant({
|
|
|
3655
3627
|
tertiary: {
|
|
3656
3628
|
palette: () => palettes.get("tertiary"),
|
|
3657
3629
|
tone: () => {
|
|
3658
|
-
return
|
|
3630
|
+
return ctx.isDark ? tMaxC(palettes.get("tertiary"), 0, 98) : tMaxC(palettes.get("tertiary"));
|
|
3659
3631
|
},
|
|
3660
3632
|
isBackground: true,
|
|
3661
|
-
background: () => highestSurface(
|
|
3633
|
+
background: () => highestSurface(ctx, colors),
|
|
3662
3634
|
contrastCurve: () => getCurve(4.5),
|
|
3663
3635
|
adjustTone: () => toneDeltaPair(
|
|
3664
3636
|
getColor("tertiaryContainer"),
|
|
@@ -3699,12 +3671,12 @@ const udixioVariant = variant({
|
|
|
3699
3671
|
tertiaryContainer: {
|
|
3700
3672
|
palette: () => palettes.get("tertiary"),
|
|
3701
3673
|
tone: () => {
|
|
3702
|
-
return tMaxC(palettes.get("tertiary"), 0,
|
|
3674
|
+
return tMaxC(palettes.get("tertiary"), 0, ctx.isDark ? 93 : 100);
|
|
3703
3675
|
},
|
|
3704
3676
|
isBackground: true,
|
|
3705
|
-
background: () => highestSurface(
|
|
3677
|
+
background: () => highestSurface(ctx, colors),
|
|
3706
3678
|
adjustTone: () => void 0,
|
|
3707
|
-
contrastCurve: () =>
|
|
3679
|
+
contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
|
|
3708
3680
|
},
|
|
3709
3681
|
onTertiaryContainer: {
|
|
3710
3682
|
palette: () => palettes.get("tertiary"),
|
|
@@ -3759,10 +3731,10 @@ const udixioVariant = variant({
|
|
|
3759
3731
|
error: {
|
|
3760
3732
|
palette: () => palettes.get("error"),
|
|
3761
3733
|
tone: () => {
|
|
3762
|
-
return
|
|
3734
|
+
return ctx.isDark ? tMinC(palettes.get("error"), 0, 98) : tMaxC(palettes.get("error"));
|
|
3763
3735
|
},
|
|
3764
3736
|
isBackground: true,
|
|
3765
|
-
background: () => highestSurface(
|
|
3737
|
+
background: () => highestSurface(ctx, colors),
|
|
3766
3738
|
contrastCurve: () => getCurve(4.5),
|
|
3767
3739
|
adjustTone: () => toneDeltaPair(
|
|
3768
3740
|
colors.get("errorContainer"),
|
|
@@ -3797,12 +3769,12 @@ const udixioVariant = variant({
|
|
|
3797
3769
|
errorContainer: {
|
|
3798
3770
|
palette: () => palettes.get("error"),
|
|
3799
3771
|
tone: () => {
|
|
3800
|
-
return
|
|
3772
|
+
return ctx.isDark ? tMinC(palettes.get("error"), 30, 93) : tMaxC(palettes.get("error"), 0, 90);
|
|
3801
3773
|
},
|
|
3802
3774
|
isBackground: true,
|
|
3803
|
-
background: () => highestSurface(
|
|
3775
|
+
background: () => highestSurface(ctx, colors),
|
|
3804
3776
|
adjustTone: () => void 0,
|
|
3805
|
-
contrastCurve: () =>
|
|
3777
|
+
contrastCurve: () => ctx.contrastLevel > 0 ? getCurve(1.5) : void 0
|
|
3806
3778
|
},
|
|
3807
3779
|
onErrorContainer: {
|
|
3808
3780
|
palette: () => palettes.get("error"),
|
package/dist/node.cjs
CHANGED
|
@@ -22,9 +22,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
22
22
|
mod
|
|
23
23
|
));
|
|
24
24
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
25
|
-
const loader = require("./loader-
|
|
26
|
-
const font_plugin = require("./font.plugin-
|
|
27
|
-
const loadFromPath = require("./load-from-path-
|
|
25
|
+
const loader = require("./loader-1Pp2rd0P.cjs");
|
|
26
|
+
const font_plugin = require("./font.plugin-B0SKfA9r.cjs");
|
|
27
|
+
const loadFromPath = require("./load-from-path-BCkiZx6_.cjs");
|
|
28
28
|
let unpluginInstance = null;
|
|
29
29
|
const createUnpluginTheme = async () => {
|
|
30
30
|
if (unpluginInstance) {
|
package/dist/node.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader
|
|
2
|
-
import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-
|
|
3
|
-
import { l as loadFromPath } from "./load-from-path-
|
|
4
|
-
import { r as r2 } from "./load-from-path-
|
|
1
|
+
import { A, a, b, h, i, C, j, k, e, f, o, n, q, D, P, r, s, v, u, V, z, c, d, m, F, g, w, x, l, p, G, B, t, y, E } from "./loader--tJzL1CC.js";
|
|
2
|
+
import { F as F2, b as b2, P as P2, a as a2, d as d2 } from "./font.plugin-BReTQTWQ.js";
|
|
3
|
+
import { l as loadFromPath } from "./load-from-path-C4axFso4.js";
|
|
4
|
+
import { r as r2 } from "./load-from-path-C4axFso4.js";
|
|
5
5
|
let unpluginInstance = null;
|
|
6
6
|
const createUnpluginTheme = async () => {
|
|
7
7
|
if (unpluginInstance) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"udixio.variant.d.ts","sourceRoot":"","sources":["../../../src/variant/variants/udixio.variant.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,OAAO,EAAE,MAAM,YAAY,CAAC;AAuD9E,eAAO,MAAM,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"udixio.variant.d.ts","sourceRoot":"","sources":["../../../src/variant/variants/udixio.variant.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,OAAO,EAAE,MAAM,YAAY,CAAC;AAuD9E,eAAO,MAAM,aAAa,EAAE,OAovB1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -231,7 +231,7 @@ export const udixioVariant: Variant = variant({
|
|
|
231
231
|
|
|
232
232
|
return colors;
|
|
233
233
|
},
|
|
234
|
-
colors: ({ colors, context:
|
|
234
|
+
colors: ({ colors, context: ctx, palettes }) => {
|
|
235
235
|
const getColor = (key: DynamicColorKey) => {
|
|
236
236
|
return colors.get(key);
|
|
237
237
|
};
|
|
@@ -243,7 +243,7 @@ export const udixioVariant: Variant = variant({
|
|
|
243
243
|
surface: {
|
|
244
244
|
palette: () => palettes.get('neutral'),
|
|
245
245
|
tone: () => {
|
|
246
|
-
if (
|
|
246
|
+
if (ctx.isDark) {
|
|
247
247
|
return 2;
|
|
248
248
|
} else {
|
|
249
249
|
return 99;
|
|
@@ -251,76 +251,48 @@ export const udixioVariant: Variant = variant({
|
|
|
251
251
|
},
|
|
252
252
|
isBackground: true,
|
|
253
253
|
},
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
// if (c.isDark) {
|
|
289
|
-
// return 18;
|
|
290
|
-
// } else {
|
|
291
|
-
// if (Hct.isYellow(palettes.get('neutral').hue)) {
|
|
292
|
-
// return 99;
|
|
293
|
-
// } else if (c.variant.name === 'vibrant') {
|
|
294
|
-
// return 97;
|
|
295
|
-
// } else {
|
|
296
|
-
// return 98;
|
|
297
|
-
// }
|
|
298
|
-
// }
|
|
299
|
-
// },
|
|
300
|
-
// isBackground: true,
|
|
301
|
-
// chromaMultiplier: () => {
|
|
302
|
-
// if (c.isDark) {
|
|
303
|
-
// if (c.variant.name === 'neutral') {
|
|
304
|
-
// return 2.5;
|
|
305
|
-
// } else if (c.variant.name === 'tonalSpot') {
|
|
306
|
-
// return 1.7;
|
|
307
|
-
// } else if (c.variant.name === 'expressive') {
|
|
308
|
-
// return Hct.isYellow(palettes.get('neutral').hue) ? 2.7 : 1.75;
|
|
309
|
-
// } else if (c.variant.name === 'vibrant') {
|
|
310
|
-
// return 1.36;
|
|
311
|
-
// }
|
|
312
|
-
// }
|
|
313
|
-
// return 1;
|
|
314
|
-
// },
|
|
315
|
-
// },
|
|
254
|
+
surfaceDim: {
|
|
255
|
+
palette: () => palettes.get('neutral'),
|
|
256
|
+
tone: () => {
|
|
257
|
+
if (ctx.isDark) {
|
|
258
|
+
return surfaceContainerTone(0.5, { palettes, context: ctx });
|
|
259
|
+
} else {
|
|
260
|
+
return surfaceContainerTone(5, { palettes, context: ctx });
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
isBackground: true,
|
|
264
|
+
chromaMultiplier: () => {
|
|
265
|
+
if (!ctx.isDark) {
|
|
266
|
+
return 1.7;
|
|
267
|
+
}
|
|
268
|
+
return 1;
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
surfaceBright: {
|
|
272
|
+
palette: () => palettes.get('neutral'),
|
|
273
|
+
tone: () => {
|
|
274
|
+
if (ctx.isDark) {
|
|
275
|
+
return surfaceContainerTone(5, { palettes, context: ctx });
|
|
276
|
+
} else {
|
|
277
|
+
return surfaceContainerTone(0.5, { palettes, context: ctx });
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
isBackground: true,
|
|
281
|
+
chromaMultiplier: () => {
|
|
282
|
+
if (ctx.isDark) {
|
|
283
|
+
return 1.7;
|
|
284
|
+
}
|
|
285
|
+
return 1;
|
|
286
|
+
},
|
|
287
|
+
},
|
|
316
288
|
surfaceContainerLowest: {
|
|
317
289
|
palette: () => palettes.get('neutral'),
|
|
318
|
-
tone: () => surfaceContainerTone(0, { palettes, context:
|
|
290
|
+
tone: () => surfaceContainerTone(0, { palettes, context: ctx }),
|
|
319
291
|
isBackground: true,
|
|
320
292
|
},
|
|
321
293
|
surfaceContainerLow: {
|
|
322
294
|
palette: () => palettes.get('neutral'),
|
|
323
|
-
tone: () => surfaceContainerTone(1, { palettes, context:
|
|
295
|
+
tone: () => surfaceContainerTone(1, { palettes, context: ctx }),
|
|
324
296
|
isBackground: true,
|
|
325
297
|
chromaMultiplier: () => {
|
|
326
298
|
return 1.25;
|
|
@@ -328,7 +300,7 @@ export const udixioVariant: Variant = variant({
|
|
|
328
300
|
},
|
|
329
301
|
surfaceContainer: {
|
|
330
302
|
palette: () => palettes.get('neutral'),
|
|
331
|
-
tone: () => surfaceContainerTone(2, { palettes, context:
|
|
303
|
+
tone: () => surfaceContainerTone(2, { palettes, context: ctx }),
|
|
332
304
|
isBackground: true,
|
|
333
305
|
chromaMultiplier: () => {
|
|
334
306
|
return 1.4;
|
|
@@ -336,7 +308,7 @@ export const udixioVariant: Variant = variant({
|
|
|
336
308
|
},
|
|
337
309
|
surfaceContainerHigh: {
|
|
338
310
|
palette: () => palettes.get('neutral'),
|
|
339
|
-
tone: () => surfaceContainerTone(3, { palettes, context:
|
|
311
|
+
tone: () => surfaceContainerTone(3, { palettes, context: ctx }),
|
|
340
312
|
isBackground: true,
|
|
341
313
|
chromaMultiplier: () => {
|
|
342
314
|
return 1.5;
|
|
@@ -344,7 +316,7 @@ export const udixioVariant: Variant = variant({
|
|
|
344
316
|
},
|
|
345
317
|
surfaceContainerHighest: {
|
|
346
318
|
palette: () => palettes.get('neutral'),
|
|
347
|
-
tone: () => surfaceContainerTone(4, { palettes, context:
|
|
319
|
+
tone: () => surfaceContainerTone(4, { palettes, context: ctx }),
|
|
348
320
|
isBackground: true,
|
|
349
321
|
chromaMultiplier: () => {
|
|
350
322
|
return 1.7;
|
|
@@ -353,28 +325,28 @@ export const udixioVariant: Variant = variant({
|
|
|
353
325
|
onSurface: {
|
|
354
326
|
palette: () => palettes.get('neutral'),
|
|
355
327
|
tone: () => {
|
|
356
|
-
return getInitialToneFromBackground(highestSurface(
|
|
328
|
+
return getInitialToneFromBackground(highestSurface(ctx, colors));
|
|
357
329
|
},
|
|
358
330
|
chromaMultiplier: () => {
|
|
359
331
|
return 1.7;
|
|
360
332
|
},
|
|
361
|
-
background: () => highestSurface(
|
|
362
|
-
contrastCurve: () => (
|
|
333
|
+
background: () => highestSurface(ctx, colors),
|
|
334
|
+
contrastCurve: () => (ctx.isDark ? getCurve(11) : getCurve(9)),
|
|
363
335
|
},
|
|
364
336
|
onSurfaceVariant: {
|
|
365
337
|
palette: () => palettes.get('neutralVariant'),
|
|
366
338
|
chromaMultiplier: () => {
|
|
367
339
|
return 1.7;
|
|
368
340
|
},
|
|
369
|
-
background: () => highestSurface(
|
|
370
|
-
contrastCurve: () => (
|
|
341
|
+
background: () => highestSurface(ctx, colors),
|
|
342
|
+
contrastCurve: () => (ctx.isDark ? getCurve(6) : getCurve(4.5)),
|
|
371
343
|
},
|
|
372
344
|
outline: {
|
|
373
345
|
palette: () => palettes.get('neutralVariant'),
|
|
374
346
|
chromaMultiplier: () => {
|
|
375
347
|
return 1.7;
|
|
376
348
|
},
|
|
377
|
-
background: () => highestSurface(
|
|
349
|
+
background: () => highestSurface(ctx, colors),
|
|
378
350
|
contrastCurve: () => getCurve(3),
|
|
379
351
|
},
|
|
380
352
|
outlineVariant: {
|
|
@@ -382,7 +354,7 @@ export const udixioVariant: Variant = variant({
|
|
|
382
354
|
chromaMultiplier: () => {
|
|
383
355
|
return 1.7;
|
|
384
356
|
},
|
|
385
|
-
background: () => highestSurface(
|
|
357
|
+
background: () => highestSurface(ctx, colors),
|
|
386
358
|
contrastCurve: () => getCurve(1.5),
|
|
387
359
|
},
|
|
388
360
|
inverseSurface: {
|
|
@@ -392,7 +364,7 @@ export const udixioVariant: Variant = variant({
|
|
|
392
364
|
},
|
|
393
365
|
inverseOnSurface: {
|
|
394
366
|
palette: () => palettes.get('neutral'),
|
|
395
|
-
tone: () => (
|
|
367
|
+
tone: () => (ctx.isDark ? 20 : 95),
|
|
396
368
|
background: () => colors.get('inverseSurface'),
|
|
397
369
|
contrastCurve: () => getCurve(7),
|
|
398
370
|
},
|
|
@@ -402,10 +374,10 @@ export const udixioVariant: Variant = variant({
|
|
|
402
374
|
primary: {
|
|
403
375
|
palette: () => palettes.get('primary'),
|
|
404
376
|
tone: () => {
|
|
405
|
-
return
|
|
377
|
+
return ctx.sourceColor.tone;
|
|
406
378
|
},
|
|
407
379
|
isBackground: true,
|
|
408
|
-
background: () => highestSurface(
|
|
380
|
+
background: () => highestSurface(ctx, colors),
|
|
409
381
|
contrastCurve: () => getCurve(4.5),
|
|
410
382
|
adjustTone: () => () => {
|
|
411
383
|
const surfaceTone = colors.get('surface').getTone();
|
|
@@ -456,12 +428,12 @@ export const udixioVariant: Variant = variant({
|
|
|
456
428
|
primaryContainer: {
|
|
457
429
|
palette: () => palettes.get('primary'),
|
|
458
430
|
tone: () => {
|
|
459
|
-
return
|
|
431
|
+
return ctx.isDark
|
|
460
432
|
? tMinC(palettes.get('primary'), 35, 93)
|
|
461
433
|
: tMaxC(palettes.get('primary'), 0, 90);
|
|
462
434
|
},
|
|
463
435
|
isBackground: true,
|
|
464
|
-
background: () => highestSurface(
|
|
436
|
+
background: () => highestSurface(ctx, colors),
|
|
465
437
|
adjustTone: () =>
|
|
466
438
|
toneDeltaPair(
|
|
467
439
|
colors.get('primary'),
|
|
@@ -471,7 +443,8 @@ export const udixioVariant: Variant = variant({
|
|
|
471
443
|
true,
|
|
472
444
|
'farther',
|
|
473
445
|
),
|
|
474
|
-
contrastCurve: () =>
|
|
446
|
+
contrastCurve: () =>
|
|
447
|
+
ctx.contrastLevel > 0 ? getCurve(1.5) : undefined,
|
|
475
448
|
},
|
|
476
449
|
onPrimaryContainer: {
|
|
477
450
|
palette: () => palettes.get('primary'),
|
|
@@ -537,10 +510,10 @@ export const udixioVariant: Variant = variant({
|
|
|
537
510
|
secondary: {
|
|
538
511
|
palette: () => palettes.get('secondary'),
|
|
539
512
|
tone: () => {
|
|
540
|
-
return
|
|
513
|
+
return ctx.isDark ? 80 : tMaxC(palettes.get('secondary'));
|
|
541
514
|
},
|
|
542
515
|
isBackground: true,
|
|
543
|
-
background: () => highestSurface(
|
|
516
|
+
background: () => highestSurface(ctx, colors),
|
|
544
517
|
contrastCurve: () => getCurve(4.5),
|
|
545
518
|
adjustTone: () =>
|
|
546
519
|
toneDeltaPair(
|
|
@@ -582,12 +555,13 @@ export const udixioVariant: Variant = variant({
|
|
|
582
555
|
secondaryContainer: {
|
|
583
556
|
palette: () => palettes.get('secondary'),
|
|
584
557
|
tone: () => {
|
|
585
|
-
return
|
|
558
|
+
return ctx.isDark ? 25 : 90;
|
|
586
559
|
},
|
|
587
560
|
isBackground: true,
|
|
588
|
-
background: () => highestSurface(
|
|
561
|
+
background: () => highestSurface(ctx, colors),
|
|
589
562
|
adjustTone: () => undefined,
|
|
590
|
-
contrastCurve: () =>
|
|
563
|
+
contrastCurve: () =>
|
|
564
|
+
ctx.contrastLevel > 0 ? getCurve(1.5) : undefined,
|
|
591
565
|
},
|
|
592
566
|
onSecondaryContainer: {
|
|
593
567
|
palette: () => palettes.get('secondary'),
|
|
@@ -647,12 +621,12 @@ export const udixioVariant: Variant = variant({
|
|
|
647
621
|
tertiary: {
|
|
648
622
|
palette: () => palettes.get('tertiary'),
|
|
649
623
|
tone: () => {
|
|
650
|
-
return
|
|
624
|
+
return ctx.isDark
|
|
651
625
|
? tMaxC(palettes.get('tertiary'), 0, 98)
|
|
652
626
|
: tMaxC(palettes.get('tertiary'));
|
|
653
627
|
},
|
|
654
628
|
isBackground: true,
|
|
655
|
-
background: () => highestSurface(
|
|
629
|
+
background: () => highestSurface(ctx, colors),
|
|
656
630
|
contrastCurve: () => getCurve(4.5),
|
|
657
631
|
adjustTone: () =>
|
|
658
632
|
toneDeltaPair(
|
|
@@ -694,12 +668,13 @@ export const udixioVariant: Variant = variant({
|
|
|
694
668
|
tertiaryContainer: {
|
|
695
669
|
palette: () => palettes.get('tertiary'),
|
|
696
670
|
tone: () => {
|
|
697
|
-
return tMaxC(palettes.get('tertiary'), 0,
|
|
671
|
+
return tMaxC(palettes.get('tertiary'), 0, ctx.isDark ? 93 : 100);
|
|
698
672
|
},
|
|
699
673
|
isBackground: true,
|
|
700
|
-
background: () => highestSurface(
|
|
674
|
+
background: () => highestSurface(ctx, colors),
|
|
701
675
|
adjustTone: () => undefined,
|
|
702
|
-
contrastCurve: () =>
|
|
676
|
+
contrastCurve: () =>
|
|
677
|
+
ctx.contrastLevel > 0 ? getCurve(1.5) : undefined,
|
|
703
678
|
},
|
|
704
679
|
onTertiaryContainer: {
|
|
705
680
|
palette: () => palettes.get('tertiary'),
|
|
@@ -760,12 +735,12 @@ export const udixioVariant: Variant = variant({
|
|
|
760
735
|
error: {
|
|
761
736
|
palette: () => palettes.get('error'),
|
|
762
737
|
tone: () => {
|
|
763
|
-
return
|
|
738
|
+
return ctx.isDark
|
|
764
739
|
? tMinC(palettes.get('error'), 0, 98)
|
|
765
740
|
: tMaxC(palettes.get('error'));
|
|
766
741
|
},
|
|
767
742
|
isBackground: true,
|
|
768
|
-
background: () => highestSurface(
|
|
743
|
+
background: () => highestSurface(ctx, colors),
|
|
769
744
|
contrastCurve: () => getCurve(4.5),
|
|
770
745
|
adjustTone: () =>
|
|
771
746
|
toneDeltaPair(
|
|
@@ -801,14 +776,15 @@ export const udixioVariant: Variant = variant({
|
|
|
801
776
|
errorContainer: {
|
|
802
777
|
palette: () => palettes.get('error'),
|
|
803
778
|
tone: () => {
|
|
804
|
-
return
|
|
779
|
+
return ctx.isDark
|
|
805
780
|
? tMinC(palettes.get('error'), 30, 93)
|
|
806
781
|
: tMaxC(palettes.get('error'), 0, 90);
|
|
807
782
|
},
|
|
808
783
|
isBackground: true,
|
|
809
|
-
background: () => highestSurface(
|
|
784
|
+
background: () => highestSurface(ctx, colors),
|
|
810
785
|
adjustTone: () => undefined,
|
|
811
|
-
contrastCurve: () =>
|
|
786
|
+
contrastCurve: () =>
|
|
787
|
+
ctx.contrastLevel > 0 ? getCurve(1.5) : undefined,
|
|
812
788
|
},
|
|
813
789
|
onErrorContainer: {
|
|
814
790
|
palette: () => palettes.get('error'),
|