Skip to content

Commit 7064896

Browse files
refactor: [M3-9591] - Cleanup token organization and paths (#11867)
* Initial commit - save progress * update docs * feedback @jaalah-akamai * feedback @jaalah-akamai * cleanup * Fix post develop merge
1 parent 283419b commit 7064896

File tree

54 files changed

+187
-291
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+187
-291
lines changed

docs/development-guide/16-design-tokens.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Our design system provides tokens via the `theme.tokens` object, which contains
99
theme.tokens.spacing.S16 // "1rem"
1010

1111
// Accessing typography tokens
12-
theme.tokens.typography.Heading.Xxl // "800 1.625rem/2rem 'Nunito Sans'"
12+
theme.tokens.alias.Typography.Heading.Xxl // "800 1.625rem/2rem 'Nunito Sans'"
1313
```
1414

1515
### ⚠️ Warning: Global vs. Theme-Sensitive Tokens
@@ -21,9 +21,9 @@ theme.tokens.typography.Heading.Xxl // "800 1.625rem/2rem 'Nunito Sans'"
2121
<Paper sx={(theme) => ({ backgroundColor: theme.tokens.color.Neutral[5] })}>
2222

2323
// ✅ Correct: Using alias (semantic) color tokens
24-
<Paper sx={(theme) => ({ backgroundColor: theme.tokens.content.Background.Normal })}>
24+
<Paper sx={(theme) => ({ backgroundColor: theme.tokens.alias.Content.Background.Normal })}>
2525

26-
<Paper sx={(theme) => ({ backgroundColor: theme.semanticTokens.textColors.primary })}>
26+
<Paper sx={(theme) => ({ backgroundColor: theme.tokens.alias.Content.Text.Primary })}>
2727
```
2828

2929
### Best Practices for Token Usage

packages/manager/src/components/EnhancedNumberInput/EnhancedNumberInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ const StyledButton = styled(Button)(({ theme }) => ({
142142
border: 'none',
143143
},
144144
border: 'none',
145-
borderRadius: theme.tokens.borderRadius.None,
145+
borderRadius: theme.tokens.alias.Radius.Default,
146146
height: 34,
147147
minHeight: 'fit-content',
148148
minWidth: 30,

packages/manager/src/components/IconTextLink/IconTextLink.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const useStyles = makeStyles()((theme: Theme) => ({
3131
},
3232
root: {
3333
alignItems: 'center',
34-
borderRadius: theme.tokens.borderRadius.None,
34+
borderRadius: theme.tokens.alias.Radius.Default,
3535
display: 'flex',
3636
gap: theme.spacing(2),
3737
padding: theme.spacing(0.5),

packages/manager/src/components/PaginationFooter/PaginationFooter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export const PaginationFooter = (props: Props) => {
6464
<Box
6565
sx={{
6666
background: theme.bg.bgPaper,
67-
border: `1px solid ${theme.tokens.table.Row.Border}`,
67+
border: `1px solid ${theme.tokens.component.Table.Row.Border}`,
6868
borderTop: 0,
6969
...sx,
7070
}}

packages/manager/src/components/PrimaryNav/PrimaryNav.styles.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const StyledAkamaiLogo = styled(AkamaiLogo, {
1616
export const StyledDivider = styled(Divider, {
1717
label: 'StyledDivider',
1818
})(({ theme }) => ({
19-
borderColor: theme.tokens.border.Normal,
19+
borderColor: theme.tokens.alias.Border.Normal,
2020
margin: 0,
2121
}));
2222

@@ -38,7 +38,7 @@ export const StyledActiveLink = styled(Link, {
3838
alignItems: 'center',
3939
cursor: 'pointer',
4040
display: 'flex',
41-
font: theme.tokens.typography.Body.Semibold,
41+
font: theme.tokens.alias.Typography.Body.Semibold,
4242
height: 32,
4343
minWidth: SIDEBAR_WIDTH,
4444
padding: `8px 8px 8px 48px`,
@@ -57,11 +57,11 @@ export const StyledPrimaryLinkBox = styled(Box, {
5757
? theme.tokens.color.Brand[60]
5858
: theme.tokens.color.Neutrals['White'],
5959
display: 'flex',
60-
font: theme.tokens.typography.Label.Semibold.S,
60+
font: theme.tokens.alias.Typography.Label.Semibold.S,
6161
transition: theme.transitions.create(['color', 'opacity']),
6262
width: '100%',
6363
...(props.isActiveLink && {
64-
font: theme.tokens.typography.Body.Bold,
64+
font: theme.tokens.alias.Typography.Body.Bold,
6565
}),
6666
...(props.isCollapsed && {
6767
opacity: 0,
@@ -80,7 +80,8 @@ export const StyledAccordion = styled(Accordion, {
8080
fontSize: theme.tokens.font.FontSize.Xxxs,
8181
// eslint-disable-next-line
8282
fontWeight: theme.tokens.font.FontWeight.Extrabold,
83-
letterSpacing: theme.tokens.typography.Heading.OverlineLetterSpacing,
83+
letterSpacing:
84+
theme.tokens.alias.Typography.Heading.OverlineLetterSpacing,
8485
lineHeight: theme.tokens.font.LineHeight.Xxxs,
8586
paddingLeft: theme.tokens.spacing.S12,
8687
paddingRight: theme.tokens.spacing.S12,
@@ -101,7 +102,7 @@ export const StyledAccordion = styled(Accordion, {
101102
},
102103
alignItems: 'center',
103104
display: 'flex',
104-
font: theme.tokens.typography.Label.Bold.S,
105+
font: theme.tokens.alias.Typography.Label.Bold.S,
105106
},
106107
'.MuiAccordionDetails-root': {
107108
padding: 0,
@@ -150,15 +151,15 @@ export const StyledChip = styled(Chip, {
150151
shouldForwardProp: omittedProps(['isActiveLink']),
151152
})<{ isActiveLink: boolean }>(({ theme, ...props }) => ({
152153
backgroundColor: props.isActiveLink
153-
? theme.tokens.sideNavigation.SelectedMenuItem.Label.Background
154-
: theme.tokens.sideNavigation.DefaultMenuItem.Label.Background,
154+
? theme.tokens.component.SideNavigation.SelectedMenuItem.Label.Background
155+
: theme.tokens.component.SideNavigation.DefaultMenuItem.Label.Background,
155156
border: !props.isActiveLink
156-
? `1px solid ${theme.tokens.sideNavigation.DefaultMenuItem.Label.Border}`
157+
? `1px solid ${theme.tokens.component.SideNavigation.DefaultMenuItem.Label.Border}`
157158
: 'none',
158159
borderRadius: '2px',
159160
color: props.isActiveLink
160-
? theme.tokens.sideNavigation.SelectedMenuItem.Label.Text
161-
: theme.tokens.sideNavigation.DefaultMenuItem.Label.Text,
161+
? theme.tokens.component.SideNavigation.SelectedMenuItem.Label.Text
162+
: theme.tokens.component.SideNavigation.DefaultMenuItem.Label.Text,
162163
marginRight: '12px',
163164
overflow: 'hidden',
164165
whiteSpace: 'nowrap',

packages/manager/src/components/PrimaryNav/SideMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const StyledDrawer = styled(Drawer, {
8484
overflow: 'hidden',
8585
position: 'absolute',
8686
[theme.breakpoints.up('md')]: {
87-
borderRight: `1px solid ${theme.tokens.sideNavigation.Border}`,
87+
borderRight: `1px solid ${theme.tokens.component.SideNavigation.Border}`,
8888
},
8989
transform: 'none',
9090
transition: 'width linear 100ms, height linear 250ms',

packages/manager/src/components/RegionSelect/RegionOption.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export const RegionOption = ({
3838
{item.id === 'global' ? (
3939
<PublicIcon
4040
sx={(theme) => ({
41-
color: `${theme.tokens.content.Icon.Primary.Active}`,
41+
color: `${theme.tokens.alias.Content.Icon.Primary.Active}`,
4242
})}
4343
className="public-icon"
4444
/>

packages/manager/src/components/SelectionCard/CardBase.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const CardBaseSubheading = styled('div', {
9090
label: 'CardBaseSubheading',
9191
})<Partial<CardBaseProps>>(({ theme, ...props }) => ({
9292
color: props.checked
93-
? theme.tokens.content.Text.Primary.Default
93+
? theme.tokens.alias.Content.Text.Primary.Default
9494
: theme.palette.text.primary,
9595
fontSize: '0.875rem',
9696
}));

packages/manager/src/components/Tag/Tag.styles.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const StyledDeleteButton = styled(StyledLinkButton, {
6868
label: 'StyledDeleteButton',
6969
})(({ theme }) => ({
7070
'& svg': {
71-
borderRadius: theme.tokens.borderRadius.None,
71+
borderRadius: theme.tokens.alias.Radius.Default,
7272
color: theme.color.tagIcon,
7373
height: 15,
7474
width: 15,
@@ -85,7 +85,7 @@ export const StyledDeleteButton = styled(StyledLinkButton, {
8585
? theme.tokens.color.Neutrals.White
8686
: theme.tokens.color.Neutrals[100]
8787
}`,
88-
borderRadius: theme.tokens.borderRadius.None,
88+
borderRadius: theme.tokens.alias.Radius.Default,
8989
borderTopRightRadius: 3,
9090
height: 30,
9191
margin: 0,

packages/manager/src/components/TagCell/TagCell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ const StyledIconButton = styled(IconButton)(({ theme }) => ({
241241
color: theme.tokens.color.Neutrals.White,
242242
},
243243
backgroundColor: theme.color.tagButtonBg,
244-
borderRadius: theme.tokens.borderRadius.None,
244+
borderRadius: theme.tokens.alias.Radius.Default,
245245
color: theme.color.tagIcon,
246246
height: 30,
247247
marginLeft: theme.spacing(0.5),

0 commit comments

Comments
 (0)