design-constraint-validator 1.0.0 → 2.0.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.
Files changed (121) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +229 -659
  3. package/adapters/README.md +46 -46
  4. package/adapters/css.ts +116 -116
  5. package/adapters/decisionthemes.d.ts +44 -0
  6. package/adapters/decisionthemes.d.ts.map +1 -0
  7. package/adapters/decisionthemes.js +35 -0
  8. package/adapters/decisionthemes.ts +59 -0
  9. package/adapters/js.ts +14 -14
  10. package/adapters/json.ts +45 -45
  11. package/cli/build-css.ts +32 -32
  12. package/cli/commands/build.ts +65 -65
  13. package/cli/commands/graph.d.ts.map +1 -1
  14. package/cli/commands/graph.js +26 -10
  15. package/cli/commands/graph.ts +180 -137
  16. package/cli/commands/index.ts +7 -7
  17. package/cli/commands/patch-apply.ts +80 -80
  18. package/cli/commands/patch.ts +22 -22
  19. package/cli/commands/set.d.ts.map +1 -1
  20. package/cli/commands/set.js +12 -4
  21. package/cli/commands/set.ts +239 -225
  22. package/cli/commands/utils.ts +50 -50
  23. package/cli/commands/validate.d.ts.map +1 -1
  24. package/cli/commands/validate.js +89 -33
  25. package/cli/commands/validate.ts +180 -115
  26. package/cli/commands/why.d.ts.map +1 -1
  27. package/cli/commands/why.js +86 -20
  28. package/cli/commands/why.ts +158 -46
  29. package/cli/config-schema.ts +27 -27
  30. package/cli/config.ts +35 -35
  31. package/cli/constraint-registry.d.ts +101 -0
  32. package/cli/constraint-registry.d.ts.map +1 -0
  33. package/cli/constraint-registry.js +225 -0
  34. package/cli/constraint-registry.ts +304 -0
  35. package/cli/constraints-loader.d.ts.map +1 -0
  36. package/cli/cross-axis-loader.d.ts +91 -0
  37. package/cli/cross-axis-loader.d.ts.map +1 -0
  38. package/cli/cross-axis-loader.js +222 -0
  39. package/cli/cross-axis-loader.ts +289 -0
  40. package/cli/dcv.js +4 -0
  41. package/cli/dcv.ts +111 -107
  42. package/cli/engine-helpers.d.ts.map +1 -1
  43. package/cli/graph-poset.ts +74 -74
  44. package/cli/json-output.d.ts +69 -0
  45. package/cli/json-output.d.ts.map +1 -0
  46. package/cli/json-output.js +109 -0
  47. package/cli/json-output.ts +184 -0
  48. package/cli/result.ts +27 -27
  49. package/cli/run.ts +54 -54
  50. package/cli/smoke-test.ts +40 -40
  51. package/cli/types.d.ts +6 -0
  52. package/cli/types.d.ts.map +1 -1
  53. package/cli/types.ts +84 -78
  54. package/cli/version-banner.d.ts +20 -0
  55. package/cli/version-banner.d.ts.map +1 -0
  56. package/cli/version-banner.js +49 -0
  57. package/cli/version-banner.ts +61 -0
  58. package/core/breakpoints.ts +50 -50
  59. package/core/cli-format.ts +31 -31
  60. package/core/color.ts +148 -148
  61. package/core/constraints/cross-axis.ts +114 -114
  62. package/core/constraints/monotonic-lightness.ts +38 -38
  63. package/core/constraints/monotonic.ts +74 -74
  64. package/core/constraints/threshold.ts +43 -43
  65. package/core/constraints/wcag.ts +70 -70
  66. package/core/cross-axis-config.d.ts.map +1 -1
  67. package/core/engine.d.ts +95 -0
  68. package/core/engine.d.ts.map +1 -1
  69. package/core/engine.js +22 -0
  70. package/core/engine.ts +167 -65
  71. package/core/flatten.ts +116 -116
  72. package/core/image-export.ts +48 -48
  73. package/core/index.d.ts +9 -30
  74. package/core/index.d.ts.map +1 -1
  75. package/core/index.js +7 -54
  76. package/core/index.ts +10 -72
  77. package/core/patch.ts +134 -134
  78. package/core/poset.ts +311 -311
  79. package/core/why.ts +63 -63
  80. package/package.json +96 -90
  81. package/themes/color.lg.order.json +15 -15
  82. package/themes/color.md.order.json +15 -15
  83. package/themes/color.order.json +15 -15
  84. package/themes/color.sm.order.json +15 -15
  85. package/themes/cross-axis.rules.json +35 -35
  86. package/themes/cross-axis.sm.rules.json +12 -12
  87. package/themes/layout.lg.order.json +18 -18
  88. package/themes/layout.md.order.json +18 -18
  89. package/themes/layout.order.json +18 -18
  90. package/themes/layout.sm.order.json +18 -18
  91. package/themes/spacing.order.json +14 -14
  92. package/themes/typography.lg.order.json +15 -15
  93. package/themes/typography.md.order.json +15 -15
  94. package/themes/typography.order.json +15 -15
  95. package/themes/typography.sm.order.json +15 -15
  96. package/cli/engine-helpers.d.ts +0 -8
  97. package/cli/engine-helpers.js +0 -70
  98. package/cli/engine-helpers.ts +0 -61
  99. package/core/cross-axis-config.d.ts +0 -5
  100. package/core/cross-axis-config.js +0 -144
  101. package/core/cross-axis-config.ts +0 -152
  102. package/dist/test-overrides-removal.json +0 -4
  103. package/dist/tmp.patch.json +0 -35
  104. package/tokens/overrides/base.json +0 -22
  105. package/tokens/overrides/lg.json +0 -20
  106. package/tokens/overrides/md.json +0 -16
  107. package/tokens/overrides/sm.json +0 -16
  108. package/tokens/overrides/viol.color.json +0 -6
  109. package/tokens/overrides/viol.typography.json +0 -6
  110. package/tokens/tokens.demo-violations.json +0 -116
  111. package/tokens/tokens.example.json +0 -128
  112. package/tokens/tokens.json +0 -67
  113. package/tokens/tokens.multi-violations.json +0 -21
  114. package/tokens/tokens.schema.d.ts +0 -2298
  115. package/tokens/tokens.schema.d.ts.map +0 -1
  116. package/tokens/tokens.schema.js +0 -148
  117. package/tokens/tokens.schema.ts +0 -196
  118. package/tokens/tokens.test.json +0 -38
  119. package/tokens/tokens.touch-violation.json +0 -8
  120. package/tokens/typography.classes.css +0 -11
  121. package/tokens/typography.css +0 -20
package/core/why.ts CHANGED
@@ -1,63 +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
- }
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
+ }
package/package.json CHANGED
@@ -1,90 +1,96 @@
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
- }
1
+ {
2
+ "name": "design-constraint-validator",
3
+ "version": "2.0.1",
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
+ "demo": "cd ../designLab-DEMO && npm run dev",
38
+ "demo:build": "cd ../designLab-DEMO && npm run build",
39
+ "demo:v2": "cd designLab-v2 && npm run dev",
40
+ "demo:v2:build": "cd designLab-v2 && npm run build"
41
+ },
42
+ "keywords": [
43
+ "design-constraints",
44
+ "design-systems",
45
+ "constraint-validation",
46
+ "design-tokens",
47
+ "accessibility",
48
+ "wcag",
49
+ "mathematical-validation",
50
+ "typography",
51
+ "color",
52
+ "monotonicity",
53
+ "cli-tool"
54
+ ],
55
+ "author": "Cseperke Papp",
56
+ "license": "MIT",
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "https://github.com/CseperkePapp/design-constraint-validator.git"
60
+ },
61
+ "bugs": {
62
+ "url": "https://github.com/CseperkePapp/design-constraint-validator/issues"
63
+ },
64
+ "homepage": "https://github.com/CseperkePapp/design-constraint-validator#readme",
65
+ "sideEffects": false,
66
+ "publishConfig": {
67
+ "access": "public"
68
+ },
69
+ "dependencies": {
70
+ "fast-glob": "^3.3.2",
71
+ "yargs": "^17.0.0",
72
+ "zod": "^3.0.0"
73
+ },
74
+ "devDependencies": {
75
+ "@types/node": "^22.0.0",
76
+ "@types/yargs": "^17.0.0",
77
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
78
+ "@typescript-eslint/parser": "^8.0.0",
79
+ "conventional-changelog-cli": "^2.2.2",
80
+ "eslint": "^9.0.0",
81
+ "eslint-config-prettier": "^9.0.0",
82
+ "pdf-parse": "^2.4.5",
83
+ "prettier": "^3.0.0",
84
+ "tsx": "^4.0.0",
85
+ "typescript": "^5.0.0",
86
+ "vitest": "^3.0.0"
87
+ },
88
+ "files": [
89
+ "cli/",
90
+ "core/",
91
+ "adapters/",
92
+ "themes/",
93
+ "LICENSE",
94
+ "README.md"
95
+ ]
96
+ }
@@ -1,15 +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
- }
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
+ }
@@ -1,15 +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
- }
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
+ }
@@ -1,15 +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
- }
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
+ }
@@ -1,15 +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
- }
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
+ }
@@ -1,36 +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
- ]
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
36
  }
@@ -1,12 +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
- }
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
+ }
@@ -1,18 +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
- }
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
+ }
@@ -1,18 +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
- }
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
+ }