1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-28 03:08:30 +00:00

set border color when focused for input, button, textarea, select

This commit is contained in:
slowbackspace 2019-01-18 14:50:26 +01:00
parent 449e97f377
commit 8edb6b66b8
4 changed files with 18 additions and 3 deletions

View File

@ -37,6 +37,10 @@ const Wrapper = styled.button`
background: ${colors.GREEN_TERTIARY}; background: ${colors.GREEN_TERTIARY};
} }
&:focus {
border-color: ${colors.INPUT_BORDER_FOCUSED};
}
${props => props.isDisabled && css` ${props => props.isDisabled && css`
pointer-events: none; pointer-events: none;
color: ${colors.TEXT_SECONDARY}; color: ${colors.TEXT_SECONDARY};
@ -48,6 +52,10 @@ const Wrapper = styled.button`
color: ${colors.TEXT_SECONDARY}; color: ${colors.TEXT_SECONDARY};
border: 1px solid ${colors.DIVIDER}; border: 1px solid ${colors.DIVIDER};
&:focus {
border-color: ${colors.INPUT_BORDER_FOCUSED};
}
&:hover { &:hover {
color: ${colors.TEXT_PRIMARY}; color: ${colors.TEXT_PRIMARY};
background: ${colors.DIVIDER}; background: ${colors.DIVIDER};

View File

@ -11,17 +11,16 @@ const styles = isSearchable => ({
width: '100%', width: '100%',
color: colors.TEXT_SECONDARY, color: colors.TEXT_SECONDARY,
}), }),
control: (base, { isDisabled }) => ({ control: (base, { isDisabled, isFocused }) => ({
...base, ...base,
minHeight: 'initial', minHeight: 'initial',
height: '40px', height: '40px',
borderRadius: '2px', borderRadius: '2px',
borderColor: colors.DIVIDER, borderColor: isFocused ? colors.INPUT_BORDER_FOCUSED : colors.DIVIDER,
boxShadow: 'none', boxShadow: 'none',
background: isDisabled ? colors.LANDING : colors.WHITE, background: isDisabled ? colors.LANDING : colors.WHITE,
'&:hover': { '&:hover': {
cursor: isSearchable ? 'text' : 'pointer', cursor: isSearchable ? 'text' : 'pointer',
borderColor: colors.DIVIDER,
}, },
}), }),
indicatorSeparator: () => ({ indicatorSeparator: () => ({

View File

@ -67,6 +67,10 @@ const StyledTextarea = styled(Textarea)`
color: ${colors.TEXT_SECONDARY}; color: ${colors.TEXT_SECONDARY};
} }
&:focus {
border-color: ${colors.INPUT_BORDER_FOCUSED};
}
&:disabled { &:disabled {
pointer-events: none; pointer-events: none;
background: ${colors.GRAY_LIGHT}; background: ${colors.GRAY_LIGHT};

View File

@ -59,6 +59,10 @@ const StyledInput = styled.input`
background-color: ${colors.WHITE}; background-color: ${colors.WHITE};
transition: ${TRANSITION.HOVER}; transition: ${TRANSITION.HOVER};
&:focus {
border-color: ${colors.INPUT_BORDER_FOCUSED};
}
&:disabled { &:disabled {
pointer-events: none; pointer-events: none;
background: ${colors.GRAY_LIGHT}; background: ${colors.GRAY_LIGHT};