UNPKG

1.81 kBJavaScriptView Raw
1import styled from 'styled-components';
2
3const TextAreaStyled = styled.div`
4 textarea {
5 resize: vertical;
6 appearance: none;
7 background-color: ${props => props.theme.bahFormInputBackgroundColor};
8 border: 2px solid ${props => props.theme.bahFormInputBorderColor};
9 border-radius: ${props => props.theme.bahFormFieldsDefaultBorder};
10 color: inherit;
11 font-size: ${props => props.textSize};
12 height: ${props => props.theme.bahFormInputDefaultHeight};
13 padding: ${props => props.theme.bahFormInputDefaultPadding};
14 vertical-align: middle;
15 box-shadow: inset 0 2px 3px ${props => props.theme.bahFormInputBoxShadowColor};
16 width: 100%;
17 margin-bottom: ${props => props.theme.bahFormFieldsDefaultMarginBottom};
18
19 &:disabled {
20 background-color: ${props => props.theme.bahFormInputDisabledColor};
21 }
22
23 &:focus {
24 box-shadow: inset 0 2px 3px ${props => props.theme.bahFormInputFocusShadowColor};
25 border-color: ${props => props.theme.bahFormInputFocusBorderColor};
26 outline: 0;
27 }
28
29 ${props =>
30 props.isValid &&
31 `
32 box-shadow:inset 0 2px 3px ${props.theme.bahColors.green100};
33 border-color: ${props.theme.bahColors.green300};
34 outline: 0;
35 &:focus {
36 box-shadow:inset 0 2px 3px ${props.theme.bahColors.green200};
37 border-color: ${props.theme.bahColors.green400};
38 outline: 0;
39 }
40 `} ${props =>
41 props.isInvalid &&
42 `
43 box-shadow:inset 0 2px 3px ${props.theme.bahColors.red100};
44 border-color: ${props.theme.bahColors.red300};
45 outline: 0;
46 &:focus {
47 box-shadow:inset 0 2px 3px ${props.theme.bahColors.red200};
48 border-color: ${props.theme.bahColors.red400};
49 outline: 0;
50 }
51 `};
52 }
53`;
54
55export default TextAreaStyled;