diff --git a/src/components/AlertMessage.tsx b/src/components/AlertMessage.tsx index ba30b00..7fdc001 100644 --- a/src/components/AlertMessage.tsx +++ b/src/components/AlertMessage.tsx @@ -40,9 +40,6 @@ const AlertContainer = styled.div` case AlertType.Info: { return css` --alert-accent-color: var(--color-text-1); - - --alert-default-background-opacity: 0.133; // Relative - // --alert-background: var(--color-layer-6); // Absolute `; } case AlertType.Success: { diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 633fc92..b86ae4c 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -103,14 +103,14 @@ const buttonActionVariants = { [ButtonAction.Create]: css` --button-textColor: var(--color-text-button); - --button-backgroundColor: var(--color-success); + --button-backgroundColor: var(--color-green); --button-border: solid var(--border-width) var(--color-border-white); --button-hover-filter: brightness(var(--hover-filter-variant)); `, [ButtonAction.Destroy]: css` --button-textColor: var(--color-text-button); - --button-backgroundColor: var(--color-error); + --button-backgroundColor: var(--color-red); --button-border: solid var(--border-width) var(--color-border-white); --button-hover-filter: brightness(var(--hover-filter-variant)); `, @@ -122,7 +122,7 @@ const buttonActionVariants = { `, [ButtonAction.Reset]: css` - --button-textColor: var(--color-error); + --button-textColor: var(--color-red); --button-backgroundColor: var(--color-layer-3); --button-border: solid var(--border-width) var(--color-border-red); --button-hover-filter: brightness(var(--hover-filter-variant)); diff --git a/src/components/DropdownMenu.tsx b/src/components/DropdownMenu.tsx index 908e3fa..5d19be8 100644 --- a/src/components/DropdownMenu.tsx +++ b/src/components/DropdownMenu.tsx @@ -91,10 +91,10 @@ Styled.Item = styled(Item)<{ $highlightColor: 'accent' | 'create' | 'destroy' }> --item-highlighted-textColor: var(--color-accent); `, ['create']: ` - --item-highlighted-textColor: var(--color-success); + --item-highlighted-textColor: var(--color-green); `, ['destroy']: ` - --item-highlighted-textColor: var(--color-error); + --item-highlighted-textColor: var(--color-red); `, }[$highlightColor])} diff --git a/src/components/Switch.tsx b/src/components/Switch.tsx index cc8b149..103f933 100644 --- a/src/components/Switch.tsx +++ b/src/components/Switch.tsx @@ -47,7 +47,7 @@ Styled.Root = styled(Root)` --switch-thumb-backgroundColor: var(--color-layer-6); --switch-active-backgroundColor: var(--color-accent); - --switch-active-thumb-backgroundColor: ${({ theme }) => theme.switchThumbActiveBackground}; + --switch-active-thumb-backgroundColor: var(--color-white); position: relative; width: var(--switch-width); diff --git a/src/components/WithConfirmationPopover.tsx b/src/components/WithConfirmationPopover.tsx index b65c5a7..eaae610 100644 --- a/src/components/WithConfirmationPopover.tsx +++ b/src/components/WithConfirmationPopover.tsx @@ -117,7 +117,7 @@ Styled.ConfirmButton = styled(Styled.IconButton)` --button-backgroundColor: hsla(203, 25%, 19%, 1); svg { - color: var(--color-success); + color: var(--color-green); } `; @@ -125,7 +125,7 @@ Styled.CancelButton = styled(Styled.IconButton)` --button-backgroundColor: hsla(296, 16%, 18%, 1); svg { - color: var(--color-error); + color: var(--color-red); width: 0.8em; height: 0.8em; diff --git a/src/constants/styles/colors.ts b/src/constants/styles/colors.ts index d83b9e2..7443864 100644 --- a/src/constants/styles/colors.ts +++ b/src/constants/styles/colors.ts @@ -5,7 +5,8 @@ export type Theme = { [AppColorMode.RedUp]: ThemeColorBase; }; -export type ThemeColorBase = LayerColors & +export type ThemeColorBase = BaseColors & + LayerColors & BorderColors & TextColors & GradientColors & @@ -17,6 +18,12 @@ export type ThemeColorBase = LayerColors & ComponentColors & Filters; +type BaseColors = { + white: string; + green: string; + red: string; +}; + type LayerColors = { layer0: string; layer1: string; @@ -86,7 +93,6 @@ type IconColors = { type ComponentColors = { inputBackground: string; popoverBackground: string; - switchThumbActiveBackground: string; toggleBackground: string; tooltipBackground: string; }; diff --git a/src/pages/Profile.tsx b/src/pages/Profile.tsx index 5136f43..1324824 100644 --- a/src/pages/Profile.tsx +++ b/src/pages/Profile.tsx @@ -335,7 +335,7 @@ Styled.ActionButton = styled(IconButton)<{ iconName?: IconName }>` ${({ iconName }) => iconName === IconName.Close ? css` - --button-textColor: var(--color-error); + --button-textColor: var(--color-red); --button-icon-size: 0.75em; ` : iconName === IconName.Transfer && diff --git a/src/styles/globalStyle.ts b/src/styles/globalStyle.ts index afd8b99..6038aa6 100644 --- a/src/styles/globalStyle.ts +++ b/src/styles/globalStyle.ts @@ -2,6 +2,10 @@ import { createGlobalStyle } from 'styled-components'; export const GlobalStyle = createGlobalStyle` :root { + --color-white: ${({ theme }) => theme.white}; + --color-green: ${({ theme }) => theme.green}; + --color-red: ${({ theme }) => theme.red}; + --color-layer-0: ${({ theme }) => theme.layer0}; --color-layer-1: ${({ theme }) => theme.layer1}; --color-layer-2: ${({ theme }) => theme.layer2}; diff --git a/src/styles/themes.ts b/src/styles/themes.ts index fcfa3b2..cf5d54b 100644 --- a/src/styles/themes.ts +++ b/src/styles/themes.ts @@ -4,6 +4,10 @@ import { BrightnessFilterToken, ColorToken, OpacityToken } from '@/constants/sty import { generateFadedColorVariant } from '@/lib/styles'; const ClassicThemeBase: ThemeColorBase = { + white: ColorToken.White, + green: ColorToken.Green1, + red: ColorToken.Red2, + layer0: ColorToken.GrayBlue7, layer1: ColorToken.GrayBlue6, layer2: ColorToken.GrayBlue5, @@ -51,7 +55,6 @@ const ClassicThemeBase: ThemeColorBase = { inputBackground: ColorToken.GrayBlue3, popoverBackground: generateFadedColorVariant(ColorToken.GrayBlue4, OpacityToken.Opacity90), - switchThumbActiveBackground: ColorToken.White, toggleBackground: ColorToken.GrayBlue3, tooltipBackground: generateFadedColorVariant(ColorToken.GrayBlue3, OpacityToken.Opacity66), @@ -61,6 +64,10 @@ const ClassicThemeBase: ThemeColorBase = { }; const DarkThemeBase: ThemeColorBase = { + white: ColorToken.White, + green: ColorToken.Green0, + red: ColorToken.Red0, + layer0: ColorToken.Black, layer1: ColorToken.DarkGray11, layer2: ColorToken.DarkGray13, @@ -108,7 +115,6 @@ const DarkThemeBase: ThemeColorBase = { inputBackground: ColorToken.DarkGray6, popoverBackground: generateFadedColorVariant(ColorToken.DarkGray8, OpacityToken.Opacity90), - switchThumbActiveBackground: ColorToken.White, toggleBackground: ColorToken.DarkGray6, tooltipBackground: generateFadedColorVariant(ColorToken.DarkGray6, OpacityToken.Opacity66), @@ -118,6 +124,10 @@ const DarkThemeBase: ThemeColorBase = { }; const LightThemeBase: ThemeColorBase = { + white: ColorToken.White, + green: ColorToken.Green2, + red: ColorToken.Red1, + layer0: ColorToken.White, layer1: ColorToken.LightGray6, layer2: ColorToken.White, @@ -165,7 +175,6 @@ const LightThemeBase: ThemeColorBase = { inputBackground: ColorToken.White, popoverBackground: generateFadedColorVariant(ColorToken.LightGray8, OpacityToken.Opacity90), - switchThumbActiveBackground: ColorToken.White, toggleBackground: ColorToken.LightGray4, tooltipBackground: generateFadedColorVariant(ColorToken.LightGray7, OpacityToken.Opacity66), diff --git a/src/views/AccountInfo/AccountInfoConnectedState.tsx b/src/views/AccountInfo/AccountInfoConnectedState.tsx index 9996def..b6b7dbb 100644 --- a/src/views/AccountInfo/AccountInfoConnectedState.tsx +++ b/src/views/AccountInfo/AccountInfoConnectedState.tsx @@ -173,7 +173,7 @@ export const AccountInfoConnectedState = () => { {label} - {hasError ? : slotRight} + {hasError ? : slotRight} ), @@ -230,7 +230,7 @@ Styled.CircleContainer = styled.div` border-radius: 50%; `; -Styled.Icon = styled(Icon)` +Styled.CautionIcon = styled(Icon)` color: var(--color-error); `; diff --git a/src/views/PositionInfo.tsx b/src/views/PositionInfo.tsx index 2ea9477..1df8cb6 100644 --- a/src/views/PositionInfo.tsx +++ b/src/views/PositionInfo.tsx @@ -557,11 +557,11 @@ Styled.PositionTile = styled(PositionTile)``; Styled.ClosePositionButton = styled(Button)` --button-border: solid var(--border-width) var(--color-border-red); - --button-textColor: var(--color-error); + --button-textColor: var(--color-red); `; Styled.ClosePositionToggleButton = styled(ToggleButton)` --button-border: solid var(--border-width) var(--color-border-red); - --button-toggle-off-textColor: var(--color-error); - --button-toggle-on-textColor: var(--color-error); + --button-toggle-off-textColor: var(--color-red); + --button-toggle-on-textColor: var(--color-red); `; diff --git a/src/views/dialogs/DisplaySettingsDialog.tsx b/src/views/dialogs/DisplaySettingsDialog.tsx index 6cf492c..61f5e12 100644 --- a/src/views/dialogs/DisplaySettingsDialog.tsx +++ b/src/views/dialogs/DisplaySettingsDialog.tsx @@ -39,7 +39,6 @@ export const DisplaySettingsDialog = ({ setIsOpen }: ElementProps) => { const sectionHeader = (heading: string) => { return ( - {heading} {heading} @@ -287,10 +286,10 @@ Styled.ArrowIcon = styled(Icon)<{ direction: 'up' | 'down'; color: 'green' | 're ${({ color }) => ({ ['green']: css` - color: var(--color-success); + color: var(--color-green); `, ['red']: css` - color: var(--color-error); + color: var(--color-red); `, }[color])} `; diff --git a/src/views/dialogs/MnemonicExportDialog.tsx b/src/views/dialogs/MnemonicExportDialog.tsx index a1c1c73..3b7c346 100644 --- a/src/views/dialogs/MnemonicExportDialog.tsx +++ b/src/views/dialogs/MnemonicExportDialog.tsx @@ -155,8 +155,7 @@ Styled.CautionIconContainer = styled.div` content: ''; width: 2.5rem; height: 2.5rem; - background-color: var(--color-error); - opacity: 0.1; + background-color: var(--color-gradient-error); } `; diff --git a/src/views/dialogs/OnboardingDialog/GenerateKeys.tsx b/src/views/dialogs/OnboardingDialog/GenerateKeys.tsx index ab824d5..4bc6a86 100644 --- a/src/views/dialogs/OnboardingDialog/GenerateKeys.tsx +++ b/src/views/dialogs/OnboardingDialog/GenerateKeys.tsx @@ -323,7 +323,7 @@ Styled.ReceiptArea = styled.div` `; Styled.Green = styled.span` - color: var(--color-success); + color: var(--color-green); `; Styled.GreenCheckCircle = styled(GreenCheckCircle)` diff --git a/src/views/forms/TransferForm.tsx b/src/views/forms/TransferForm.tsx index 4775c85..678e72e 100644 --- a/src/views/forms/TransferForm.tsx +++ b/src/views/forms/TransferForm.tsx @@ -306,7 +306,7 @@ export const TransferForm = ({ label={ {stringGetter({ key: STRING_KEYS.DESTINATION })} - {isAddressValid && } + {isAddressValid && } } type={InputType.Text} @@ -439,10 +439,10 @@ Styled.InlineRow = styled.span` Styled.DestinationInputLabel = styled.span` ${layoutMixins.inlineRow} +`; - svg { - color: var(--color-success); - } +Styled.CheckIcon = styled(Icon)` + color: var(--color-success); `; Styled.AddressValidationAlertMessage = styled(AlertMessage)` diff --git a/src/views/tables/OrdersTable/OrderActionsCell.tsx b/src/views/tables/OrdersTable/OrderActionsCell.tsx index fd4c867..e974384 100644 --- a/src/views/tables/OrdersTable/OrderActionsCell.tsx +++ b/src/views/tables/OrdersTable/OrderActionsCell.tsx @@ -82,6 +82,6 @@ Styled.ActionButton = styled(IconButton)` Styled.CancelButton = styled(Styled.ActionButton)` &:not(:disabled) { - --button-textColor: var(--color-error); + --button-textColor: var(--color-red); } `;