Commit 1644e4f9 authored by Justin Domingue's avatar Justin Domingue Committed by GitHub

fix(a11y): color contrast changes (#1803)

* fix: a11y changes

* more a11y fixes

* updated theme colors

* addressed rev4 comments

* address rev5 comments

* addressed rev6
parent 574fab54
...@@ -72,14 +72,12 @@ export const ButtonPrimary = styled(Base)` ...@@ -72,14 +72,12 @@ export const ButtonPrimary = styled(Base)`
} }
&:disabled { &:disabled {
background-color: ${({ theme, altDisabledStyle, disabled }) => background-color: ${({ theme, altDisabledStyle, disabled }) =>
altDisabledStyle ? (disabled ? theme.primary1 : theme.primary1) : theme.primary1}; altDisabledStyle ? (disabled ? theme.primary1 : theme.bg2) : theme.bg2};
color: white; color: ${({ theme }) => theme.text2};
cursor: auto; cursor: auto;
box-shadow: none; box-shadow: none;
border: 1px solid transparent; border: 1px solid transparent;
outline: none; outline: none;
opacity: 0.4;
opacity: ${({ altDisabledStyle }) => (altDisabledStyle ? '0.5' : '0.4')};
} }
` `
......
...@@ -18,10 +18,10 @@ export function FiatValue({ ...@@ -18,10 +18,10 @@ export function FiatValue({
if (!priceImpact) return undefined if (!priceImpact) return undefined
if (priceImpact.lessThan('0')) return theme.green1 if (priceImpact.lessThan('0')) return theme.green1
const severity = warningSeverity(priceImpact) const severity = warningSeverity(priceImpact)
if (severity < 1) return theme.text4 if (severity < 1) return theme.text3
if (severity < 3) return theme.yellow1 if (severity < 3) return theme.yellow1
return theme.red1 return theme.red1
}, [priceImpact, theme.green1, theme.red1, theme.text4, theme.yellow1]) }, [priceImpact, theme.green1, theme.red1, theme.text3, theme.yellow1])
return ( return (
<TYPE.body fontSize={14} color={fiatValue ? theme.text2 : theme.text4}> <TYPE.body fontSize={14} color={fiatValue ? theme.text2 : theme.text4}>
......
...@@ -130,7 +130,7 @@ const StyledBalanceMax = styled.button<{ disabled?: boolean }>` ...@@ -130,7 +130,7 @@ const StyledBalanceMax = styled.button<{ disabled?: boolean }>`
font-weight: 500; font-weight: 500;
cursor: pointer; cursor: pointer;
padding: 0; padding: 0;
color: ${({ theme }) => theme.primary1}; color: ${({ theme }) => theme.primaryText1};
opacity: ${({ disabled }) => (!disabled ? 1 : 0.4)}; opacity: ${({ disabled }) => (!disabled ? 1 : 0.4)};
pointer-events: ${({ disabled }) => (!disabled ? 'initial' : 'none')}; pointer-events: ${({ disabled }) => (!disabled ? 'initial' : 'none')};
margin-left: 0.25rem; margin-left: 0.25rem;
......
...@@ -21,7 +21,7 @@ const StyledPolling = styled.div` ...@@ -21,7 +21,7 @@ const StyledPolling = styled.div`
` `
const StyledPollingNumber = styled(TYPE.small)<{ breathe: boolean; hovering: boolean }>` const StyledPollingNumber = styled(TYPE.small)<{ breathe: boolean; hovering: boolean }>`
transition: opacity 0.25s ease; transition: opacity 0.25s ease;
opacity: ${({ breathe, hovering }) => (hovering ? 0.7 : breathe ? 1 : 0.2)}; opacity: ${({ breathe, hovering }) => (hovering ? 0.7 : breathe ? 1 : 0.5)};
:hover { :hover {
opacity: 1; opacity: 1;
} }
......
...@@ -23,8 +23,9 @@ const BaseWrapper = styled.div<{ disable?: boolean }>` ...@@ -23,8 +23,9 @@ const BaseWrapper = styled.div<{ disable?: boolean }>`
background-color: ${({ theme, disable }) => !disable && theme.bg2}; background-color: ${({ theme, disable }) => !disable && theme.bg2};
} }
color: ${({ theme, disable }) => disable && theme.text3};
background-color: ${({ theme, disable }) => disable && theme.bg3}; background-color: ${({ theme, disable }) => disable && theme.bg3};
opacity: ${({ disable }) => disable && '0.4'}; filter: ${({ disable }) => disable && 'grayscale(1)'};
` `
export default function CommonBases({ export default function CommonBases({
......
...@@ -224,12 +224,12 @@ export function CurrencySearch({ ...@@ -224,12 +224,12 @@ export function CurrencySearch({
)} )}
<Footer> <Footer>
<Row justify="center"> <Row justify="center">
<ButtonText onClick={showManageView} color={theme.blue1} className="list-token-manage-button"> <ButtonText onClick={showManageView} color={theme.primary1} className="list-token-manage-button">
<RowFixed> <RowFixed>
<IconWrapper size="16px" marginRight="6px"> <IconWrapper size="16px" marginRight="6px" stroke={theme.primaryText1}>
<Edit /> <Edit />
</IconWrapper> </IconWrapper>
<TYPE.main color={theme.blue1}> <TYPE.main color={theme.primaryText1}>
<Trans>Manage Token Lists</Trans> <Trans>Manage Token Lists</Trans>
</TYPE.main> </TYPE.main>
</RowFixed> </RowFixed>
......
...@@ -12,15 +12,15 @@ const ToggleElement = styled.span<{ isActive?: boolean; isOnSwitch?: boolean }>` ...@@ -12,15 +12,15 @@ const ToggleElement = styled.span<{ isActive?: boolean; isOnSwitch?: boolean }>`
padding: 0.35rem 0.6rem; padding: 0.35rem 0.6rem;
border-radius: 12px; border-radius: 12px;
background: ${({ theme, isActive, isOnSwitch }) => (isActive ? (isOnSwitch ? theme.primary1 : theme.text4) : 'none')}; background: ${({ theme, isActive, isOnSwitch }) => (isActive ? (isOnSwitch ? theme.primary1 : theme.text5) : 'none')};
color: ${({ theme, isActive, isOnSwitch }) => (isActive ? (isOnSwitch ? theme.white : theme.text2) : theme.text2)}; color: ${({ theme, isActive, isOnSwitch }) => (isActive ? (isOnSwitch ? theme.white : theme.text2) : theme.text2)};
font-size: 1rem; font-size: 1rem;
font-weight: ${({ isOnSwitch }) => (isOnSwitch ? '500' : '400')}; font-weight: ${({ isOnSwitch }) => (isOnSwitch ? '500' : '400')};
:hover { :hover {
user-select: ${({ isOnSwitch }) => (isOnSwitch ? 'none' : 'initial')}; user-select: ${({ isOnSwitch }) => (isOnSwitch ? 'none' : 'initial')};
background: ${({ theme, isActive, isOnSwitch }) => background: ${({ theme, isActive, isOnSwitch }) =>
isActive ? (isOnSwitch ? theme.primary1 : theme.text3) : 'none'}; isActive ? (isOnSwitch ? theme.primary1 : theme.text5) : 'none'};
color: ${({ theme, isActive, isOnSwitch }) => (isActive ? (isOnSwitch ? theme.white : theme.text2) : theme.text3)}; color: ${({ theme, isActive, isOnSwitch }) => (isActive ? (isOnSwitch ? theme.white : theme.text3) : theme.text3)};
} }
` `
......
...@@ -20,7 +20,6 @@ import { Trans } from '@lingui/macro' ...@@ -20,7 +20,6 @@ import { Trans } from '@lingui/macro'
import { AdvancedSwapDetails } from './AdvancedSwapDetails' import { AdvancedSwapDetails } from './AdvancedSwapDetails'
import { LightCard } from '../Card' import { LightCard } from '../Card'
import { DarkGreyCard } from '../Card'
import TradePrice from '../swap/TradePrice' import TradePrice from '../swap/TradePrice'
export const ArrowWrapper = styled.div` export const ArrowWrapper = styled.div`
...@@ -36,6 +35,8 @@ export const ArrowWrapper = styled.div` ...@@ -36,6 +35,8 @@ export const ArrowWrapper = styled.div`
justify-content: center; justify-content: center;
align-items: center; align-items: center;
background-color: ${({ theme }) => theme.bg1}; background-color: ${({ theme }) => theme.bg1};
border: 4px solid;
border-color: ${({ theme }) => theme.bg0};
z-index: 2; z-index: 2;
` `
...@@ -61,7 +62,7 @@ export default function SwapModalHeader({ ...@@ -61,7 +62,7 @@ export default function SwapModalHeader({
return ( return (
<AutoColumn gap={'4px'} style={{ marginTop: '1rem' }}> <AutoColumn gap={'4px'} style={{ marginTop: '1rem' }}>
<DarkGreyCard padding="0.75rem 1rem"> <LightCard padding="0.75rem 1rem">
<AutoColumn gap={'8px'}> <AutoColumn gap={'8px'}>
<RowBetween> <RowBetween>
<TYPE.body color={theme.text3} fontWeight={500} fontSize={14}> <TYPE.body color={theme.text3} fontWeight={500} fontSize={14}>
...@@ -87,11 +88,11 @@ export default function SwapModalHeader({ ...@@ -87,11 +88,11 @@ export default function SwapModalHeader({
</RowFixed> </RowFixed>
</RowBetween> </RowBetween>
</AutoColumn> </AutoColumn>
</DarkGreyCard> </LightCard>
<ArrowWrapper> <ArrowWrapper>
<ArrowDown size="16" color={theme.text2} /> <ArrowDown size="16" color={theme.text2} />
</ArrowWrapper> </ArrowWrapper>
<DarkGreyCard padding="0.75rem 1rem" style={{ marginBottom: '0.25rem' }}> <LightCard padding="0.75rem 1rem" style={{ marginBottom: '0.25rem' }}>
<AutoColumn gap={'8px'}> <AutoColumn gap={'8px'}>
<RowBetween> <RowBetween>
<TYPE.body color={theme.text3} fontWeight={500} fontSize={14}> <TYPE.body color={theme.text3} fontWeight={500} fontSize={14}>
...@@ -118,7 +119,7 @@ export default function SwapModalHeader({ ...@@ -118,7 +119,7 @@ export default function SwapModalHeader({
</RowFixed> </RowFixed>
</RowBetween> </RowBetween>
</AutoColumn> </AutoColumn>
</DarkGreyCard> </LightCard>
<RowBetween style={{ marginTop: '0.25rem', padding: '0 1rem' }}> <RowBetween style={{ marginTop: '0.25rem', padding: '0 1rem' }}>
<TYPE.body color={theme.text2} fontWeight={500} fontSize={14}> <TYPE.body color={theme.text2} fontWeight={500} fontSize={14}>
<Trans>Price</Trans> <Trans>Price</Trans>
......
...@@ -177,8 +177,8 @@ export function SwapCallbackError({ error }: { error: ReactNode }) { ...@@ -177,8 +177,8 @@ export function SwapCallbackError({ error }: { error: ReactNode }) {
} }
export const SwapShowAcceptChanges = styled(AutoColumn)` export const SwapShowAcceptChanges = styled(AutoColumn)`
background-color: ${({ theme }) => transparentize(0.9, theme.primary1)}; background-color: ${({ theme }) => transparentize(0.95, theme.primary3)};
color: ${({ theme }) => theme.primary1}; color: ${({ theme }) => theme.primaryText1};
padding: 0.5rem; padding: 0.5rem;
border-radius: 12px; border-radius: 12px;
margin-top: 8px; margin-top: 8px;
......
...@@ -452,7 +452,6 @@ export default function Swap({ history }: RouteComponentProps) { ...@@ -452,7 +452,6 @@ export default function Swap({ history }: RouteComponentProps) {
justifyContent: 'space-between', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
height: '24px', height: '24px',
opacity: 0.8,
lineHeight: '120%', lineHeight: '120%',
marginLeft: '0.75rem', marginLeft: '0.75rem',
}} }}
...@@ -477,7 +476,7 @@ export default function Swap({ history }: RouteComponentProps) { ...@@ -477,7 +476,7 @@ export default function Swap({ history }: RouteComponentProps) {
display: 'flex', display: 'flex',
justifyContent: 'space-between', justifyContent: 'space-between',
height: '24px', height: '24px',
opacity: 0.4, opacity: 0.8,
marginLeft: '0.25rem', marginLeft: '0.25rem',
}} }}
> >
......
...@@ -44,8 +44,8 @@ export function colors(darkMode: boolean): Colors { ...@@ -44,8 +44,8 @@ export function colors(darkMode: boolean): Colors {
// text // text
text1: darkMode ? '#FFFFFF' : '#000000', text1: darkMode ? '#FFFFFF' : '#000000',
text2: darkMode ? '#C3C5CB' : '#565A69', text2: darkMode ? '#C3C5CB' : '#565A69',
text3: darkMode ? '#6C7284' : '#888D9B', text3: darkMode ? '#8F96AC' : '#6E727D',
text4: darkMode ? '#565A69' : '#C3C5CB', text4: darkMode ? '#B2B9D2' : '#C3C5CB',
text5: darkMode ? '#2C2F36' : '#EDEEF2', text5: darkMode ? '#2C2F36' : '#EDEEF2',
// backgrounds / greys // backgrounds / greys
...@@ -62,34 +62,33 @@ export function colors(darkMode: boolean): Colors { ...@@ -62,34 +62,33 @@ export function colors(darkMode: boolean): Colors {
advancedBG: darkMode ? 'rgba(0,0,0,0.1)' : 'rgba(255,255,255,0.6)', advancedBG: darkMode ? 'rgba(0,0,0,0.1)' : 'rgba(255,255,255,0.6)',
//primary colors //primary colors
primary1: darkMode ? '#2172E5' : '#ff007a', primary1: darkMode ? '#2172E5' : '#E8006F',
primary2: darkMode ? '#3680E7' : '#FF8CC3', primary2: darkMode ? '#3680E7' : '#FF8CC3',
primary3: darkMode ? '#4D8FEA' : '#FF99C9', primary3: darkMode ? '#4D8FEA' : '#FF99C9',
primary4: darkMode ? '#376bad70' : '#F6DDE8', primary4: darkMode ? '#376bad70' : '#F6DDE8',
primary5: darkMode ? '#153d6f70' : '#FDEAF1', primary5: darkMode ? '#153d6f70' : '#FDEAF1',
// color text // color text
primaryText1: darkMode ? '#6da8ff' : '#ff007a', primaryText1: darkMode ? '#438BF0' : '#D50066',
// secondary colors // secondary colors
secondary1: darkMode ? '#2172E5' : '#ff007a', secondary1: darkMode ? '#2172E5' : '#E8006F',
secondary2: darkMode ? '#17000b26' : '#F6DDE8', secondary2: darkMode ? '#17000b26' : '#F6DDE8',
secondary3: darkMode ? '#17000b26' : '#FDEAF1', secondary3: darkMode ? '#17000b26' : '#FDEAF1',
// other // other
red1: '#FD4040', red1: darkMode ? '#FF4343' : '#DA2D2B',
red2: '#F82D3A', red2: darkMode ? '#F82D3A' : '#DF1F38',
red3: '#D60000', red3: '#D60000',
green1: '#27AE60', green1: darkMode ? '#27AE60' : '#007D35',
yellow1: '#e3a507', yellow1: '#E3A507',
yellow2: '#ff8f00', yellow2: '#FF8F00',
yellow3: '#F3B71E', yellow3: '#F3B71E',
blue1: '#2172E5', blue1: darkMode ? '#2172E5' : '#0068FC',
blue2: '#5199FF', blue2: darkMode ? '#5199FF' : '#0068FC',
error: darkMode ? '#FD4040' : '#DF1F38',
error: '#FD4040', success: darkMode ? '#27AE60' : '#007D35',
success: '#27AE60', warning: '#FF8F00',
warning: '#ff8f00',
// dont wanna forget these blue yet // dont wanna forget these blue yet
// blue4: darkMode ? '#153d6f70' : '#C4D9F8', // blue4: darkMode ? '#153d6f70' : '#C4D9F8',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment