diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-01-03 16:46:47 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-01-03 16:46:47 +0100 |
commit | 3fa0b0439c7dc49ffb2c4aff89e5a0f96aacf5e2 (patch) | |
tree | 450b9e21d0bfac2cdde28995a04a3643b3ea2a37 /packages/forms/src/input/styles.ts | |
parent | Add theme (diff) | |
download | ferdium-app-3fa0b0439c7dc49ffb2c4aff89e5a0f96aacf5e2.tar.gz ferdium-app-3fa0b0439c7dc49ffb2c4aff89e5a0f96aacf5e2.tar.zst ferdium-app-3fa0b0439c7dc49ffb2c4aff89e5a0f96aacf5e2.zip |
Add forms
Diffstat (limited to 'packages/forms/src/input/styles.ts')
-rw-r--r-- | packages/forms/src/input/styles.ts | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/packages/forms/src/input/styles.ts b/packages/forms/src/input/styles.ts new file mode 100644 index 000000000..46c0ef701 --- /dev/null +++ b/packages/forms/src/input/styles.ts | |||
@@ -0,0 +1,98 @@ | |||
1 | import * as CSS from 'csstype'; | ||
2 | import { Theme } from '../../../theme/lib'; | ||
3 | |||
4 | const prefixStyles = (theme: Theme) => ({ | ||
5 | background: theme.inputPrefixBackground, | ||
6 | color: theme.inputPrefixColor, | ||
7 | lineHeight: theme.inputHeight, | ||
8 | padding: '0 10px', | ||
9 | }); | ||
10 | |||
11 | export default (theme: Theme) => ({ | ||
12 | container: { | ||
13 | // display: 'flex', | ||
14 | }, | ||
15 | disabled: { | ||
16 | opacity: theme.inputDisabledOpacity, | ||
17 | }, | ||
18 | formModifier: { | ||
19 | background: 'none', | ||
20 | border: 0, | ||
21 | borderLeft: theme.inputBorder, | ||
22 | padding: '4px 20px 0', | ||
23 | outline: 'none', | ||
24 | |||
25 | '&:active': { | ||
26 | opacity: 0.5, | ||
27 | }, | ||
28 | |||
29 | '& svg': { | ||
30 | fill: theme.inputModifierColor, | ||
31 | }, | ||
32 | }, | ||
33 | input: { | ||
34 | background: 'none', | ||
35 | border: 0, | ||
36 | fontSize: theme.inputFontSize, | ||
37 | outline: 'none', | ||
38 | padding: 8, | ||
39 | width: '100%', | ||
40 | color: theme.inputColor, | ||
41 | |||
42 | '&::placeholder': { | ||
43 | color: theme.inputPlaceholderColor, | ||
44 | }, | ||
45 | }, | ||
46 | passwordScore: { | ||
47 | background: theme.inputScorePasswordBackground, | ||
48 | border: theme.inputBorder, | ||
49 | borderTopWidth: 0, | ||
50 | borderBottomLeftRadius: theme.borderRadiusSmall, | ||
51 | borderBottomRightRadius: theme.borderRadiusSmall, | ||
52 | display: 'block', | ||
53 | flexBasis: '100%', | ||
54 | height: 5, | ||
55 | overflow: 'hidden', | ||
56 | |||
57 | '& meter': { | ||
58 | display: 'block', | ||
59 | height: '100%', | ||
60 | width: '100%', | ||
61 | |||
62 | '&::-webkit-meter-bar': { | ||
63 | background: 'none', | ||
64 | }, | ||
65 | |||
66 | '&::-webkit-meter-even-less-good-value': { | ||
67 | background: theme.brandDanger, | ||
68 | }, | ||
69 | |||
70 | '&::-webkit-meter-suboptimum-value': { | ||
71 | background: theme.brandWarning, | ||
72 | }, | ||
73 | |||
74 | '&::-webkit-meter-optimum-value': { | ||
75 | background: theme.brandSuccess, | ||
76 | }, | ||
77 | }, | ||
78 | }, | ||
79 | prefix: prefixStyles(theme), | ||
80 | suffix: prefixStyles(theme), | ||
81 | wrapper: { | ||
82 | background: theme.inputBackground, | ||
83 | border: theme.inputBorder, | ||
84 | borderRadius: theme.borderRadiusSmall, | ||
85 | boxSizing: 'border-box' as CSS.BoxSizingProperty, | ||
86 | display: 'flex', | ||
87 | height: theme.inputHeight, | ||
88 | order: 1, | ||
89 | width: '100%', | ||
90 | }, | ||
91 | hasPasswordScore: { | ||
92 | borderBottomLeftRadius: 0, | ||
93 | borderBottomRightRadius: 0, | ||
94 | }, | ||
95 | hasError: { | ||
96 | borderColor: theme.brandDanger, | ||
97 | }, | ||
98 | }); | ||