@tangle-network/brand 1.31.0 → 1.31.2
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 +12 -0
- package/README.md +3 -2
- package/bin/drift-baseline.json +15 -13
- package/dist/index.d.ts +111 -111
- package/dist/index.js +111 -111
- package/package.json +1 -1
- package/src/palette.generated.ts +111 -111
- package/src/styles/accent-on-tint.test.ts +4 -1
- package/src/styles/legacy-light.css +1104 -1032
- package/src/styles/named-themes.css +298 -597
- package/src/styles/surface-ladder.test.ts +9 -24
- package/src/styles/system.css +52 -52
- package/src/styles/theme-scopes.ts +12 -21
- package/src/styles/tokens.css +450 -939
- package/src/styles/tokens.test.ts +38 -17
|
@@ -589,25 +589,46 @@ describe("categorical tones are a complete, legible family", () => {
|
|
|
589
589
|
});
|
|
590
590
|
});
|
|
591
591
|
|
|
592
|
-
describe("
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
// values are the generator's, solved from the planes declared here.
|
|
598
|
-
const literalsOutsideTones = (spine: string) => {
|
|
599
|
-
const set = new Set<string>();
|
|
600
|
-
for (const [, name, value] of spine.matchAll(/--([a-z0-9-]+)\s*:\s*([^;]+);/g)) {
|
|
601
|
-
if (/^(tone-|surface-(violet|orange|teal)-)/.test(name)) continue;
|
|
602
|
-
for (const hex of value.match(/#[0-9a-fA-F]{6}\b/g) ?? []) set.add(hex.toLowerCase());
|
|
592
|
+
describe("syntax keywords use a text-safe category role", () => {
|
|
593
|
+
it.each([["dark", DARK], ["light", LIGHT]] as const)("%s keywords clear AA on every code plane", (_, spine) => {
|
|
594
|
+
const ink = hexIn(spine, "syntax-keyword");
|
|
595
|
+
for (const plane of ["hsl-background", "hsl-card", "hsl-popover"]) {
|
|
596
|
+
expect(contrastRatio(ink, hexIn(spine, plane)), `keyword on ${plane}`).toBeGreaterThanOrEqual(4.5);
|
|
603
597
|
}
|
|
604
|
-
|
|
605
|
-
|
|
598
|
+
});
|
|
599
|
+
});
|
|
600
|
+
|
|
601
|
+
describe("text-bearing accent gradients keep AA at every stop", () => {
|
|
602
|
+
const named = readFileSync(path.resolve(import.meta.dirname, "named-themes.css"), "utf8");
|
|
603
|
+
const namedRules = [...named.replace(/\/\*[\s\S]*?\*\//g, "").matchAll(/([^{}]*)\{([^{}]*--hsl-background:[^{}]*)\}/g)];
|
|
604
|
+
const cases = [["dark", [DARK]], ["light", [LIGHT, DARK]], ...namedRules.map(([, selector, body]) => [selector.trim(), [body, /-light|not\(\.dark\)/.test(selector) ? LIGHT : DARK, DARK]])] as const;
|
|
605
|
+
for (const [name, chain] of cases) {
|
|
606
|
+
it(String(name), () => {
|
|
607
|
+
const sources = [...chain];
|
|
608
|
+
const gradient = resolveIn(sources, "accent-gradient-strong");
|
|
609
|
+
const stops = [...gradient.matchAll(/var\(--([a-z0-9-]+)\)/g)].map((match) => match[1]);
|
|
610
|
+
expect(stops.length).toBeGreaterThanOrEqual(2);
|
|
611
|
+
const label = hexIn(sources, "btn-primary-text");
|
|
612
|
+
for (const stop of stops) expect(contrastRatio(hexIn(sources, stop), label), stop).toBeGreaterThanOrEqual(4.5);
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
});
|
|
616
|
+
|
|
617
|
+
describe("the generated palette owns every colour", () => {
|
|
606
618
|
it.each([
|
|
607
|
-
["dark", DARK
|
|
608
|
-
["light", LIGHT
|
|
609
|
-
] as const)("%s spine declares
|
|
610
|
-
|
|
619
|
+
["dark", DARK],
|
|
620
|
+
["light", LIGHT],
|
|
621
|
+
] as const)("%s spine declares at most 30 distinct hex literals, including tones", (_, spine) => {
|
|
622
|
+
const literals = new Set((spine.match(/#[0-9a-fA-F]{6}\b/g) ?? []).map((hex) => hex.toLowerCase()));
|
|
623
|
+
expect(literals.size).toBeLessThanOrEqual(30);
|
|
624
|
+
});
|
|
625
|
+
|
|
626
|
+
it("has no authored hex outside generated blocks", () => {
|
|
627
|
+
const named = readFileSync(path.resolve(import.meta.dirname, "named-themes.css"), "utf8");
|
|
628
|
+
for (const css of [tokens, named]) {
|
|
629
|
+
expect(css).toContain("/* palette:begin");
|
|
630
|
+
expect(css.replace(/\/\* palette:begin[\s\S]*?\/\* palette:end \*\//g, "")).not.toMatch(/#[0-9a-fA-F]{3,8}\b/);
|
|
631
|
+
}
|
|
611
632
|
});
|
|
612
633
|
});
|
|
613
634
|
|