Skip to content

Commit b84ec98

Browse files
committed
fixed issue with cds naming missing the g
1 parent 9bcc21c commit b84ec98

File tree

5 files changed

+51
-51
lines changed

5 files changed

+51
-51
lines changed

packages/tokens/scripts/build-parts/generateExtraThemingFiles.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export async function generateExtraThemingFiles(_dictionary: Dictionary, config:
1313

1414
const commonSource = await getSourceFromFileWithRootSelector(config, 'hds', 'common-tokens.css');
1515
const hdsThemedSource = await getSourceFromFileWithRootSelector(config, 'hds', 'themed-tokens.css');
16-
const cds0ThemedSource = await getSourceFromFileWithRootSelector(config, 'cds-0', 'themed-tokens.css');
17-
const cds10ThemedSource = await getSourceFromFileWithRootSelector(config, 'cds-10', 'themed-tokens.css');
18-
const cds90ThemedSource = await getSourceFromFileWithRootSelector(config, 'cds-90', 'themed-tokens.css');
19-
const cds100ThemedSource = await getSourceFromFileWithRootSelector(config, 'cds-100', 'themed-tokens.css');
16+
const cds0ThemedSource = await getSourceFromFileWithRootSelector(config, 'cds-g0', 'themed-tokens.css');
17+
const cds10ThemedSource = await getSourceFromFileWithRootSelector(config, 'cds-g10', 'themed-tokens.css');
18+
const cds90ThemedSource = await getSourceFromFileWithRootSelector(config, 'cds-g90', 'themed-tokens.css');
19+
const cds100ThemedSource = await getSourceFromFileWithRootSelector(config, 'cds-g100', 'themed-tokens.css');
2020

2121
const header = await fileHeader({});
2222

@@ -26,13 +26,13 @@ export async function generateExtraThemingFiles(_dictionary: Dictionary, config:
2626

2727
let outputContent = `${header}\n\n`;
2828

29-
// CSS file for `prefers-color-scheme` (note: we use `cds-0` for `light` and `cds-100` for `dark`
29+
// CSS file for `prefers-color-scheme` (note: we use `cds-g0` for `light` and `cds-g100` for `dark`
3030
if (method === 'prefers-color-scheme') {
3131
outputContent = `${header}\n\n`;
3232
outputContent += `@media (prefers-color-scheme: dark) { ${cds0ThemedSource} }\n\n`;
3333
outputContent += `@media (prefers-color-scheme: light) { ${cds100ThemedSource} }\n\n`;
3434
// this is the fallback to `light` mode
35-
// commented for now: consumers can always import the `themed-tokens/with-root-selector/cds-0/themed-tokens.css` as extra file if they want to
35+
// commented for now: consumers can always import the `themed-tokens/with-root-selector/cds-g0/themed-tokens.css` as extra file if they want to
3636
// outputContent += '\n\n';
3737
// outputContent += `${cds0ThemedSource}\n\n`;
3838
//
@@ -44,10 +44,10 @@ export async function generateExtraThemingFiles(_dictionary: Dictionary, config:
4444
if (method === 'css-selectors') {
4545
outputContent = `${header}\n\n`;
4646
outputContent += `${hdsThemedSource.replace(/^:root/, '.hds-theme-default, [data-hds-theme="default"]')}\n\n`;
47-
outputContent += `${cds0ThemedSource.replace(/^:root/, '.hds-theme-cds-0, [data-hds-theme="cds-0"]')}\n\n`;
48-
outputContent += `${cds10ThemedSource.replace(/^:root/, '.hds-theme-cds-10, [data-hds-theme="cds-10"]')}\n\n`;
49-
outputContent += `${cds90ThemedSource.replace(/^:root/, '.hds-theme-cds-90, [data-hds-theme="cds-90"]')}\n\n`;
50-
outputContent += `${cds100ThemedSource.replace(/^:root/, '.hds-theme-cds-100, [data-hds-theme="cds-100"]')}\n\n`;
47+
outputContent += `${cds0ThemedSource.replace(/^:root/, '.hds-theme-cds-g0, [data-hds-theme="cds-g0"]')}\n\n`;
48+
outputContent += `${cds10ThemedSource.replace(/^:root/, '.hds-theme-cds-g10, [data-hds-theme="cds-g10"]')}\n\n`;
49+
outputContent += `${cds90ThemedSource.replace(/^:root/, '.hds-theme-cds-g90, [data-hds-theme="cds-g90"]')}\n\n`;
50+
outputContent += `${cds100ThemedSource.replace(/^:root/, '.hds-theme-cds-g100, [data-hds-theme="cds-g100"]')}\n\n`;
5151
//
5252
// this is the fallback to the default `hds` mode
5353
outputContent += `${hdsThemedSource}\n\n`;
@@ -63,10 +63,10 @@ export async function generateExtraThemingFiles(_dictionary: Dictionary, config:
6363
outputContent += `@media (prefers-color-scheme: dark) { ${cds0ThemedSource.replace(/^:root/, ':root:not([class*=hds-theme-]):not([data-hds-theme])')} }\n\n`;
6464
outputContent += `@media (prefers-color-scheme: light) { ${cds100ThemedSource.replace(/^:root/, ':root:not([class*=hds-theme-]):not([data-hds-theme])')} }\n\n`;
6565
outputContent += `${hdsThemedSource.replace(/^:root/, '.hds-theme-default, [data-hds-theme="default"]')}\n\n`;
66-
outputContent += `${cds0ThemedSource.replace(/^:root/, '.hds-theme-cds-0, [data-hds-theme="cds-0"]')}\n\n`;
67-
outputContent += `${cds10ThemedSource.replace(/^:root/, '.hds-theme-cds-10, [data-hds-theme="cds-10"]')}\n\n`;
68-
outputContent += `${cds90ThemedSource.replace(/^:root/, '.hds-theme-cds-90, [data-hds-theme="cds-90"]')}\n\n`;
69-
outputContent += `${cds100ThemedSource.replace(/^:root/, '.hds-theme-cds-100, [data-hds-theme="cds-100"]')}\n\n`;
66+
outputContent += `${cds0ThemedSource.replace(/^:root/, '.hds-theme-cds-g0, [data-hds-theme="cds-g0"]')}\n\n`;
67+
outputContent += `${cds10ThemedSource.replace(/^:root/, '.hds-theme-cds-g10, [data-hds-theme="cds-g10"]')}\n\n`;
68+
outputContent += `${cds90ThemedSource.replace(/^:root/, '.hds-theme-cds-g90, [data-hds-theme="cds-g90"]')}\n\n`;
69+
outputContent += `${cds100ThemedSource.replace(/^:root/, '.hds-theme-cds-g100, [data-hds-theme="cds-g100"]')}\n\n`;
7070
//
7171
// this is the fallback to the default `hds` mode
7272
outputContent += `${hdsThemedSource}\n\n`;

packages/tokens/scripts/build-parts/getStyleDictionaryConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import type { Config, DesignToken } from 'style-dictionary/types';
77

88
export const targets = ['products', 'devdot', 'marketing', 'cloud-email'];
9-
export const modes = ['hds', 'cds-0', 'cds-10', 'cds-90', 'cds-100'];
9+
export const modes = ['hds', 'cds-g0', 'cds-g10', 'cds-g90', 'cds-g100'];
1010

1111
export type Target = typeof targets[number];
1212
export type Mode = typeof modes[number];

packages/tokens/src/global/color/palette-neutrals.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@
4747
"group": "palette",
4848
"$modes": {
4949
"hds": "#ffffff",
50-
"cds-0": "{carbon.color.white.0}",
51-
"cds-10": "{carbon.color.white.0}",
52-
"cds-90": "{carbon.color.white.0}",
53-
"cds-100": "{carbon.color.white.0}"
50+
"cds-g0": "{carbon.color.white.0}",
51+
"cds-g10": "{carbon.color.white.0}",
52+
"cds-g90": "{carbon.color.white.0}",
53+
"cds-g100": "{carbon.color.white.0}"
5454
}
5555
},
5656
"alpha-300": {

packages/tokens/src/global/color/semantic-foreground.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
"group": "semantic",
1313
"$modes": {
1414
"hds": "#ffffff",
15-
"cds-0": "{carbon.themes.white.textPrimary}",
16-
"cds-10": "{carbon.themes.g10.textPrimary}",
17-
"cds-90": "{carbon.themes.g90.textPrimary}",
18-
"cds-100": "{carbon.themes.g100.textPrimary}"
15+
"cds-g0": "{carbon.themes.white.textPrimary}",
16+
"cds-g10": "{carbon.themes.g10.textPrimary}",
17+
"cds-g90": "{carbon.themes.g90.textPrimary}",
18+
"cds-g100": "{carbon.themes.g100.textPrimary}"
1919
}
2020
},
2121
"faint": {

packages/tokens/src/products/shared/typography.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"-apple-system",
1515
"BlinkMacSystemFont"
1616
],
17-
"cds-0": "{carbon.typography.font-family.sans}",
18-
"cds-10": "{carbon.typography.font-family.sans}",
19-
"cds-90": "{carbon.typography.font-family.sans}",
20-
"cds-100": "{carbon.typography.font-family.sans}"
17+
"cds-g0": "{carbon.typography.font-family.sans}",
18+
"cds-g10": "{carbon.typography.font-family.sans}",
19+
"cds-g90": "{carbon.typography.font-family.sans}",
20+
"cds-g100": "{carbon.typography.font-family.sans}"
2121
},
2222
"private": "true"
2323
},
@@ -59,10 +59,10 @@
5959
"-apple-system",
6060
"BlinkMacSystemFont"
6161
],
62-
"cds-0": "{carbon.typography.font-family.sans}",
63-
"cds-10": "{carbon.typography.font-family.sans}",
64-
"cds-90": "{carbon.typography.font-family.sans}",
65-
"cds-100": "{carbon.typography.font-family.sans}"
62+
"cds-g0": "{carbon.typography.font-family.sans}",
63+
"cds-g10": "{carbon.typography.font-family.sans}",
64+
"cds-g90": "{carbon.typography.font-family.sans}",
65+
"cds-g100": "{carbon.typography.font-family.sans}"
6666
},
6767
"private": "true"
6868
},
@@ -97,10 +97,10 @@
9797
"-apple-system",
9898
"BlinkMacSystemFont"
9999
],
100-
"cds-0": "{carbon.typography.font-family.mono}",
101-
"cds-10": "{carbon.typography.font-family.mono}",
102-
"cds-90": "{carbon.typography.font-family.mono}",
103-
"cds-100": "{carbon.typography.font-family.mono}"
100+
"cds-g0": "{carbon.typography.font-family.mono}",
101+
"cds-g10": "{carbon.typography.font-family.mono}",
102+
"cds-g90": "{carbon.typography.font-family.mono}",
103+
"cds-g100": "{carbon.typography.font-family.mono}"
104104
},
105105
"private": "true"
106106
},
@@ -146,43 +146,43 @@
146146
"$value": "400",
147147
"$modes": {
148148
"hds": "400",
149-
"cds-0": "{carbon.typography.font-weight.regular}",
150-
"cds-10": "{carbon.typography.font-weight.regular}",
151-
"cds-90": "{carbon.typography.font-weight.regular}",
152-
"cds-100": "{carbon.typography.font-weight.regular}"
149+
"cds-g0": "{carbon.typography.font-weight.regular}",
150+
"cds-g10": "{carbon.typography.font-weight.regular}",
151+
"cds-g90": "{carbon.typography.font-weight.regular}",
152+
"cds-g100": "{carbon.typography.font-weight.regular}"
153153
}
154154
},
155155
"medium": {
156156
"$type": "font-weight",
157157
"$value": "500",
158158
"$modes": {
159159
"hds": "500",
160-
"cds-0": "{carbon.typography.font-weight.regular}",
161-
"cds-10": "{carbon.typography.font-weight.regular}",
162-
"cds-90": "{carbon.typography.font-weight.regular}",
163-
"cds-100": "{carbon.typography.font-weight.regular}"
160+
"cds-g0": "{carbon.typography.font-weight.regular}",
161+
"cds-g10": "{carbon.typography.font-weight.regular}",
162+
"cds-g90": "{carbon.typography.font-weight.regular}",
163+
"cds-g100": "{carbon.typography.font-weight.regular}"
164164
}
165165
},
166166
"semibold": {
167167
"$type": "font-weight",
168168
"$value": "600",
169169
"$modes": {
170170
"hds": "600",
171-
"cds-0": "{carbon.typography.font-weight.semibold}",
172-
"cds-10": "{carbon.typography.font-weight.semibold}",
173-
"cds-90": "{carbon.typography.font-weight.semibold}",
174-
"cds-100": "{carbon.typography.font-weight.semibold}"
171+
"cds-g0": "{carbon.typography.font-weight.semibold}",
172+
"cds-g10": "{carbon.typography.font-weight.semibold}",
173+
"cds-g90": "{carbon.typography.font-weight.semibold}",
174+
"cds-g100": "{carbon.typography.font-weight.semibold}"
175175
}
176176
},
177177
"bold": {
178178
"$type": "font-weight",
179179
"$value": "700",
180180
"$modes": {
181181
"hds": "700",
182-
"cds-0": "{carbon.typography.font-weight.semibold}",
183-
"cds-10": "{carbon.typography.font-weight.semibold}",
184-
"cds-90": "{carbon.typography.font-weight.semibold}",
185-
"cds-100": "{carbon.typography.font-weight.semibold}"
182+
"cds-g0": "{carbon.typography.font-weight.semibold}",
183+
"cds-g10": "{carbon.typography.font-weight.semibold}",
184+
"cds-g90": "{carbon.typography.font-weight.semibold}",
185+
"cds-g100": "{carbon.typography.font-weight.semibold}"
186186
}
187187
}
188188
},

0 commit comments

Comments
 (0)