@patternfly/design-tokens 1.14.6 → 1.14.7

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 +12 -0
  6. package/build/css/tokens-glass.scss +12 -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 +19 -0
  12. package/build/css/tokens-redhat-glass.scss +18 -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 +201 -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/{highcontrast-dark → default/dark}/palette.color.json +8 -0
  55. package/tokens/{dark → default/dark}/semantic.dark.json +235 -12
  56. package/tokens/default/{base.dimension.json → glass/base.dimension.json} +12 -12
  57. package/tokens/{highcontrast → default/glass}/base.json +45 -5
  58. package/tokens/{dark → default/glass}/palette.color.json +8 -0
  59. package/tokens/default/glass/semantic.glass.json +1996 -0
  60. package/tokens/{highcontrast-dark → default/glass-dark}/base.dark.json +83 -43
  61. package/tokens/{highcontrast → default/glass-dark}/palette.color.json +8 -0
  62. package/tokens/default/glass-dark/semantic.glass.dark.json +1996 -0
  63. package/tokens/{highcontrast → default/highcontrast}/base.dimension.json +12 -12
  64. package/tokens/default/{base.json → highcontrast/base.json} +45 -5
  65. package/tokens/default/highcontrast/palette.color.json +335 -0
  66. package/tokens/{highcontrast → default/highcontrast}/semantic.dimension.highcontrast.json +92 -56
  67. package/tokens/{highcontrast → default/highcontrast}/semantic.highcontrast.json +246 -23
  68. package/tokens/default/highcontrast-dark/base.dark.json +473 -0
  69. package/tokens/default/{palette.color.json → highcontrast-dark/palette.color.json} +8 -0
  70. package/tokens/{highcontrast-dark → default/highcontrast-dark}/semantic.highcontrast.dark.json +234 -11
  71. package/tokens/default/light/base.dimension.json +387 -0
  72. package/tokens/default/light/base.json +611 -0
  73. package/tokens/default/light/palette.color.json +335 -0
  74. package/tokens/default/{semantic.dimension.json → light/semantic.dimension.json} +95 -59
  75. package/tokens/default/{semantic.json → light/semantic.json} +235 -12
  76. package/tokens/default/{semantic.motion.json → light/semantic.motion.json} +18 -18
  77. package/tokens/redhat/dark/redhat.color.dark.json +62 -0
  78. package/tokens/redhat/glass/redhat.color.glass.json +49 -0
  79. package/tokens/redhat/glass-dark/redhat.color.glass.dark.json +62 -0
  80. package/tokens/redhat/highcontrast/redhat.color.highcontrast.json +49 -0
  81. package/tokens/redhat/highcontrast/redhat.dimension.highcontrast.json +23 -0
  82. package/tokens/redhat/highcontrast-dark/redhat.color.highcontrast.dark.json +49 -0
  83. package/tokens/redhat/light/redhat.color.json +49 -0
  84. package/tokens/redhat/light/redhat.dimension.json +23 -0
  85. /package/tokens/{dark → default/dark}/charts.dark.json +0 -0
  86. /package/tokens/default/{base.motion.json → light/base.motion.json} +0 -0
  87. /package/tokens/default/{charts.json → light/charts.json} +0 -0
@@ -0,0 +1,127 @@
1
+
2
+ // Do not edit directly
3
+ // Generated on Fri, 06 Feb 2026 21:19:18 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 Fri, 06 Feb 2026 21:19:18 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'];
@@ -85,7 +90,8 @@ const build = (selector) => {
85
90
  type: 'value',
86
91
  matcher: (token) =>
87
92
  (['border', 'focus-ring'].includes(token.attributes.type) && token.original.type === 'number') ||
88
- (token.attributes.type === 'box-shadow' && token.attributes.item !== 'color'),
93
+ (token.attributes.type === 'box-shadow' && token.attributes.item !== 'color') ||
94
+ (token.attributes.item == 'filter' && token.attributes.state === 'blur' && token.original.type === 'number'),
89
95
  transformer: (token) => `${token.value}px`
90
96
  });
91
97
 
@@ -115,11 +121,17 @@ const build = (selector) => {
115
121
  type: 'value',
116
122
  matcher: (token) => token.type === 'number',
117
123
  transformer: (token) => {
118
- console.log(token);
119
124
  return Math.round(parseFloat(token.value) * 100) / 100;
120
125
  }
121
126
  });
122
127
 
128
+ StyleDictionary.registerTransform({
129
+ name: 'patternfly/global/percentage',
130
+ type: 'value',
131
+ matcher: (token) => token.attributes.item === 'opacity' && token.original.type === 'number',
132
+ transformer: (token) => `${token.value}%`
133
+ });
134
+
123
135
  // Reigster custom transform group
124
136
  StyleDictionary.registerTransformGroup({
125
137
  name: 'patternfly/css',
@@ -133,6 +145,7 @@ const build = (selector) => {
133
145
  'color/css',
134
146
  // custom transforms
135
147
  'patternfly/global/round-decimel',
148
+ 'patternfly/global/percentage',
136
149
  'patternfly/global/px',
137
150
  'patternfly/global/pxToRem',
138
151
  'patternfly/global/ms',
@@ -140,30 +153,205 @@ const build = (selector) => {
140
153
  ]
141
154
  });
142
155
 
143
- // Apply configuration
156
+ // Build all themes
157
+ console.log('Building base themes...');
144
158
  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
159
  defaultExtendedSD.buildAllPlatforms();
160
+
161
+ const darkExtendedSD = StyleDictionary.extend(__dirname + '/config.dark.json');
156
162
  darkExtendedSD.buildAllPlatforms();
163
+
164
+ // Step 2: Build other non-glass themes (order doesn't matter)
165
+ console.log('Building other themes...');
166
+ const paletteExtendedSD = StyleDictionary.extend(__dirname + '/config.palette-colors.json');
157
167
  paletteExtendedSD.buildAllPlatforms();
168
+
169
+ const chartsExtendedSD = StyleDictionary.extend(__dirname + '/config.charts.json');
158
170
  chartsExtendedSD.buildAllPlatforms();
171
+
172
+ const chartsDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.charts.dark.json');
159
173
  chartsDarkExtendedSD.buildAllPlatforms();
174
+
175
+ const highContrastDefaultExtendedSD = StyleDictionary.extend(__dirname + '/config.highcontrast.json');
160
176
  highContrastDefaultExtendedSD.buildAllPlatforms();
177
+
178
+ const highContrastDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.highcontrast.dark.json');
161
179
  highContrastDarkExtendedSD.buildAllPlatforms();
180
+
181
+ const layersSD = StyleDictionary.extend(__dirname + '/config.layers.json');
162
182
  layersSD.buildAllPlatforms();
183
+
184
+ const layersDarkSD = StyleDictionary.extend(__dirname + '/config.layers.dark.json');
163
185
  layersDarkSD.buildAllPlatforms();
164
186
 
187
+ console.log('Building layer configs for glass themes...');
188
+ const layersGlassSD = StyleDictionary.extend(__dirname + '/config.layers.glass.json');
189
+ layersGlassSD.buildAllPlatforms();
190
+
191
+ const layersGlassDarkSD = StyleDictionary.extend(__dirname + '/config.layers.glass-dark.json');
192
+ layersGlassDarkSD.buildAllPlatforms();
193
+
194
+ console.log('Building layer configs for highcontrast themes...');
195
+ const layersHighContrastSD = StyleDictionary.extend(__dirname + '/config.layers.highcontrast.json');
196
+ layersHighContrastSD.buildAllPlatforms();
197
+
198
+ const layersHighContrastDarkSD = StyleDictionary.extend(__dirname + '/config.layers.highcontrast-dark.json');
199
+ layersHighContrastDarkSD.buildAllPlatforms();
200
+
201
+ console.log('Building layer configs for redhat themes...');
202
+ const layersRedhatSD = StyleDictionary.extend(__dirname + '/config.layers.redhat.json');
203
+ layersRedhatSD.buildAllPlatforms();
204
+
205
+ const layersRedhatDarkSD = StyleDictionary.extend(__dirname + '/config.layers.redhat-dark.json');
206
+ layersRedhatDarkSD.buildAllPlatforms();
207
+
208
+ const layersRedhatGlassSD = StyleDictionary.extend(__dirname + '/config.layers.redhat-glass.json');
209
+ layersRedhatGlassSD.buildAllPlatforms();
210
+
211
+ const layersRedhatGlassDarkSD = StyleDictionary.extend(__dirname + '/config.layers.redhat-glass-dark.json');
212
+ layersRedhatGlassDarkSD.buildAllPlatforms();
213
+
214
+ const layersRedhatHighContrastSD = StyleDictionary.extend(__dirname + '/config.layers.redhat-highcontrast.json');
215
+ layersRedhatHighContrastSD.buildAllPlatforms();
216
+
217
+ const layersRedhatHighContrastDarkSD = StyleDictionary.extend(__dirname + '/config.layers.redhat-highcontrast-dark.json');
218
+ layersRedhatHighContrastDarkSD.buildAllPlatforms();
219
+
220
+ // Step 3: Build glass themes
221
+ console.log('Building glass themes...');
222
+ const glassExtendedSD = StyleDictionary.extend(__dirname + '/config.glass.json');
223
+ glassExtendedSD.buildAllPlatforms();
224
+
225
+ const glassDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.glass.dark.json');
226
+ glassDarkExtendedSD.buildAllPlatforms();
227
+
228
+ // Step 4: Remove duplicate variables from glass SCSS files
229
+ console.log('Removing duplicate variables from glass themes...');
230
+ const buildPath = path.join(__dirname, 'build/css');
231
+ removeDuplicateVariables(
232
+ path.join(buildPath, 'tokens-default.scss'),
233
+ path.join(buildPath, 'tokens-glass.scss')
234
+ );
235
+ removeDuplicateVariables(
236
+ path.join(buildPath, 'tokens-dark.scss'),
237
+ path.join(buildPath, 'tokens-glass-dark.scss')
238
+ );
239
+
240
+ // Step 5: Build redhat themes
241
+ console.log('Building redhat themes...');
242
+ const redhatExtendedSD = StyleDictionary.extend(__dirname + '/config.redhat.json');
243
+ redhatExtendedSD.buildAllPlatforms();
244
+
245
+ const redhatDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.redhat-dark.json');
246
+ redhatDarkExtendedSD.buildAllPlatforms();
247
+
248
+ const redhatGlassExtendedSD = StyleDictionary.extend(__dirname + '/config.redhat-glass.json');
249
+ redhatGlassExtendedSD.buildAllPlatforms();
250
+
251
+ const redhatGlassDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.redhat-glass-dark.json');
252
+ redhatGlassDarkExtendedSD.buildAllPlatforms();
253
+
254
+ const redhatHighContrastExtendedSD = StyleDictionary.extend(__dirname + '/config.redhat-highcontrast.json');
255
+ redhatHighContrastExtendedSD.buildAllPlatforms();
256
+
257
+ const redhatHighContrastDarkExtendedSD = StyleDictionary.extend(__dirname + '/config.redhat-highcontrast-dark.json');
258
+ redhatHighContrastDarkExtendedSD.buildAllPlatforms();
259
+
260
+ // Step 6: Remove duplicate variables from redhat SCSS files
261
+ console.log('Removing duplicate variables from redhat themes...');
262
+ removeDuplicateVariables(
263
+ path.join(buildPath, 'tokens-default.scss'),
264
+ path.join(buildPath, 'tokens-redhat.scss')
265
+ );
266
+ removeDuplicateVariables(
267
+ path.join(buildPath, 'tokens-dark.scss'),
268
+ path.join(buildPath, 'tokens-redhat-dark.scss')
269
+ );
270
+ // Redhat glass themes compare against default (not glass), because they source all default/glass tokens
271
+ removeDuplicateVariables(
272
+ path.join(buildPath, 'tokens-default.scss'),
273
+ path.join(buildPath, 'tokens-redhat-glass.scss')
274
+ );
275
+ removeDuplicateVariables(
276
+ path.join(buildPath, 'tokens-dark.scss'),
277
+ path.join(buildPath, 'tokens-redhat-glass-dark.scss')
278
+ );
279
+ removeDuplicateVariables(
280
+ path.join(buildPath, 'tokens-default.scss'),
281
+ path.join(buildPath, 'tokens-redhat-highcontrast.scss')
282
+ );
283
+ removeDuplicateVariables(
284
+ path.join(buildPath, 'tokens-dark.scss'),
285
+ path.join(buildPath, 'tokens-redhat-highcontrast-dark.scss')
286
+ );
287
+
165
288
  console.log('\n============================');
166
289
  console.log('\nBuild completed.');
167
290
  };
168
291
 
292
+ /**
293
+ * Remove CSS variable declarations from glassFile that are identical to baseFile
294
+ * @param {string} baseFilePath - Path to base theme SCSS file (e.g., tokens-default.scss)
295
+ * @param {string} glassFilePath - Path to glass theme SCSS file (e.g., tokens-glass.scss)
296
+ */
297
+ function removeDuplicateVariables(baseFilePath, glassFilePath) {
298
+ const baseContent = fs.readFileSync(baseFilePath, 'utf8');
299
+ const glassContent = fs.readFileSync(glassFilePath, 'utf8');
300
+
301
+ // Extract all CSS variable declarations from base file
302
+ // Match lines like: --pf-t--global--border--radius--100: 4px;
303
+ const varRegex = /^\s*(--[^:]+:\s*[^;]+;)\s*$/gm;
304
+
305
+ const baseVars = new Set();
306
+ let match;
307
+ while ((match = varRegex.exec(baseContent)) !== null) {
308
+ // Store the complete declaration (trimmed for comparison)
309
+ baseVars.add(match[1].trim());
310
+ }
311
+
312
+ // Split glass file into lines
313
+ const glassLines = glassContent.split('\n');
314
+ const filteredLines = [];
315
+ let removedCount = 0;
316
+
317
+ // Filter out lines that exist in base
318
+ for (const line of glassLines) {
319
+ const varMatch = line.match(/^\s*(--[^:]+:\s*[^;]+;)\s*$/);
320
+
321
+ if (varMatch && baseVars.has(varMatch[1].trim())) {
322
+ // This line is identical to base, skip it
323
+ removedCount++;
324
+ continue;
325
+ }
326
+
327
+ // Keep this line (either not a var declaration or different from base)
328
+ filteredLines.push(line);
329
+ }
330
+
331
+ // Reconstruct the file
332
+ let newContent = filteredLines.join('\n');
333
+
334
+ // Count remaining variables
335
+ const remainingVars = filteredLines.filter(l => l.trim().startsWith('--')).length;
336
+
337
+ // Update or add the comment to reflect actual diff count
338
+ if (newContent.includes('// Only tokens that differ from base theme')) {
339
+ newContent = newContent.replace(
340
+ /\/\/ Only tokens that differ from base theme \(\d+ tokens\)/,
341
+ `// Only tokens that differ from base theme (${remainingVars} tokens)`
342
+ );
343
+ } else {
344
+ // Add the comment if it doesn't exist
345
+ newContent = newContent.replace(
346
+ /(@mixin pf-v6-tokens \{)/,
347
+ `// Only tokens that differ from base theme (${remainingVars} tokens)\n$1`
348
+ );
349
+ }
350
+
351
+ // Write back to glass file
352
+ fs.writeFileSync(glassFilePath, newContent, 'utf8');
353
+
354
+ console.log(`Removed ${removedCount} duplicate variables from ${path.basename(glassFilePath)}`);
355
+ }
356
+
169
357
  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
+ }