design-constraint-validator 1.0.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.
- package/LICENSE +21 -0
- package/README.md +659 -0
- package/adapters/README.md +46 -0
- package/adapters/css.d.ts +44 -0
- package/adapters/css.d.ts.map +1 -0
- package/adapters/css.js +97 -0
- package/adapters/css.ts +116 -0
- package/adapters/js.d.ts +3 -0
- package/adapters/js.d.ts.map +1 -0
- package/adapters/js.js +15 -0
- package/adapters/js.ts +14 -0
- package/adapters/json.d.ts +18 -0
- package/adapters/json.d.ts.map +1 -0
- package/adapters/json.js +35 -0
- package/adapters/json.ts +45 -0
- package/cli/build-css.d.ts +2 -0
- package/cli/build-css.d.ts.map +1 -0
- package/cli/build-css.js +23 -0
- package/cli/build-css.ts +32 -0
- package/cli/commands/build.d.ts +5 -0
- package/cli/commands/build.d.ts.map +1 -0
- package/cli/commands/build.js +89 -0
- package/cli/commands/build.ts +65 -0
- package/cli/commands/graph.d.ts +3 -0
- package/cli/commands/graph.d.ts.map +1 -0
- package/cli/commands/graph.js +219 -0
- package/cli/commands/graph.ts +137 -0
- package/cli/commands/index.d.ts +8 -0
- package/cli/commands/index.d.ts.map +1 -0
- package/cli/commands/index.js +7 -0
- package/cli/commands/index.ts +7 -0
- package/cli/commands/patch-apply.d.ts +3 -0
- package/cli/commands/patch-apply.d.ts.map +1 -0
- package/cli/commands/patch-apply.js +75 -0
- package/cli/commands/patch-apply.ts +80 -0
- package/cli/commands/patch.d.ts +3 -0
- package/cli/commands/patch.d.ts.map +1 -0
- package/cli/commands/patch.js +21 -0
- package/cli/commands/patch.ts +22 -0
- package/cli/commands/set.d.ts +3 -0
- package/cli/commands/set.d.ts.map +1 -0
- package/cli/commands/set.js +286 -0
- package/cli/commands/set.ts +225 -0
- package/cli/commands/utils.d.ts +4 -0
- package/cli/commands/utils.d.ts.map +1 -0
- package/cli/commands/utils.js +51 -0
- package/cli/commands/utils.ts +50 -0
- package/cli/commands/validate.d.ts +3 -0
- package/cli/commands/validate.d.ts.map +1 -0
- package/cli/commands/validate.js +131 -0
- package/cli/commands/validate.ts +115 -0
- package/cli/commands/why.d.ts +3 -0
- package/cli/commands/why.d.ts.map +1 -0
- package/cli/commands/why.js +64 -0
- package/cli/commands/why.ts +46 -0
- package/cli/config-schema.d.ts +238 -0
- package/cli/config-schema.d.ts.map +1 -0
- package/cli/config-schema.js +21 -0
- package/cli/config-schema.ts +27 -0
- package/cli/config.d.ts +4 -0
- package/cli/config.d.ts.map +1 -0
- package/cli/config.js +37 -0
- package/cli/config.ts +35 -0
- package/cli/dcv.d.ts +3 -0
- package/cli/dcv.d.ts.map +1 -0
- package/cli/dcv.js +86 -0
- package/cli/dcv.ts +107 -0
- package/cli/engine-helpers.d.ts +8 -0
- package/cli/engine-helpers.d.ts.map +1 -0
- package/cli/engine-helpers.js +70 -0
- package/cli/engine-helpers.ts +61 -0
- package/cli/graph-poset.d.ts +9 -0
- package/cli/graph-poset.d.ts.map +1 -0
- package/cli/graph-poset.js +58 -0
- package/cli/graph-poset.ts +74 -0
- package/cli/index.d.ts +3 -0
- package/cli/index.d.ts.map +1 -0
- package/cli/index.js +2 -0
- package/cli/index.ts +2 -0
- package/cli/result.d.ts +17 -0
- package/cli/result.d.ts.map +1 -0
- package/cli/result.js +29 -0
- package/cli/result.ts +27 -0
- package/cli/run.d.ts +3 -0
- package/cli/run.d.ts.map +1 -0
- package/cli/run.js +47 -0
- package/cli/run.ts +54 -0
- package/cli/smoke-test.d.ts +2 -0
- package/cli/smoke-test.d.ts.map +1 -0
- package/cli/smoke-test.js +33 -0
- package/cli/smoke-test.ts +40 -0
- package/cli/types.d.ts +86 -0
- package/cli/types.d.ts.map +1 -0
- package/cli/types.js +1 -0
- package/cli/types.ts +78 -0
- package/core/breakpoints.d.ts +12 -0
- package/core/breakpoints.d.ts.map +1 -0
- package/core/breakpoints.js +48 -0
- package/core/breakpoints.ts +50 -0
- package/core/cli-format.d.ts +8 -0
- package/core/cli-format.d.ts.map +1 -0
- package/core/cli-format.js +29 -0
- package/core/cli-format.ts +31 -0
- package/core/color.d.ts +14 -0
- package/core/color.d.ts.map +1 -0
- package/core/color.js +136 -0
- package/core/color.ts +148 -0
- package/core/constraints/cross-axis.d.ts +33 -0
- package/core/constraints/cross-axis.d.ts.map +1 -0
- package/core/constraints/cross-axis.js +93 -0
- package/core/constraints/cross-axis.ts +114 -0
- package/core/constraints/monotonic-lightness.d.ts +5 -0
- package/core/constraints/monotonic-lightness.d.ts.map +1 -0
- package/core/constraints/monotonic-lightness.js +37 -0
- package/core/constraints/monotonic-lightness.ts +38 -0
- package/core/constraints/monotonic.d.ts +7 -0
- package/core/constraints/monotonic.d.ts.map +1 -0
- package/core/constraints/monotonic.js +65 -0
- package/core/constraints/monotonic.ts +74 -0
- package/core/constraints/threshold.d.ts +10 -0
- package/core/constraints/threshold.d.ts.map +1 -0
- package/core/constraints/threshold.js +36 -0
- package/core/constraints/threshold.ts +43 -0
- package/core/constraints/wcag.d.ts +11 -0
- package/core/constraints/wcag.d.ts.map +1 -0
- package/core/constraints/wcag.js +53 -0
- package/core/constraints/wcag.ts +70 -0
- package/core/cross-axis-config.d.ts +5 -0
- package/core/cross-axis-config.d.ts.map +1 -0
- package/core/cross-axis-config.js +144 -0
- package/core/cross-axis-config.ts +152 -0
- package/core/engine.d.ts +32 -0
- package/core/engine.d.ts.map +1 -0
- package/core/engine.js +46 -0
- package/core/engine.ts +65 -0
- package/core/flatten.d.ts +20 -0
- package/core/flatten.d.ts.map +1 -0
- package/core/flatten.js +80 -0
- package/core/flatten.ts +116 -0
- package/core/image-export.d.ts +10 -0
- package/core/image-export.d.ts.map +1 -0
- package/core/image-export.js +43 -0
- package/core/image-export.ts +48 -0
- package/core/index.d.ts +31 -0
- package/core/index.d.ts.map +1 -0
- package/core/index.js +54 -0
- package/core/index.ts +72 -0
- package/core/patch.d.ts +28 -0
- package/core/patch.d.ts.map +1 -0
- package/core/patch.js +110 -0
- package/core/patch.ts +134 -0
- package/core/poset.d.ts +41 -0
- package/core/poset.d.ts.map +1 -0
- package/core/poset.js +275 -0
- package/core/poset.ts +311 -0
- package/core/why.d.ts +17 -0
- package/core/why.d.ts.map +1 -0
- package/core/why.js +45 -0
- package/core/why.ts +63 -0
- package/dist/test-overrides-removal.json +4 -0
- package/dist/tmp.patch.json +35 -0
- package/package.json +90 -0
- package/themes/color.lg.order.json +15 -0
- package/themes/color.md.order.json +15 -0
- package/themes/color.order.json +15 -0
- package/themes/color.sm.order.json +15 -0
- package/themes/cross-axis.rules.json +36 -0
- package/themes/cross-axis.sm.rules.json +12 -0
- package/themes/layout.lg.order.json +18 -0
- package/themes/layout.md.order.json +18 -0
- package/themes/layout.order.json +18 -0
- package/themes/layout.sm.order.json +18 -0
- package/themes/spacing.order.json +14 -0
- package/themes/typography.lg.order.json +15 -0
- package/themes/typography.md.order.json +15 -0
- package/themes/typography.order.json +15 -0
- package/themes/typography.sm.order.json +15 -0
- package/tokens/overrides/base.json +22 -0
- package/tokens/overrides/lg.json +20 -0
- package/tokens/overrides/md.json +16 -0
- package/tokens/overrides/sm.json +16 -0
- package/tokens/overrides/viol.color.json +6 -0
- package/tokens/overrides/viol.typography.json +6 -0
- package/tokens/tokens.demo-violations.json +116 -0
- package/tokens/tokens.example.json +128 -0
- package/tokens/tokens.json +67 -0
- package/tokens/tokens.multi-violations.json +21 -0
- package/tokens/tokens.schema.d.ts +2298 -0
- package/tokens/tokens.schema.d.ts.map +1 -0
- package/tokens/tokens.schema.js +148 -0
- package/tokens/tokens.schema.ts +196 -0
- package/tokens/tokens.test.json +38 -0
- package/tokens/tokens.touch-violation.json +8 -0
- package/tokens/typography.classes.css +11 -0
- package/tokens/typography.css +20 -0
package/core/why.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { FlatToken } from "./flatten.js";
|
|
2
|
+
|
|
3
|
+
export type WhyReport = {
|
|
4
|
+
id: string;
|
|
5
|
+
value: string | number | undefined;
|
|
6
|
+
raw?: string | number;
|
|
7
|
+
refs?: string[];
|
|
8
|
+
provenance: "base" | "theme" | "override" | "unknown";
|
|
9
|
+
dependsOn: string[]; // immediate refs (parents)
|
|
10
|
+
dependents: string[]; // immediate children
|
|
11
|
+
chain?: string[]; // simple linear chain if raw is a single {ref} repeated
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function makeReverseEdges(edges: Array<[string,string]>): Map<string, Set<string>> {
|
|
15
|
+
const rev = new Map<string, Set<string>>();
|
|
16
|
+
for (const [from, to] of edges) {
|
|
17
|
+
if (!rev.has(to)) rev.set(to, new Set());
|
|
18
|
+
rev.get(to)!.add(from);
|
|
19
|
+
if (!rev.has(from)) rev.set(from, new Set());
|
|
20
|
+
}
|
|
21
|
+
return rev;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function explain(
|
|
25
|
+
id: string,
|
|
26
|
+
flat: Record<string, FlatToken>,
|
|
27
|
+
edges: Array<[string,string]>,
|
|
28
|
+
layers: { overrides?: Record<string, unknown>, theme?: Record<string, unknown> } = {}
|
|
29
|
+
): WhyReport {
|
|
30
|
+
const node = flat[id];
|
|
31
|
+
const rev = makeReverseEdges(edges);
|
|
32
|
+
const dependsOn = Array.from(rev.get(id) ?? []);
|
|
33
|
+
const dependents = edges.filter(([from, _to]) => from === id).map(([_, to]) => to);
|
|
34
|
+
|
|
35
|
+
const prov: WhyReport["provenance"] =
|
|
36
|
+
layers.overrides && id in layers.overrides ? "override" :
|
|
37
|
+
layers.theme && id in layers.theme ? "theme" :
|
|
38
|
+
flat[id] ? "base" : "unknown";
|
|
39
|
+
|
|
40
|
+
// Try to produce a simple chain if it's a 1→1 alias chain
|
|
41
|
+
const chain: string[] = [id];
|
|
42
|
+
let cursor = id; let guard = 0;
|
|
43
|
+
while (guard++ < 32) {
|
|
44
|
+
const f = flat[cursor];
|
|
45
|
+
if (!f || !Array.isArray(f.refs) || f.refs.length !== 1) break;
|
|
46
|
+
const next = f.refs[0];
|
|
47
|
+
chain.push(next);
|
|
48
|
+
cursor = next;
|
|
49
|
+
const nxt = flat[next];
|
|
50
|
+
if (!nxt || !nxt.refs?.length) break;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
id,
|
|
55
|
+
value: node?.value,
|
|
56
|
+
raw: node?.raw,
|
|
57
|
+
refs: node?.refs,
|
|
58
|
+
provenance: prov,
|
|
59
|
+
dependsOn,
|
|
60
|
+
dependents,
|
|
61
|
+
chain: chain.length > 1 ? chain : undefined
|
|
62
|
+
};
|
|
63
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"generatedAt": "2025-11-01T06:31:35.033Z",
|
|
4
|
+
"baseFile": "tokens/tokens.example.json",
|
|
5
|
+
"changes": [
|
|
6
|
+
{
|
|
7
|
+
"id": "color.palette.brand.600",
|
|
8
|
+
"from": "oklch(0.62 0.18 260)",
|
|
9
|
+
"to": "#ffffff",
|
|
10
|
+
"type": "modify"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"id": "color.palette.brand.700",
|
|
14
|
+
"from": "oklch(0.56 0.19 260)",
|
|
15
|
+
"to": null,
|
|
16
|
+
"type": "remove"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"id": "color.role.accent.default",
|
|
20
|
+
"from": "oklch(0.62 0.18 260)",
|
|
21
|
+
"to": "#ffffff",
|
|
22
|
+
"type": "modify"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"patch": {
|
|
26
|
+
"color.palette.brand.600": "#ffffff",
|
|
27
|
+
"color.palette.brand.700": null,
|
|
28
|
+
"color.role.accent.default": "#ffffff"
|
|
29
|
+
},
|
|
30
|
+
"hash": "e925a3d3532d35c4a569788d9b061fda15f0b5b904867094b3cba727091edf3c",
|
|
31
|
+
"baseTokensHash": "9c75c6bc19e4700ab5393e9118c6ce5596727e0fdbba890aaef1ebb831868c26",
|
|
32
|
+
"meta": {
|
|
33
|
+
"changeCount": 3
|
|
34
|
+
}
|
|
35
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "design-constraint-validator",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Mathematical constraint validator for design systems — ensuring consistency, accessibility, and logical coherence",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=18"
|
|
8
|
+
},
|
|
9
|
+
"main": "core/index.js",
|
|
10
|
+
"types": "core/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./core/index.d.ts",
|
|
14
|
+
"import": "./core/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./core/*": "./core/*",
|
|
17
|
+
"./cli/*": "./cli/*"
|
|
18
|
+
},
|
|
19
|
+
"bin": {
|
|
20
|
+
"dcv": "./cli/index.js",
|
|
21
|
+
"design-constraint-validator": "./cli/index.js"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"test:watch": "vitest",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"lint": "eslint . --ext .js,.ts,.mjs,.cjs",
|
|
29
|
+
"format": "prettier -w .",
|
|
30
|
+
"check": "npm run typecheck && npm run lint && npm test",
|
|
31
|
+
"prepublishOnly": "npm run check && npm run build",
|
|
32
|
+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
33
|
+
"release:notes": "npm run changelog && git add CHANGELOG.md && git commit -m \"docs(changelog): update\"",
|
|
34
|
+
"release:patch": "npm version patch && git push && git push --tags && echo '\n⚠️ Now run: npm publish'",
|
|
35
|
+
"release:minor": "npm version minor && git push && git push --tags && echo '\n⚠️ Now run: npm publish'",
|
|
36
|
+
"release:major": "npm version major && git push && git push --tags && echo '\n⚠️ Now run: npm publish'"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [
|
|
39
|
+
"design-constraints",
|
|
40
|
+
"design-systems",
|
|
41
|
+
"constraint-validation",
|
|
42
|
+
"design-tokens",
|
|
43
|
+
"accessibility",
|
|
44
|
+
"wcag",
|
|
45
|
+
"mathematical-validation",
|
|
46
|
+
"typography",
|
|
47
|
+
"color",
|
|
48
|
+
"monotonicity",
|
|
49
|
+
"cli-tool"
|
|
50
|
+
],
|
|
51
|
+
"author": "Cseperke Papp",
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "https://github.com/CseperkePapp/design-constraint-validator.git"
|
|
56
|
+
},
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/CseperkePapp/design-constraint-validator/issues"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://github.com/CseperkePapp/design-constraint-validator#readme",
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"yargs": "^17.0.0",
|
|
63
|
+
"zod": "^3.0.0",
|
|
64
|
+
"fast-glob": "^3.3.2"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@types/node": "^22.0.0",
|
|
68
|
+
"@types/yargs": "^17.0.0",
|
|
69
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
70
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
71
|
+
"eslint": "^9.0.0",
|
|
72
|
+
"eslint-config-prettier": "^9.0.0",
|
|
73
|
+
"prettier": "^3.0.0",
|
|
74
|
+
"tsx": "^4.0.0",
|
|
75
|
+
"typescript": "^5.0.0",
|
|
76
|
+
"vitest": "^3.0.0",
|
|
77
|
+
"conventional-changelog-cli": "^2.2.2"
|
|
78
|
+
},
|
|
79
|
+
"files": [
|
|
80
|
+
"adapters",
|
|
81
|
+
|
|
82
|
+
"dist",
|
|
83
|
+
"cli",
|
|
84
|
+
"core",
|
|
85
|
+
"themes",
|
|
86
|
+
"tokens",
|
|
87
|
+
"README.md",
|
|
88
|
+
"LICENSE"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Color lightness hierarchy constraints - LG breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["color.palette.brand.400", ">=", "color.palette.brand.500"],
|
|
5
|
+
["color.palette.brand.500", ">=", "color.palette.brand.600"],
|
|
6
|
+
["color.palette.brand.600", ">=", "color.palette.brand.700"],
|
|
7
|
+
|
|
8
|
+
["color.palette.gray.300", ">=", "color.palette.gray.400"],
|
|
9
|
+
["color.palette.gray.400", ">=", "color.palette.gray.500"],
|
|
10
|
+
["color.palette.gray.500", ">=", "color.palette.gray.600"],
|
|
11
|
+
["color.palette.gray.600", ">=", "color.palette.gray.900"],
|
|
12
|
+
|
|
13
|
+
["color.palette.brand.600", ">=", "color.palette.gray.500"]
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Color lightness hierarchy constraints - MD breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["color.palette.brand.400", ">=", "color.palette.brand.500"],
|
|
5
|
+
["color.palette.brand.500", ">=", "color.palette.brand.600"],
|
|
6
|
+
["color.palette.brand.600", ">=", "color.palette.brand.700"],
|
|
7
|
+
|
|
8
|
+
["color.palette.gray.300", ">=", "color.palette.gray.400"],
|
|
9
|
+
["color.palette.gray.400", ">=", "color.palette.gray.500"],
|
|
10
|
+
["color.palette.gray.500", ">=", "color.palette.gray.600"],
|
|
11
|
+
["color.palette.gray.600", ">=", "color.palette.gray.900"],
|
|
12
|
+
|
|
13
|
+
["color.palette.brand.600", ">=", "color.palette.gray.500"]
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Color lightness hierarchy constraints - comprehensive brand and gray ladders with bridge constraints",
|
|
3
|
+
"order": [
|
|
4
|
+
["color.palette.brand.400", ">=", "color.palette.brand.500"],
|
|
5
|
+
["color.palette.brand.500", ">=", "color.palette.brand.600"],
|
|
6
|
+
["color.palette.brand.600", ">=", "color.palette.brand.700"],
|
|
7
|
+
|
|
8
|
+
["color.palette.gray.300", ">=", "color.palette.gray.400"],
|
|
9
|
+
["color.palette.gray.400", ">=", "color.palette.gray.500"],
|
|
10
|
+
["color.palette.gray.500", ">=", "color.palette.gray.600"],
|
|
11
|
+
["color.palette.gray.600", ">=", "color.palette.gray.900"],
|
|
12
|
+
|
|
13
|
+
["color.palette.brand.600", ">=", "color.palette.gray.500"]
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Color lightness hierarchy constraints - SM breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["color.palette.brand.400", ">=", "color.palette.brand.500"],
|
|
5
|
+
["color.palette.brand.500", ">=", "color.palette.brand.600"],
|
|
6
|
+
["color.palette.brand.600", ">=", "color.palette.brand.700"],
|
|
7
|
+
|
|
8
|
+
["color.palette.gray.300", ">=", "color.palette.gray.400"],
|
|
9
|
+
["color.palette.gray.400", ">=", "color.palette.gray.500"],
|
|
10
|
+
["color.palette.gray.500", ">=", "color.palette.gray.600"],
|
|
11
|
+
["color.palette.gray.600", ">=", "color.palette.gray.900"],
|
|
12
|
+
|
|
13
|
+
["color.palette.brand.600", ">=", "color.palette.gray.500"]
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"rules": [
|
|
3
|
+
{
|
|
4
|
+
"id": "body-weight-vs-size",
|
|
5
|
+
"level": "error",
|
|
6
|
+
"where": "Body legibility",
|
|
7
|
+
"when": { "id": "typography.weight.body", "op": "<=", "value": 400 },
|
|
8
|
+
"require": { "id": "typography.size.body", "op": ">=", "fallback": "16px" }
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "emphasis-weight-size-balance",
|
|
12
|
+
"level": "warn",
|
|
13
|
+
"where": "Legibility emphasis",
|
|
14
|
+
"when": { "id": "typography.weight.emphasis", "op": ">=", "value": 600 },
|
|
15
|
+
"require": { "id": "typography.size.body", "op": ">=", "fallback": "15px" }
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "heading-emphasis-h2",
|
|
19
|
+
"level": "warn",
|
|
20
|
+
"where": "Heading emphasis",
|
|
21
|
+
"compare": { "a": "typography.size.h2", "op": ">=", "b": "typography.size.body", "delta": "2px" }
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "heading-emphasis-h3",
|
|
25
|
+
"level": "warn",
|
|
26
|
+
"where": "Heading emphasis",
|
|
27
|
+
"compare": { "a": "typography.size.h3", "op": ">=", "b": "typography.size.body", "delta": "2px" }
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "layout-padding-vs-container",
|
|
31
|
+
"level": "warn",
|
|
32
|
+
"where": "Layout density",
|
|
33
|
+
"compare": { "a": "layout.padding.section", "op": "<=", "b": "layout.container.sm", "delta": "-560px" }
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"rules": [
|
|
3
|
+
{
|
|
4
|
+
"id": "body-size-min-sm",
|
|
5
|
+
"bp": "sm",
|
|
6
|
+
"level": "warn",
|
|
7
|
+
"where": "Small screen legibility",
|
|
8
|
+
"when": { "id": "typography.size.body", "op": ">=", "value": 0 },
|
|
9
|
+
"require": { "id": "typography.size.body", "op": ">=", "fallback": "15px" }
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Layout hierarchy order constraints - LG breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["layout.container.xs", "<=", "layout.container.sm"],
|
|
5
|
+
["layout.container.sm", "<=", "layout.container.md"],
|
|
6
|
+
["layout.container.md", "<=", "layout.container.lg"],
|
|
7
|
+
["layout.container.lg", "<=", "layout.container.xl"],
|
|
8
|
+
|
|
9
|
+
["layout.padding.page", ">=", "layout.padding.section"],
|
|
10
|
+
["layout.padding.section", ">=", "layout.padding.card"],
|
|
11
|
+
["layout.padding.card", ">=", "layout.padding.chip"],
|
|
12
|
+
|
|
13
|
+
["layout.grid.gutter", "<=", "layout.padding.section"],
|
|
14
|
+
["layout.grid.gutter", "<=", "layout.padding.card"],
|
|
15
|
+
|
|
16
|
+
["control.size.min", ">=", "layout.padding.card"]
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Layout hierarchy order constraints - MD breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["layout.container.xs", "<=", "layout.container.sm"],
|
|
5
|
+
["layout.container.sm", "<=", "layout.container.md"],
|
|
6
|
+
["layout.container.md", "<=", "layout.container.lg"],
|
|
7
|
+
["layout.container.lg", "<=", "layout.container.xl"],
|
|
8
|
+
|
|
9
|
+
["layout.padding.page", ">=", "layout.padding.section"],
|
|
10
|
+
["layout.padding.section", ">=", "layout.padding.card"],
|
|
11
|
+
["layout.padding.card", ">=", "layout.padding.chip"],
|
|
12
|
+
|
|
13
|
+
["layout.grid.gutter", "<=", "layout.padding.section"],
|
|
14
|
+
["layout.grid.gutter", "<=", "layout.padding.card"],
|
|
15
|
+
|
|
16
|
+
["control.size.min", ">=", "layout.padding.card"]
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Layout hierarchy order constraints - container widths grow, padding hierarchy, gutters ≤ paddings, control touch targets",
|
|
3
|
+
"order": [
|
|
4
|
+
["layout.container.xs", "<=", "layout.container.sm"],
|
|
5
|
+
["layout.container.sm", "<=", "layout.container.md"],
|
|
6
|
+
["layout.container.md", "<=", "layout.container.lg"],
|
|
7
|
+
["layout.container.lg", "<=", "layout.container.xl"],
|
|
8
|
+
|
|
9
|
+
["layout.padding.page", ">=", "layout.padding.section"],
|
|
10
|
+
["layout.padding.section", ">=", "layout.padding.card"],
|
|
11
|
+
["layout.padding.card", ">=", "layout.padding.chip"],
|
|
12
|
+
|
|
13
|
+
["layout.grid.gutter", "<=", "layout.padding.section"],
|
|
14
|
+
["layout.grid.gutter", "<=", "layout.padding.card"],
|
|
15
|
+
|
|
16
|
+
["control.size.min", ">=", "layout.padding.card"]
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Layout hierarchy order constraints - SM breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["layout.container.xs", "<=", "layout.container.sm"],
|
|
5
|
+
["layout.container.sm", "<=", "layout.container.md"],
|
|
6
|
+
["layout.container.md", "<=", "layout.container.lg"],
|
|
7
|
+
["layout.container.lg", "<=", "layout.container.xl"],
|
|
8
|
+
|
|
9
|
+
["layout.padding.page", ">=", "layout.padding.section"],
|
|
10
|
+
["layout.padding.section", ">=", "layout.padding.card"],
|
|
11
|
+
["layout.padding.card", ">=", "layout.padding.chip"],
|
|
12
|
+
|
|
13
|
+
["layout.grid.gutter", "<=", "layout.padding.section"],
|
|
14
|
+
["layout.grid.gutter", "<=", "layout.padding.card"],
|
|
15
|
+
|
|
16
|
+
["control.size.min", ">=", "layout.padding.card"]
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Spacing scale order constraints - defines monotonic spacing hierarchy",
|
|
3
|
+
"order": [
|
|
4
|
+
["size.spacing.12", ">=", "size.spacing.10"],
|
|
5
|
+
["size.spacing.10", ">=", "size.spacing.8"],
|
|
6
|
+
["size.spacing.8", ">=", "size.spacing.6"],
|
|
7
|
+
["size.spacing.6", ">=", "size.spacing.4"],
|
|
8
|
+
["size.spacing.4", ">=", "size.spacing.3"],
|
|
9
|
+
["size.spacing.3", ">=", "size.spacing.2-5"],
|
|
10
|
+
["size.spacing.2-5", ">=", "size.spacing.2"],
|
|
11
|
+
["size.spacing.2", ">=", "size.spacing.1"],
|
|
12
|
+
["size.spacing.1", ">=", "size.spacing.0-5"]
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Typography hierarchy order constraints - LG breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["typography.size.h1", ">=", "typography.size.h2"],
|
|
5
|
+
["typography.size.h2", ">=", "typography.size.h3"],
|
|
6
|
+
["typography.size.h3", ">=", "typography.size.h4"],
|
|
7
|
+
["typography.size.h4", ">=", "typography.size.h5"],
|
|
8
|
+
["typography.size.h5", ">=", "typography.size.h6"],
|
|
9
|
+
|
|
10
|
+
["typography.size.xl", ">=", "typography.size.lg"],
|
|
11
|
+
["typography.size.lg", ">=", "typography.size.base"],
|
|
12
|
+
["typography.size.base", ">=", "typography.size.sm"],
|
|
13
|
+
["typography.size.sm", ">=", "typography.size.xs"]
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Typography hierarchy order constraints - MD breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["typography.size.h1", ">=", "typography.size.h2"],
|
|
5
|
+
["typography.size.h2", ">=", "typography.size.h3"],
|
|
6
|
+
["typography.size.h3", ">=", "typography.size.h4"],
|
|
7
|
+
["typography.size.h4", ">=", "typography.size.h5"],
|
|
8
|
+
["typography.size.h5", ">=", "typography.size.h6"],
|
|
9
|
+
|
|
10
|
+
["typography.size.xl", ">=", "typography.size.lg"],
|
|
11
|
+
["typography.size.lg", ">=", "typography.size.base"],
|
|
12
|
+
["typography.size.base", ">=", "typography.size.sm"],
|
|
13
|
+
["typography.size.sm", ">=", "typography.size.xs"]
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Typography hierarchy order constraints - defines that h1 ≥ h2 ≥ ... ≥ h6 by font size",
|
|
3
|
+
"order": [
|
|
4
|
+
["typography.size.h1", ">=", "typography.size.h2"],
|
|
5
|
+
["typography.size.h2", ">=", "typography.size.h3"],
|
|
6
|
+
["typography.size.h3", ">=", "typography.size.h4"],
|
|
7
|
+
["typography.size.h4", ">=", "typography.size.h5"],
|
|
8
|
+
["typography.size.h5", ">=", "typography.size.h6"],
|
|
9
|
+
|
|
10
|
+
["typography.size.xl", ">=", "typography.size.lg"],
|
|
11
|
+
["typography.size.lg", ">=", "typography.size.base"],
|
|
12
|
+
["typography.size.base", ">=", "typography.size.sm"],
|
|
13
|
+
["typography.size.sm", ">=", "typography.size.xs"]
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$description": "Typography hierarchy order constraints - SM breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["typography.size.h1", ">=", "typography.size.h2"],
|
|
5
|
+
["typography.size.h2", ">=", "typography.size.h3"],
|
|
6
|
+
["typography.size.h3", ">=", "typography.size.h4"],
|
|
7
|
+
["typography.size.h4", ">=", "typography.size.h5"],
|
|
8
|
+
["typography.size.h5", ">=", "typography.size.h6"],
|
|
9
|
+
|
|
10
|
+
["typography.size.xl", ">=", "typography.size.lg"],
|
|
11
|
+
["typography.size.lg", ">=", "typography.size.base"],
|
|
12
|
+
["typography.size.base", ">=", "typography.size.sm"],
|
|
13
|
+
["typography.size.sm", ">=", "typography.size.xs"]
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"overrides": {
|
|
3
|
+
"color": {
|
|
4
|
+
"palette": {
|
|
5
|
+
"brand": {
|
|
6
|
+
"600": {
|
|
7
|
+
"$value": "oklch(0.620 0.180 171)"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"typography": {
|
|
13
|
+
"font": {
|
|
14
|
+
"body": {
|
|
15
|
+
"$value": "Lora"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"links": {},
|
|
21
|
+
"expressions": {}
|
|
22
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": {
|
|
3
|
+
"size": {
|
|
4
|
+
"h1": "oklch(0.15 0.01 0) 3rem/1.1 'Segoe UI', system-ui",
|
|
5
|
+
"h2": "oklch(0.15 0.01 0) 2.25rem/1.2 'Segoe UI', system-ui",
|
|
6
|
+
"body": "oklch(0.20 0.01 0) 1.125rem/1.7 'Segoe UI', system-ui"
|
|
7
|
+
},
|
|
8
|
+
"weight": {
|
|
9
|
+
"body": "300"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"dimension": {
|
|
13
|
+
"spacing": {
|
|
14
|
+
"scale": {
|
|
15
|
+
"section": "4rem",
|
|
16
|
+
"component": "2rem"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": {
|
|
3
|
+
"size": {
|
|
4
|
+
"h1": "oklch(0.15 0.01 0) 2.25rem/1.2 'Segoe UI', system-ui",
|
|
5
|
+
"body": "oklch(0.20 0.01 0) 1rem/1.6 'Segoe UI', system-ui"
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
"dimension": {
|
|
9
|
+
"spacing": {
|
|
10
|
+
"scale": {
|
|
11
|
+
"section": "2.5rem",
|
|
12
|
+
"component": "1.25rem"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": {
|
|
3
|
+
"size": {
|
|
4
|
+
"body": "oklch(0.20 0.01 0) 0.875rem/1.5 'Segoe UI', system-ui",
|
|
5
|
+
"caption": "oklch(0.20 0.01 0) 0.75rem/1.4 'Segoe UI', system-ui"
|
|
6
|
+
}
|
|
7
|
+
},
|
|
8
|
+
"dimension": {
|
|
9
|
+
"spacing": {
|
|
10
|
+
"scale": {
|
|
11
|
+
"section": "1.5rem",
|
|
12
|
+
"component": "0.75rem"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|