@patternfly/design-tokens 1.14.6 → 1.14.8

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 (87) hide show
  1. package/build/css/tokens-charts-dark.scss +2 -2
  2. package/build/css/tokens-charts.scss +2 -2
  3. package/build/css/tokens-dark.scss +52 -4
  4. package/build/css/tokens-default.scss +68 -14
  5. package/build/css/tokens-glass-dark.scss +9 -0
  6. package/build/css/tokens-glass.scss +9 -0
  7. package/build/css/tokens-highcontrast-dark.scss +2 -2
  8. package/build/css/tokens-highcontrast.scss +2 -2
  9. package/build/css/tokens-palette.scss +2 -2
  10. package/build/css/tokens-redhat-dark.scss +14 -0
  11. package/build/css/tokens-redhat-glass-dark.scss +16 -0
  12. package/build/css/tokens-redhat-glass.scss +15 -0
  13. package/build/css/tokens-redhat-highcontrast-dark.scss +47 -0
  14. package/build/css/tokens-redhat-highcontrast.scss +127 -0
  15. package/build/css/tokens-redhat.scss +15 -0
  16. package/build.js +208 -13
  17. package/config.dark.json +1 -1
  18. package/config.default.json +1 -1
  19. package/config.glass.dark.json +23 -0
  20. package/config.glass.json +24 -0
  21. package/config.layers.glass-dark.json +19 -0
  22. package/config.layers.glass.json +19 -0
  23. package/config.layers.highcontrast-dark.json +19 -0
  24. package/config.layers.highcontrast.json +19 -0
  25. package/config.layers.redhat-dark.json +22 -0
  26. package/config.layers.redhat-glass-dark.json +22 -0
  27. package/config.layers.redhat-glass.json +22 -0
  28. package/config.layers.redhat-highcontrast-dark.json +22 -0
  29. package/config.layers.redhat-highcontrast.json +22 -0
  30. package/config.layers.redhat.json +22 -0
  31. package/config.redhat-dark.json +25 -0
  32. package/config.redhat-glass-dark.json +25 -0
  33. package/config.redhat-glass.json +26 -0
  34. package/config.redhat-highcontrast-dark.json +25 -0
  35. package/config.redhat-highcontrast.json +26 -0
  36. package/config.redhat.json +26 -0
  37. package/package.json +2 -2
  38. package/patternfly-docs/content/all-patternfly-tokens.md +24 -1
  39. package/patternfly-docs/content/token-layers-glass-dark.json +38562 -0
  40. package/patternfly-docs/content/token-layers-glass.json +41600 -0
  41. package/patternfly-docs/content/token-layers-highcontrast-dark.json +38385 -0
  42. package/patternfly-docs/content/token-layers-highcontrast.json +53091 -0
  43. package/patternfly-docs/content/token-layers-redhat-dark.json +48501 -0
  44. package/patternfly-docs/content/token-layers-redhat-glass-dark.json +38233 -0
  45. package/patternfly-docs/content/token-layers-redhat-glass.json +41282 -0
  46. package/patternfly-docs/content/token-layers-redhat-highcontrast-dark.json +38223 -0
  47. package/patternfly-docs/content/token-layers-redhat-highcontrast.json +52773 -0
  48. package/patternfly-docs/content/token-layers-redhat.json +65159 -0
  49. package/plugins/export-patternfly-tokens/dist/code.js +26 -10
  50. package/plugins/export-patternfly-tokens/dist/ui.html +65 -21
  51. package/plugins/export-patternfly-tokens/src/code.ts +29 -10
  52. package/plugins/export-patternfly-tokens/src/ui.tsx +65 -20
  53. package/tokens/{dark → default/dark}/base.dark.json +83 -43
  54. package/tokens/{dark → default/dark}/charts.dark.json +4 -4
  55. package/tokens/{highcontrast-dark → default/dark}/palette.color.json +8 -0
  56. package/tokens/{dark → default/dark}/semantic.dark.json +235 -12
  57. package/tokens/default/{base.dimension.json → glass/base.dimension.json} +2 -2
  58. package/tokens/{highcontrast → default/glass}/base.json +45 -5
  59. package/tokens/{dark → default/glass}/palette.color.json +8 -0
  60. package/tokens/default/glass/semantic.glass.json +1996 -0
  61. package/tokens/{highcontrast-dark → default/glass-dark}/base.dark.json +83 -43
  62. package/tokens/{highcontrast → default/glass-dark}/palette.color.json +8 -0
  63. package/tokens/default/glass-dark/semantic.glass.dark.json +1996 -0
  64. package/tokens/{highcontrast → default/highcontrast}/base.dimension.json +2 -2
  65. package/tokens/default/{base.json → highcontrast/base.json} +45 -5
  66. package/tokens/default/highcontrast/palette.color.json +335 -0
  67. package/tokens/{highcontrast → default/highcontrast}/semantic.dimension.highcontrast.json +87 -51
  68. package/tokens/{highcontrast → default/highcontrast}/semantic.highcontrast.json +246 -23
  69. package/tokens/default/highcontrast-dark/base.dark.json +473 -0
  70. package/tokens/default/{palette.color.json → highcontrast-dark/palette.color.json} +8 -0
  71. package/tokens/{highcontrast-dark → default/highcontrast-dark}/semantic.highcontrast.dark.json +234 -11
  72. package/tokens/default/light/base.dimension.json +387 -0
  73. package/tokens/default/light/base.json +611 -0
  74. package/tokens/default/{charts.json → light/charts.json} +4 -4
  75. package/tokens/default/light/palette.color.json +335 -0
  76. package/tokens/default/{semantic.dimension.json → light/semantic.dimension.json} +90 -54
  77. package/tokens/default/{semantic.json → light/semantic.json} +235 -12
  78. package/tokens/default/{semantic.motion.json → light/semantic.motion.json} +28 -28
  79. package/tokens/redhat/dark/redhat.color.dark.json +62 -0
  80. package/tokens/redhat/glass/redhat.color.glass.json +49 -0
  81. package/tokens/redhat/glass-dark/redhat.color.glass.dark.json +62 -0
  82. package/tokens/redhat/highcontrast/redhat.color.highcontrast.json +49 -0
  83. package/tokens/redhat/highcontrast/redhat.dimension.highcontrast.json +23 -0
  84. package/tokens/redhat/highcontrast-dark/redhat.color.highcontrast.dark.json +49 -0
  85. package/tokens/redhat/light/redhat.color.json +49 -0
  86. package/tokens/redhat/light/redhat.dimension.json +23 -0
  87. /package/tokens/default/{base.motion.json → light/base.motion.json} +0 -0
@@ -0,0 +1,127 @@
1
+
2
+ // Do not edit directly
3
+ // Generated on Tue, 10 Feb 2026 20:40:25 GMT
4
+
5
+ // Only tokens that differ from base theme (120 tokens)
6
+ @mixin pf-v6-tokens {
7
+ --pf-t--global--border--color--nonstatus--green--default: var(--pf-t--global--color--nonstatus--green--400);
8
+ --pf-t--global--border--color--status--success--default: var(--pf-t--global--color--status--success--150);
9
+ --pf-t--global--border--width--action--plain--clicked: var(--pf-t--global--border--width--200);
10
+ --pf-t--global--border--width--action--plain--hover: var(--pf-t--global--border--width--100);
11
+ --pf-t--global--border--width--control--hover: var(--pf-t--global--border--width--200);
12
+ --pf-t--global--border--width--main--default: var(--pf-t--global--border--width--200);
13
+ --pf-t--global--border--color--brand--accent--clicked: var(--pf-t--global--color--brand--accent--400);
14
+ --pf-t--global--border--color--brand--accent--default: var(--pf-t--global--color--brand--accent--400);
15
+ --pf-t--global--border--color--brand--accent--hover: var(--pf-t--global--color--brand--accent--400);
16
+ --pf-t--global--border--color--brand--subtle--clicked: var(--pf-t--global--color--brand--subtle--400);
17
+ --pf-t--global--border--color--brand--subtle--hover: var(--pf-t--global--color--brand--subtle--400);
18
+ --pf-t--global--border--color--clicked: var(--pf-t--global--color--brand--400);
19
+ --pf-t--global--border--color--control--default: var(--pf-t--global--border--color--400);
20
+ --pf-t--global--border--color--default: var(--pf-t--global--border--color--400);
21
+ --pf-t--global--border--color--hover: var(--pf-t--global--color--brand--300);
22
+ --pf-t--global--border--color--nonstatus--blue--clicked: var(--pf-t--global--color--nonstatus--blue--500);
23
+ --pf-t--global--border--color--nonstatus--blue--default: var(--pf-t--global--color--nonstatus--blue--400);
24
+ --pf-t--global--border--color--nonstatus--blue--hover: var(--pf-t--global--color--nonstatus--blue--500);
25
+ --pf-t--global--border--color--nonstatus--gray--clicked: var(--pf-t--global--color--nonstatus--gray--500);
26
+ --pf-t--global--border--color--nonstatus--gray--default: var(--pf-t--global--color--nonstatus--gray--400);
27
+ --pf-t--global--border--color--nonstatus--gray--hover: var(--pf-t--global--color--nonstatus--gray--500);
28
+ --pf-t--global--border--color--nonstatus--green--clicked: var(--pf-t--global--color--nonstatus--green--500);
29
+ --pf-t--global--border--color--nonstatus--green--hover: var(--pf-t--global--color--nonstatus--green--500);
30
+ --pf-t--global--border--color--nonstatus--orange--clicked: var(--pf-t--global--color--nonstatus--orange--500);
31
+ --pf-t--global--border--color--nonstatus--orange--default: var(--pf-t--global--color--nonstatus--orange--400);
32
+ --pf-t--global--border--color--nonstatus--orange--hover: var(--pf-t--global--color--nonstatus--orange--500);
33
+ --pf-t--global--border--color--nonstatus--orangered--clicked: var(--pf-t--global--color--nonstatus--orangered--500);
34
+ --pf-t--global--border--color--nonstatus--orangered--default: var(--pf-t--global--color--nonstatus--orangered--400);
35
+ --pf-t--global--border--color--nonstatus--orangered--hover: var(--pf-t--global--color--nonstatus--orangered--500);
36
+ --pf-t--global--border--color--nonstatus--purple--clicked: var(--pf-t--global--color--nonstatus--purple--500);
37
+ --pf-t--global--border--color--nonstatus--purple--default: var(--pf-t--global--color--nonstatus--purple--400);
38
+ --pf-t--global--border--color--nonstatus--purple--hover: var(--pf-t--global--color--nonstatus--purple--500);
39
+ --pf-t--global--border--color--nonstatus--red--clicked: var(--pf-t--global--color--nonstatus--red--500);
40
+ --pf-t--global--border--color--nonstatus--red--default: var(--pf-t--global--color--nonstatus--red--400);
41
+ --pf-t--global--border--color--nonstatus--red--hover: var(--pf-t--global--color--nonstatus--red--500);
42
+ --pf-t--global--border--color--nonstatus--teal--clicked: var(--pf-t--global--color--nonstatus--teal--500);
43
+ --pf-t--global--border--color--nonstatus--teal--default: var(--pf-t--global--color--nonstatus--teal--400);
44
+ --pf-t--global--border--color--nonstatus--teal--hover: var(--pf-t--global--color--nonstatus--teal--500);
45
+ --pf-t--global--border--color--nonstatus--yellow--clicked: var(--pf-t--global--color--nonstatus--yellow--500);
46
+ --pf-t--global--border--color--nonstatus--yellow--default: var(--pf-t--global--color--nonstatus--yellow--400);
47
+ --pf-t--global--border--color--nonstatus--yellow--hover: var(--pf-t--global--color--nonstatus--yellow--500);
48
+ --pf-t--global--border--color--on-secondary: var(--pf-t--global--border--color--400);
49
+ --pf-t--global--border--color--status--success--clicked: var(--pf-t--global--color--status--success--200);
50
+ --pf-t--global--border--color--status--success--hover: var(--pf-t--global--color--status--success--200);
51
+ --pf-t--global--border--color--status--warning--clicked: var(--pf-t--global--color--status--warning--600);
52
+ --pf-t--global--border--color--status--warning--default: var(--pf-t--global--color--status--warning--500);
53
+ --pf-t--global--border--color--status--warning--hover: var(--pf-t--global--color--status--warning--600);
54
+ --pf-t--global--border--color--subtle: var(--pf-t--global--border--color--400);
55
+ --pf-t--global--border--radius--action--plain--default: var(--pf-t--global--border--radius--pill);
56
+ --pf-t--global--border--radius--control--default: var(--pf-t--global--border--radius--pill);
57
+ --pf-t--global--border--width--high-contrast--extra-strong: var(--pf-t--global--border--width--extra-strong);
58
+ --pf-t--global--border--width--high-contrast--regular: var(--pf-t--global--border--width--regular);
59
+ --pf-t--global--border--width--high-contrast--strong: var(--pf-t--global--border--width--strong);
60
+ --pf-t--global--color--brand--accent--clicked: var(--pf-t--global--color--brand--accent--300);
61
+ --pf-t--global--color--brand--accent--default: var(--pf-t--global--color--brand--accent--200);
62
+ --pf-t--global--color--brand--accent--hover: var(--pf-t--global--color--brand--accent--300);
63
+ --pf-t--global--color--brand--clicked: var(--pf-t--global--color--brand--400);
64
+ --pf-t--global--color--brand--default: var(--pf-t--global--color--brand--300);
65
+ --pf-t--global--color--brand--hover: var(--pf-t--global--color--brand--400);
66
+ --pf-t--global--color--favorite--clicked: var(--pf-t--global--color--favorite--400);
67
+ --pf-t--global--color--favorite--default: var(--pf-t--global--color--favorite--300);
68
+ --pf-t--global--color--favorite--hover: var(--pf-t--global--color--favorite--400);
69
+ --pf-t--global--color--nonstatus--gray--clicked: var(--pf-t--global--color--nonstatus--gray--100);
70
+ --pf-t--global--color--nonstatus--gray--default: var(--pf-t--global--color--nonstatus--gray--50);
71
+ --pf-t--global--color--nonstatus--gray--hover: var(--pf-t--global--color--nonstatus--gray--100);
72
+ --pf-t--global--color--status--custom--clicked: var(--pf-t--global--color--status--custom--300);
73
+ --pf-t--global--color--status--custom--default: var(--pf-t--global--color--status--custom--200);
74
+ --pf-t--global--color--status--custom--hover: var(--pf-t--global--color--status--custom--300);
75
+ --pf-t--global--color--status--danger--clicked: var(--pf-t--global--color--status--danger--300);
76
+ --pf-t--global--color--status--danger--default: var(--pf-t--global--color--status--danger--200);
77
+ --pf-t--global--color--status--danger--hover: var(--pf-t--global--color--status--danger--300);
78
+ --pf-t--global--color--status--info--clicked: var(--pf-t--global--color--status--info--300);
79
+ --pf-t--global--color--status--info--default: var(--pf-t--global--color--status--info--200);
80
+ --pf-t--global--color--status--info--hover: var(--pf-t--global--color--status--info--300);
81
+ --pf-t--global--color--status--success--clicked: var(--pf-t--global--color--status--success--300);
82
+ --pf-t--global--color--status--success--default: var(--pf-t--global--color--status--success--200);
83
+ --pf-t--global--color--status--success--hover: var(--pf-t--global--color--status--success--300);
84
+ --pf-t--global--color--status--warning--clicked: var(--pf-t--global--color--status--warning--600);
85
+ --pf-t--global--color--status--warning--default: var(--pf-t--global--color--status--warning--500);
86
+ --pf-t--global--color--status--warning--hover: var(--pf-t--global--color--status--warning--600);
87
+ --pf-t--global--focus-ring--color--default: var(--pf-t--global--focus-ring--color--200);
88
+ --pf-t--global--icon--color--brand--clicked: var(--pf-t--global--color--brand--400);
89
+ --pf-t--global--icon--color--brand--default: var(--pf-t--global--color--brand--300);
90
+ --pf-t--global--icon--color--brand--hover: var(--pf-t--global--color--brand--400);
91
+ --pf-t--global--icon--color--severity--important--default: var(--pf-t--global--color--severity--important--200);
92
+ --pf-t--global--icon--color--severity--minor--default: var(--pf-t--global--color--severity--minor--200);
93
+ --pf-t--global--icon--color--severity--moderate--default: var(--pf-t--global--color--severity--moderate--200);
94
+ --pf-t--global--icon--color--severity--none--default: var(--pf-t--global--color--severity--none--200);
95
+ --pf-t--global--icon--color--severity--undefined--default: var(--pf-t--global--color--severity--undefined--200);
96
+ --pf-t--global--icon--color--status--danger--clicked: var(--pf-t--global--color--status--danger--200);
97
+ --pf-t--global--icon--color--status--danger--default: var(--pf-t--global--color--status--danger--100);
98
+ --pf-t--global--icon--color--status--danger--hover: var(--pf-t--global--color--status--danger--200);
99
+ --pf-t--global--icon--color--status--warning--clicked: var(--pf-t--global--color--status--warning--600);
100
+ --pf-t--global--icon--color--status--warning--default: var(--pf-t--global--color--status--warning--500);
101
+ --pf-t--global--icon--color--status--warning--hover: var(--pf-t--global--color--status--warning--600);
102
+ --pf-t--global--icon--color--subtle: var(--pf-t--global--icon--color--150);
103
+ --pf-t--global--text--color--brand--clicked: var(--pf-t--global--color--brand--500);
104
+ --pf-t--global--text--color--brand--default: var(--pf-t--global--color--brand--400);
105
+ --pf-t--global--text--color--brand--hover: var(--pf-t--global--color--brand--500);
106
+ --pf-t--global--text--color--link--default: var(--pf-t--global--text--color--link--200);
107
+ --pf-t--global--text--color--link--hover: var(--pf-t--global--text--color--link--250);
108
+ --pf-t--global--text--color--link--visited: var(--pf-t--global--text--color--link--350);
109
+ --pf-t--global--text--color--required: var(--pf-t--global--text--color--500);
110
+ --pf-t--global--text--color--status--success--clicked: var(--pf-t--global--color--status--success--300);
111
+ --pf-t--global--text--color--status--success--default: var(--pf-t--global--color--status--success--200);
112
+ --pf-t--global--text--color--status--success--hover: var(--pf-t--global--color--status--success--300);
113
+ --pf-t--global--text--color--status--warning--clicked: var(--pf-t--global--color--status--warning--600);
114
+ --pf-t--global--text--color--status--warning--default: var(--pf-t--global--color--status--warning--500);
115
+ --pf-t--global--text--color--status--warning--hover: var(--pf-t--global--color--status--warning--600);
116
+ --pf-t--global--text--color--subtle: var(--pf-t--global--text--color--250);
117
+ --pf-t--global--background--color--action--plain--alt--clicked: var(--pf-t--global--background--color--primary--default);
118
+ --pf-t--global--background--color--action--plain--alt--hover: var(--pf-t--global--background--color--primary--default);
119
+ --pf-t--global--border--color--high-contrast: var(--pf-t--global--border--color--default);
120
+ --pf-t--global--border--color--main--default: var(--pf-t--global--border--color--default);
121
+ --pf-t--global--icon--color--status--on-warning--clicked: var(--pf-t--global--icon--color--inverse);
122
+ --pf-t--global--icon--color--status--on-warning--default: var(--pf-t--global--icon--color--inverse);
123
+ --pf-t--global--icon--color--status--on-warning--hover: var(--pf-t--global--icon--color--inverse);
124
+ --pf-t--global--text--color--status--on-warning--clicked: var(--pf-t--global--text--color--inverse);
125
+ --pf-t--global--text--color--status--on-warning--default: var(--pf-t--global--text--color--inverse);
126
+ --pf-t--global--text--color--status--on-warning--hover: var(--pf-t--global--text--color--inverse);
127
+ }
@@ -0,0 +1,15 @@
1
+
2
+ // Do not edit directly
3
+ // Generated on Tue, 10 Feb 2026 20:40:24 GMT
4
+
5
+ // Only tokens that differ from base theme (8 tokens)
6
+ @mixin pf-v6-tokens {
7
+ --pf-t--global--border--color--brand--accent--clicked: var(--pf-t--global--color--brand--accent--400);
8
+ --pf-t--global--border--color--brand--accent--default: var(--pf-t--global--color--brand--accent--400);
9
+ --pf-t--global--border--color--brand--accent--hover: var(--pf-t--global--color--brand--accent--400);
10
+ --pf-t--global--border--radius--action--plain--default: var(--pf-t--global--border--radius--pill);
11
+ --pf-t--global--border--radius--control--default: var(--pf-t--global--border--radius--pill);
12
+ --pf-t--global--color--brand--accent--clicked: var(--pf-t--global--color--brand--accent--200);
13
+ --pf-t--global--color--brand--accent--default: var(--pf-t--global--color--brand--accent--100);
14
+ --pf-t--global--color--brand--accent--hover: var(--pf-t--global--color--brand--accent--200);
15
+ }
package/build.js CHANGED
@@ -1,11 +1,16 @@
1
1
  /* eslint-disable no-console */
2
+ const fs = require('fs');
3
+ const path = require('path');
2
4
  const StyleDictionary = require('style-dictionary');
3
5
  const config = require('./config.default.json'); // Adjust the path if necessary
4
6
  const basePxFontSize = config.basePxFontSize || 16;
5
7
  const getTokenLayer = ({ filePath }) => {
6
8
  if (filePath.includes('semantic.json')) return ['semantic', 'colors'];
7
9
  if (filePath.includes('semantic.dark.json')) return ['semantic', 'colors'];
10
+ if (filePath.includes('semantic.glass.json')) return ['semantic', 'colors'];
11
+ if (filePath.includes('semantic.glass.dark.json')) return ['semantic', 'colors'];
8
12
  if (filePath.includes('semantic.dimension.json')) return ['semantic', 'dimension'];
13
+ if (filePath.includes('semantic.dimension.highcontrast.json')) return ['semantic', 'dimension'];
9
14
  if (filePath.includes('semantic.motion.json')) return ['semantic', 'motion'];
10
15
  if (filePath.includes('base.json')) return ['base', 'colors'];
11
16
  if (filePath.includes('base.dark.json')) return ['base', 'colors'];
@@ -115,11 +120,24 @@ const build = (selector) => {
115
120
  type: 'value',
116
121
  matcher: (token) => token.type === 'number',
117
122
  transformer: (token) => {
118
- console.log(token);
119
123
  return Math.round(parseFloat(token.value) * 100) / 100;
120
124
  }
121
125
  });
122
126
 
127
+ StyleDictionary.registerTransform({
128
+ name: 'patternfly/global/percentage',
129
+ type: 'value',
130
+ matcher: (token) => token.attributes.item === 'opacity' && token.original.type === 'number',
131
+ transformer: (token) => `${token.value}%`
132
+ });
133
+
134
+ StyleDictionary.registerTransform({
135
+ name: 'patternfly/global/filter/blur',
136
+ type: 'value',
137
+ matcher: (token) => (token.attributes.item == 'filter' && token.attributes.state === 'blur' && token.original.type === 'number'),
138
+ transformer: (token) => `blur(${token.value}px)`
139
+ });
140
+
123
141
  // Reigster custom transform group
124
142
  StyleDictionary.registerTransformGroup({
125
143
  name: 'patternfly/css',
@@ -133,37 +151,214 @@ const build = (selector) => {
133
151
  'color/css',
134
152
  // custom transforms
135
153
  'patternfly/global/round-decimel',
154
+ 'patternfly/global/percentage',
136
155
  'patternfly/global/px',
137
156
  'patternfly/global/pxToRem',
138
157
  'patternfly/global/ms',
139
- 'patternfly/doublekebab'
158
+ 'patternfly/doublekebab',
159
+ 'patternfly/global/filter/blur'
140
160
  ]
141
161
  });
142
162
 
143
- // Apply configuration
163
+ // Build all themes
164
+ console.log('Building base themes...');
144
165
  const defaultExtendedSD = StyleDictionary.extend(__dirname + '/config.default.json');
145
- const darkExtendedSD = StyleDictionary.extend(__dirname + '/config.dark.json');
146
- const paletteExtendedSD = StyleDictionary.extend(__dirname + '/config.palette-colors.json');
147
- const chartsExtendedSD = StyleDictionary.extend(__dirname + '/config.charts.json');
148
- const chartsDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.charts.dark.json');
149
- const highContrastDefaultExtendedSD = StyleDictionary.extend(__dirname + '/config.highcontrast.json');
150
- const highContrastDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.highcontrast.dark.json');
151
- const layersSD = StyleDictionary.extend(__dirname + '/config.layers.json');
152
- const layersDarkSD = StyleDictionary.extend(__dirname + '/config.layers.dark.json');
153
-
154
- // Build all
155
166
  defaultExtendedSD.buildAllPlatforms();
167
+
168
+ const darkExtendedSD = StyleDictionary.extend(__dirname + '/config.dark.json');
156
169
  darkExtendedSD.buildAllPlatforms();
170
+
171
+ // Step 2: Build other non-glass themes (order doesn't matter)
172
+ console.log('Building other themes...');
173
+ const paletteExtendedSD = StyleDictionary.extend(__dirname + '/config.palette-colors.json');
157
174
  paletteExtendedSD.buildAllPlatforms();
175
+
176
+ const chartsExtendedSD = StyleDictionary.extend(__dirname + '/config.charts.json');
158
177
  chartsExtendedSD.buildAllPlatforms();
178
+
179
+ const chartsDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.charts.dark.json');
159
180
  chartsDarkExtendedSD.buildAllPlatforms();
181
+
182
+ const highContrastDefaultExtendedSD = StyleDictionary.extend(__dirname + '/config.highcontrast.json');
160
183
  highContrastDefaultExtendedSD.buildAllPlatforms();
184
+
185
+ const highContrastDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.highcontrast.dark.json');
161
186
  highContrastDarkExtendedSD.buildAllPlatforms();
187
+
188
+ const layersSD = StyleDictionary.extend(__dirname + '/config.layers.json');
162
189
  layersSD.buildAllPlatforms();
190
+
191
+ const layersDarkSD = StyleDictionary.extend(__dirname + '/config.layers.dark.json');
163
192
  layersDarkSD.buildAllPlatforms();
164
193
 
194
+ console.log('Building layer configs for glass themes...');
195
+ const layersGlassSD = StyleDictionary.extend(__dirname + '/config.layers.glass.json');
196
+ layersGlassSD.buildAllPlatforms();
197
+
198
+ const layersGlassDarkSD = StyleDictionary.extend(__dirname + '/config.layers.glass-dark.json');
199
+ layersGlassDarkSD.buildAllPlatforms();
200
+
201
+ console.log('Building layer configs for highcontrast themes...');
202
+ const layersHighContrastSD = StyleDictionary.extend(__dirname + '/config.layers.highcontrast.json');
203
+ layersHighContrastSD.buildAllPlatforms();
204
+
205
+ const layersHighContrastDarkSD = StyleDictionary.extend(__dirname + '/config.layers.highcontrast-dark.json');
206
+ layersHighContrastDarkSD.buildAllPlatforms();
207
+
208
+ console.log('Building layer configs for redhat themes...');
209
+ const layersRedhatSD = StyleDictionary.extend(__dirname + '/config.layers.redhat.json');
210
+ layersRedhatSD.buildAllPlatforms();
211
+
212
+ const layersRedhatDarkSD = StyleDictionary.extend(__dirname + '/config.layers.redhat-dark.json');
213
+ layersRedhatDarkSD.buildAllPlatforms();
214
+
215
+ const layersRedhatGlassSD = StyleDictionary.extend(__dirname + '/config.layers.redhat-glass.json');
216
+ layersRedhatGlassSD.buildAllPlatforms();
217
+
218
+ const layersRedhatGlassDarkSD = StyleDictionary.extend(__dirname + '/config.layers.redhat-glass-dark.json');
219
+ layersRedhatGlassDarkSD.buildAllPlatforms();
220
+
221
+ const layersRedhatHighContrastSD = StyleDictionary.extend(__dirname + '/config.layers.redhat-highcontrast.json');
222
+ layersRedhatHighContrastSD.buildAllPlatforms();
223
+
224
+ const layersRedhatHighContrastDarkSD = StyleDictionary.extend(__dirname + '/config.layers.redhat-highcontrast-dark.json');
225
+ layersRedhatHighContrastDarkSD.buildAllPlatforms();
226
+
227
+ // Step 3: Build glass themes
228
+ console.log('Building glass themes...');
229
+ const glassExtendedSD = StyleDictionary.extend(__dirname + '/config.glass.json');
230
+ glassExtendedSD.buildAllPlatforms();
231
+
232
+ const glassDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.glass.dark.json');
233
+ glassDarkExtendedSD.buildAllPlatforms();
234
+
235
+ // Step 4: Remove duplicate variables from glass SCSS files
236
+ console.log('Removing duplicate variables from glass themes...');
237
+ const buildPath = path.join(__dirname, 'build/css');
238
+ removeDuplicateVariables(
239
+ path.join(buildPath, 'tokens-default.scss'),
240
+ path.join(buildPath, 'tokens-glass.scss')
241
+ );
242
+ removeDuplicateVariables(
243
+ path.join(buildPath, 'tokens-dark.scss'),
244
+ path.join(buildPath, 'tokens-glass-dark.scss')
245
+ );
246
+
247
+ // Step 5: Build redhat themes
248
+ console.log('Building redhat themes...');
249
+ const redhatExtendedSD = StyleDictionary.extend(__dirname + '/config.redhat.json');
250
+ redhatExtendedSD.buildAllPlatforms();
251
+
252
+ const redhatDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.redhat-dark.json');
253
+ redhatDarkExtendedSD.buildAllPlatforms();
254
+
255
+ const redhatGlassExtendedSD = StyleDictionary.extend(__dirname + '/config.redhat-glass.json');
256
+ redhatGlassExtendedSD.buildAllPlatforms();
257
+
258
+ const redhatGlassDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.redhat-glass-dark.json');
259
+ redhatGlassDarkExtendedSD.buildAllPlatforms();
260
+
261
+ const redhatHighContrastExtendedSD = StyleDictionary.extend(__dirname + '/config.redhat-highcontrast.json');
262
+ redhatHighContrastExtendedSD.buildAllPlatforms();
263
+
264
+ const redhatHighContrastDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.redhat-highcontrast-dark.json');
265
+ redhatHighContrastDarkExtendedSD.buildAllPlatforms();
266
+
267
+ // Step 6: Remove duplicate variables from redhat SCSS files
268
+ console.log('Removing duplicate variables from redhat themes...');
269
+ removeDuplicateVariables(
270
+ path.join(buildPath, 'tokens-default.scss'),
271
+ path.join(buildPath, 'tokens-redhat.scss')
272
+ );
273
+ removeDuplicateVariables(
274
+ path.join(buildPath, 'tokens-dark.scss'),
275
+ path.join(buildPath, 'tokens-redhat-dark.scss')
276
+ );
277
+ // Redhat glass themes compare against default (not glass), because they source all default/glass tokens
278
+ removeDuplicateVariables(
279
+ path.join(buildPath, 'tokens-default.scss'),
280
+ path.join(buildPath, 'tokens-redhat-glass.scss')
281
+ );
282
+ removeDuplicateVariables(
283
+ path.join(buildPath, 'tokens-dark.scss'),
284
+ path.join(buildPath, 'tokens-redhat-glass-dark.scss')
285
+ );
286
+ removeDuplicateVariables(
287
+ path.join(buildPath, 'tokens-default.scss'),
288
+ path.join(buildPath, 'tokens-redhat-highcontrast.scss')
289
+ );
290
+ removeDuplicateVariables(
291
+ path.join(buildPath, 'tokens-dark.scss'),
292
+ path.join(buildPath, 'tokens-redhat-highcontrast-dark.scss')
293
+ );
294
+
165
295
  console.log('\n============================');
166
296
  console.log('\nBuild completed.');
167
297
  };
168
298
 
299
+ /**
300
+ * Remove CSS variable declarations from glassFile that are identical to baseFile
301
+ * @param {string} baseFilePath - Path to base theme SCSS file (e.g., tokens-default.scss)
302
+ * @param {string} glassFilePath - Path to glass theme SCSS file (e.g., tokens-glass.scss)
303
+ */
304
+ function removeDuplicateVariables(baseFilePath, glassFilePath) {
305
+ const baseContent = fs.readFileSync(baseFilePath, 'utf8');
306
+ const glassContent = fs.readFileSync(glassFilePath, 'utf8');
307
+
308
+ // Extract all CSS variable declarations from base file
309
+ // Match lines like: --pf-t--global--border--radius--100: 4px;
310
+ const varRegex = /^\s*(--[^:]+:\s*[^;]+;)\s*$/gm;
311
+
312
+ const baseVars = new Set();
313
+ let match;
314
+ while ((match = varRegex.exec(baseContent)) !== null) {
315
+ // Store the complete declaration (trimmed for comparison)
316
+ baseVars.add(match[1].trim());
317
+ }
318
+
319
+ // Split glass file into lines
320
+ const glassLines = glassContent.split('\n');
321
+ const filteredLines = [];
322
+ let removedCount = 0;
323
+
324
+ // Filter out lines that exist in base
325
+ for (const line of glassLines) {
326
+ const varMatch = line.match(/^\s*(--[^:]+:\s*[^;]+;)\s*$/);
327
+
328
+ if (varMatch && baseVars.has(varMatch[1].trim())) {
329
+ // This line is identical to base, skip it
330
+ removedCount++;
331
+ continue;
332
+ }
333
+
334
+ // Keep this line (either not a var declaration or different from base)
335
+ filteredLines.push(line);
336
+ }
337
+
338
+ // Reconstruct the file
339
+ let newContent = filteredLines.join('\n');
340
+
341
+ // Count remaining variables
342
+ const remainingVars = filteredLines.filter(l => l.trim().startsWith('--')).length;
343
+
344
+ // Update or add the comment to reflect actual diff count
345
+ if (newContent.includes('// Only tokens that differ from base theme')) {
346
+ newContent = newContent.replace(
347
+ /\/\/ Only tokens that differ from base theme \(\d+ tokens\)/,
348
+ `// Only tokens that differ from base theme (${remainingVars} tokens)`
349
+ );
350
+ } else {
351
+ // Add the comment if it doesn't exist
352
+ newContent = newContent.replace(
353
+ /(@mixin pf-v6-tokens \{)/,
354
+ `// Only tokens that differ from base theme (${remainingVars} tokens)\n$1`
355
+ );
356
+ }
357
+
358
+ // Write back to glass file
359
+ fs.writeFileSync(glassFilePath, newContent, 'utf8');
360
+
361
+ console.log(`Removed ${removedCount} duplicate variables from ${path.basename(glassFilePath)}`);
362
+ }
363
+
169
364
  module.exports = { build };
package/config.dark.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": ["tokens/dark/*.json"],
2
+ "source": ["tokens/default/dark/*.json"],
3
3
  "platforms": {
4
4
  "css": {
5
5
  "transformGroup": "patternfly/css",
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": ["tokens/default/*.json"],
2
+ "source": ["tokens/default/light/*.json"],
3
3
  "basePxFontSize": 16,
4
4
  "platforms": {
5
5
  "css": {
@@ -0,0 +1,23 @@
1
+ {
2
+ "source": ["tokens/default/glass-dark/*.json"],
3
+ "platforms": {
4
+ "css": {
5
+ "transformGroup": "patternfly/css",
6
+ "buildPath": "build/css/",
7
+ "prefix": "pf-t",
8
+ "files": [{
9
+ "destination": "tokens-glass-dark.scss",
10
+ "format": "customFormat",
11
+ "options": {
12
+ "outputReferences": true
13
+ },
14
+ "filter": {
15
+ "attributes": {
16
+ "category": "global"
17
+ }
18
+ }
19
+ }
20
+ ]
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "source": ["tokens/default/glass/*.json"],
3
+ "basePxFontSize": 16,
4
+ "platforms": {
5
+ "css": {
6
+ "transformGroup": "patternfly/css",
7
+ "buildPath": "build/css/",
8
+ "prefix": "pf-t",
9
+ "files": [{
10
+ "destination": "tokens-glass.scss",
11
+ "format": "customFormat",
12
+ "options": {
13
+ "outputReferences": true
14
+ },
15
+ "filter": {
16
+ "attributes": {
17
+ "category": "global"
18
+ }
19
+ }
20
+ }
21
+ ]
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "source": ["tokens/default/glass-dark/*.json"],
3
+ "platforms": {
4
+ "json/default": {
5
+ "transformGroup": "patternfly/css",
6
+ "buildPath": "patternfly-docs/content/",
7
+ "prefix": "pf-t",
8
+ "files": [
9
+ {
10
+ "destination": "token-layers-glass-dark.json",
11
+ "format": "json/flat-categories",
12
+ "options": {
13
+ "outputReferences": false
14
+ }
15
+ }
16
+ ]
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "source": ["tokens/default/glass/*.json"],
3
+ "platforms": {
4
+ "json/default": {
5
+ "transformGroup": "patternfly/css",
6
+ "buildPath": "patternfly-docs/content/",
7
+ "prefix": "pf-t",
8
+ "files": [
9
+ {
10
+ "destination": "token-layers-glass.json",
11
+ "format": "json/flat-categories",
12
+ "options": {
13
+ "outputReferences": false
14
+ }
15
+ }
16
+ ]
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "source": ["tokens/default/highcontrast-dark/*.json"],
3
+ "platforms": {
4
+ "json/default": {
5
+ "transformGroup": "patternfly/css",
6
+ "buildPath": "patternfly-docs/content/",
7
+ "prefix": "pf-t",
8
+ "files": [
9
+ {
10
+ "destination": "token-layers-highcontrast-dark.json",
11
+ "format": "json/flat-categories",
12
+ "options": {
13
+ "outputReferences": false
14
+ }
15
+ }
16
+ ]
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "source": ["tokens/default/highcontrast/*.json"],
3
+ "platforms": {
4
+ "json/default": {
5
+ "transformGroup": "patternfly/css",
6
+ "buildPath": "patternfly-docs/content/",
7
+ "prefix": "pf-t",
8
+ "files": [
9
+ {
10
+ "destination": "token-layers-highcontrast.json",
11
+ "format": "json/flat-categories",
12
+ "options": {
13
+ "outputReferences": false
14
+ }
15
+ }
16
+ ]
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "source": [
3
+ "tokens/default/dark/*.json",
4
+ "tokens/redhat/dark/redhat*.json"
5
+ ],
6
+ "platforms": {
7
+ "json/default": {
8
+ "transformGroup": "patternfly/css",
9
+ "buildPath": "patternfly-docs/content/",
10
+ "prefix": "pf-t",
11
+ "files": [
12
+ {
13
+ "destination": "token-layers-redhat-dark.json",
14
+ "format": "json/flat-categories",
15
+ "options": {
16
+ "outputReferences": false
17
+ }
18
+ }
19
+ ]
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "source": [
3
+ "tokens/default/glass-dark/*.json",
4
+ "tokens/redhat/glass-dark/redhat*.json"
5
+ ],
6
+ "platforms": {
7
+ "json/default": {
8
+ "transformGroup": "patternfly/css",
9
+ "buildPath": "patternfly-docs/content/",
10
+ "prefix": "pf-t",
11
+ "files": [
12
+ {
13
+ "destination": "token-layers-redhat-glass-dark.json",
14
+ "format": "json/flat-categories",
15
+ "options": {
16
+ "outputReferences": false
17
+ }
18
+ }
19
+ ]
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "source": [
3
+ "tokens/default/glass/*.json",
4
+ "tokens/redhat/glass/redhat*.json"
5
+ ],
6
+ "platforms": {
7
+ "json/default": {
8
+ "transformGroup": "patternfly/css",
9
+ "buildPath": "patternfly-docs/content/",
10
+ "prefix": "pf-t",
11
+ "files": [
12
+ {
13
+ "destination": "token-layers-redhat-glass.json",
14
+ "format": "json/flat-categories",
15
+ "options": {
16
+ "outputReferences": false
17
+ }
18
+ }
19
+ ]
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "source": [
3
+ "tokens/default/highcontrast-dark/*.json",
4
+ "tokens/redhat/highcontrast-dark/redhat*.json"
5
+ ],
6
+ "platforms": {
7
+ "json/default": {
8
+ "transformGroup": "patternfly/css",
9
+ "buildPath": "patternfly-docs/content/",
10
+ "prefix": "pf-t",
11
+ "files": [
12
+ {
13
+ "destination": "token-layers-redhat-highcontrast-dark.json",
14
+ "format": "json/flat-categories",
15
+ "options": {
16
+ "outputReferences": false
17
+ }
18
+ }
19
+ ]
20
+ }
21
+ }
22
+ }