diff --git a/packages/manager/.changeset/pr-11120-upcoming-features-1729173753438.md b/packages/manager/.changeset/pr-11120-upcoming-features-1729173753438.md new file mode 100644 index 00000000000..41910c4409c --- /dev/null +++ b/packages/manager/.changeset/pr-11120-upcoming-features-1729173753438.md @@ -0,0 +1,5 @@ +--- +"@linode/manager": Upcoming Features +--- + +Add global colorTokens to theme and replace one-off hardcoded white colors ([#11120](https://github.com/linode/manager/pull/11120)) diff --git a/packages/manager/src/components/Accordion.tsx b/packages/manager/src/components/Accordion.tsx index cdfa7a2e7fc..e3c7133630e 100644 --- a/packages/manager/src/components/Accordion.tsx +++ b/packages/manager/src/components/Accordion.tsx @@ -23,7 +23,7 @@ const useStyles = makeStyles()((theme: Theme) => ({ alignItems: 'center', backgroundColor: '#2575d0', borderRadius: '50%', - color: '#fff', + color: theme.colorTokens.Neutrals.White, display: 'flex', fontFamily: theme.font.bold, fontSize: '0.875rem', diff --git a/packages/manager/src/components/CopyableTextField/CopyableTextField.tsx b/packages/manager/src/components/CopyableTextField/CopyableTextField.tsx index 1f2da7ffcd7..6dea1154ba6 100644 --- a/packages/manager/src/components/CopyableTextField/CopyableTextField.tsx +++ b/packages/manager/src/components/CopyableTextField/CopyableTextField.tsx @@ -65,7 +65,7 @@ const StyledTextField = styled(TextField)(({ theme }) => ({ color: theme.name === 'light' ? `${theme.palette.text.primary} !important` - : '#fff !important', + : `${theme.colorTokens.Neutrals.White} !important`, opacity: theme.name === 'dark' ? 0.5 : 0.8, }, '&& .MuiInput-root': { diff --git a/packages/manager/src/components/Placeholder/Placeholder.tsx b/packages/manager/src/components/Placeholder/Placeholder.tsx index 003c2984029..bdfff2a7e72 100644 --- a/packages/manager/src/components/Placeholder/Placeholder.tsx +++ b/packages/manager/src/components/Placeholder/Placeholder.tsx @@ -96,14 +96,14 @@ export const Placeholder = (props: PlaceholderProps) => { fill: theme.palette.primary.main, }, '& .circle': { - fill: theme.name === 'light' ? '#fff' : '#000', + fill: theme.name === 'light' ? theme.colorTokens.Neutrals.White : '#000', }, '& .insidePath path': { opacity: 0, stroke: theme.palette.primary.main, }, '& .outerCircle': { - fill: theme.name === 'light' ? '#fff' : '#000', + fill: theme.name === 'light' ? theme.colorTokens.Neutrals.White : '#000', stroke: theme.bg.offWhite, }, height: '160px', diff --git a/packages/manager/src/components/PrimaryNav/PrimaryNav.styles.ts b/packages/manager/src/components/PrimaryNav/PrimaryNav.styles.ts index 03912e910e5..2455532add4 100644 --- a/packages/manager/src/components/PrimaryNav/PrimaryNav.styles.ts +++ b/packages/manager/src/components/PrimaryNav/PrimaryNav.styles.ts @@ -29,7 +29,7 @@ const useStyles = makeStyles()( opacity: 0, }, alignItems: 'center', - color: '#fff', + color: theme.colorTokens.Neutrals.White, display: 'flex', fontFamily: 'LatoWebBold', fontSize: '0.875rem', diff --git a/packages/manager/src/components/RegionSelect/RegionSelect.styles.ts b/packages/manager/src/components/RegionSelect/RegionSelect.styles.ts index 8ed59451213..50369c7f418 100644 --- a/packages/manager/src/components/RegionSelect/RegionSelect.styles.ts +++ b/packages/manager/src/components/RegionSelect/RegionSelect.styles.ts @@ -106,7 +106,7 @@ export const SelectedIcon = styled(DoneIcon, { width: 17, })); -export const StyledChip = styled(Chip)(() => ({ +export const StyledChip = styled(Chip)(({ theme }) => ({ '& .MuiChip-deleteIcon': { '& svg': { borderRadius: '50%', @@ -115,10 +115,10 @@ export const StyledChip = styled(Chip)(() => ({ }, '& .MuiChip-deleteIcon.MuiSvgIcon-root': { '&:hover': { - backgroundColor: '#fff', + backgroundColor: theme.colorTokens.Neutrals.White, color: '#3683dc', }, backgroundColor: '#3683dc', - color: '#fff', + color: theme.colorTokens.Neutrals.White, }, })); diff --git a/packages/manager/src/components/Tag/Tag.styles.ts b/packages/manager/src/components/Tag/Tag.styles.ts index 74ab54e1dd9..582b8f8dde1 100644 --- a/packages/manager/src/components/Tag/Tag.styles.ts +++ b/packages/manager/src/components/Tag/Tag.styles.ts @@ -91,7 +91,9 @@ export const StyledDeleteButton = styled(StyledLinkButton, { backgroundColor: theme.color.buttonPrimaryHover, }, borderBottomRightRadius: 3, - borderLeft: `1px solid ${theme.name === 'light' ? '#fff' : '#2e3238'}`, + borderLeft: `1px solid ${ + theme.name === 'light' ? theme.colorTokens.Neutrals.White : '#2e3238' + }`, borderRadius: 0, borderTopRightRadius: 3, height: 30, diff --git a/packages/manager/src/components/TagCell/TagCell.tsx b/packages/manager/src/components/TagCell/TagCell.tsx index 24c56689188..49b037bf6d4 100644 --- a/packages/manager/src/components/TagCell/TagCell.tsx +++ b/packages/manager/src/components/TagCell/TagCell.tsx @@ -235,7 +235,7 @@ const StyledTag = styled(Tag, { const StyledIconButton = styled(IconButton)(({ theme }) => ({ '&:hover': { backgroundColor: theme.palette.primary.main, - color: '#ffff', + color: theme.colorTokens.Neutrals.White, }, backgroundColor: theme.color.tagButtonBg, borderRadius: 0, diff --git a/packages/manager/src/dev-tools/Preferences.tsx b/packages/manager/src/dev-tools/Preferences.tsx index de25a3a0216..9fdd92e2928 100644 --- a/packages/manager/src/dev-tools/Preferences.tsx +++ b/packages/manager/src/dev-tools/Preferences.tsx @@ -1,13 +1,15 @@ import LinkIcon from '@mui/icons-material/Link'; +import { useTheme } from '@mui/material'; import * as React from 'react'; export const Preferences = () => { + const theme = useTheme(); return ( <>

Preferences

Open preference Modal ({ button: { '& svg': { - color: theme.name === 'light' ? '#fff' : '#616161', + color: + theme.name === 'light' ? theme.colorTokens.Neutrals.White : '#616161', height: 16, }, '&:hover': { @@ -31,7 +32,8 @@ const useStyles = makeStyles()((theme: Theme) => ({ transition: 'none', }, alignItems: 'center', - backgroundColor: theme.name === 'light' ? '#000' : '#fff', + backgroundColor: + theme.name === 'light' ? '#000' : theme.colorTokens.Neutrals.White, border: 0, borderRadius: 4, cursor: 'pointer', diff --git a/packages/manager/src/features/CancelLanding/CancelLanding.tsx b/packages/manager/src/features/CancelLanding/CancelLanding.tsx index 74b96cc01ca..9056ddbde6a 100644 --- a/packages/manager/src/features/CancelLanding/CancelLanding.tsx +++ b/packages/manager/src/features/CancelLanding/CancelLanding.tsx @@ -16,7 +16,7 @@ const useStyles = makeStyles()((theme: Theme) => ({ root: { '& button': { backgroundColor: '#00b159', - color: '#fff', + color: theme.colorTokens.Neutrals.White, marginTop: theme.spacing(8), }, '& h1': { diff --git a/packages/manager/src/features/Linodes/LinodeCreate/Tabs/Marketplace/AppDetailDrawer.tsx b/packages/manager/src/features/Linodes/LinodeCreate/Tabs/Marketplace/AppDetailDrawer.tsx index ddbfc43bae3..10fa1e88aed 100644 --- a/packages/manager/src/features/Linodes/LinodeCreate/Tabs/Marketplace/AppDetailDrawer.tsx +++ b/packages/manager/src/features/Linodes/LinodeCreate/Tabs/Marketplace/AppDetailDrawer.tsx @@ -16,7 +16,7 @@ import type { Theme } from '@mui/material/styles'; const useStyles = makeStyles()((theme: Theme) => ({ appName: { - color: '#fff !important', + color: `${theme.colorTokens.Neutrals.White} !important`, fontFamily: theme.font.bold, fontSize: '2.2rem', lineHeight: '2.5rem', diff --git a/packages/manager/src/features/Profile/AuthenticationSettings/TwoFactor/QRCodeForm.tsx b/packages/manager/src/features/Profile/AuthenticationSettings/TwoFactor/QRCodeForm.tsx index 79d664307c6..e2d79add7c6 100644 --- a/packages/manager/src/features/Profile/AuthenticationSettings/TwoFactor/QRCodeForm.tsx +++ b/packages/manager/src/features/Profile/AuthenticationSettings/TwoFactor/QRCodeForm.tsx @@ -42,7 +42,7 @@ const StyledInstructions = styled(Typography, { const StyledQRCodeContainer = styled('div', { label: 'StyledQRCodeContainer', })(({ theme }) => ({ - border: `5px solid #fff`, + border: `5px solid ${theme.colorTokens.Neutrals.White}`, display: 'inline-block', margin: `${theme.spacing(2)} 0`, })); diff --git a/packages/manager/src/features/VPCs/VPCDetail/VPCDetail.styles.ts b/packages/manager/src/features/VPCs/VPCDetail/VPCDetail.styles.ts index 7dc1846cbb2..8a9e7640dd2 100644 --- a/packages/manager/src/features/VPCs/VPCDetail/VPCDetail.styles.ts +++ b/packages/manager/src/features/VPCs/VPCDetail/VPCDetail.styles.ts @@ -9,7 +9,7 @@ export const StyledActionButton = styled(Button, { })(({ theme }) => ({ '&:hover': { backgroundColor: theme.color.blue, - color: '#fff', + color: theme.colorTokens.Neutrals.White, }, color: theme.textColors.linkActiveLight, fontFamily: theme.font.normal, diff --git a/packages/manager/src/features/components/PlansPanel/PlanSelection.styles.ts b/packages/manager/src/features/components/PlansPanel/PlanSelection.styles.ts index ee20e52388a..0a1970408ea 100644 --- a/packages/manager/src/features/components/PlansPanel/PlanSelection.styles.ts +++ b/packages/manager/src/features/components/PlansPanel/PlanSelection.styles.ts @@ -6,7 +6,7 @@ import { TableCell } from 'src/components/TableCell'; export const StyledChip = styled(Chip, { label: 'StyledChip' })( ({ theme }) => ({ backgroundColor: theme.color.green, - color: '#fff', + color: theme.colorTokens.Neutrals.White, marginLeft: theme.spacing(), position: 'relative', textTransform: 'uppercase', diff --git a/packages/ui/src/foundations/themes/index.ts b/packages/ui/src/foundations/themes/index.ts index 4a507f9e6b1..757677dd594 100644 --- a/packages/ui/src/foundations/themes/index.ts +++ b/packages/ui/src/foundations/themes/index.ts @@ -7,6 +7,7 @@ import { lightTheme } from './light'; import type { ChartTypes, + ColorTypes, InteractionTypes as InteractionTypesLight, } from '@linode/design-language-system'; import type { InteractionTypes as InteractionTypesDark } from '@linode/design-language-system/themes/dark'; @@ -74,6 +75,7 @@ declare module '@mui/material/styles/createTheme' { bg: BgColors; borderColors: BorderColors; chartTokens: ChartTypes; + colorTokens: ColorTypes; // Global token: theme agnostic color: Colors; font: Fonts; graphs: any; @@ -95,6 +97,7 @@ declare module '@mui/material/styles/createTheme' { bg?: DarkModeBgColors | LightModeBgColors; borderColors?: DarkModeBorderColors | LightModeBorderColors; chartTokens?: ChartTypes; + colorTokens?: ColorTypes; // Global token: theme agnostic color?: DarkModeColors | LightModeColors; font?: Fonts; graphs?: any; diff --git a/packages/ui/src/foundations/themes/light.ts b/packages/ui/src/foundations/themes/light.ts index c7f36351839..24e658064c6 100644 --- a/packages/ui/src/foundations/themes/light.ts +++ b/packages/ui/src/foundations/themes/light.ts @@ -240,6 +240,7 @@ export const lightTheme: ThemeOptions = { borderColors, breakpoints, chartTokens: Chart, + colorTokens: Color, color, components: { MuiAccordion: {