This repository was archived by the owner on Sep 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathdefaultOptions.js
186 lines (185 loc) · 6.6 KB
/
defaultOptions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
const defaultTheme = require('tailwindcss/resolveConfig')(require('tailwindcss/defaultConfig')).theme
module.exports = {
input: {
appearance: 'none',
backgroundColor: defaultTheme.colors.white,
borderColor: defaultTheme.borderColor.default,
borderWidth: defaultTheme.borderWidth.default,
borderRadius: defaultTheme.borderRadius.default,
paddingTop: defaultTheme.spacing[2],
paddingRight: defaultTheme.spacing[3],
paddingBottom: defaultTheme.spacing[2],
paddingLeft: defaultTheme.spacing[3],
fontSize: defaultTheme.fontSize.base,
lineHeight: defaultTheme.lineHeight.normal,
'&::placeholder': {
color: defaultTheme.colors.gray[500],
opacity: '1',
},
'&:focus': {
outline: 'none',
boxShadow: defaultTheme.boxShadow.outline,
borderColor: defaultTheme.colors.blue[400],
},
},
textarea: {
appearance: 'none',
backgroundColor: defaultTheme.colors.white,
borderColor: defaultTheme.borderColor.default,
borderWidth: defaultTheme.borderWidth.default,
borderRadius: defaultTheme.borderRadius.default,
paddingTop: defaultTheme.spacing[2],
paddingRight: defaultTheme.spacing[3],
paddingBottom: defaultTheme.spacing[2],
paddingLeft: defaultTheme.spacing[3],
fontSize: defaultTheme.fontSize.base,
lineHeight: defaultTheme.lineHeight.normal,
'&::placeholder': {
color: defaultTheme.colors.gray[500],
opacity: '1',
},
'&:focus': {
outline: 'none',
boxShadow: defaultTheme.boxShadow.outline,
borderColor: defaultTheme.colors.blue[400],
},
},
multiselect: {
appearance: 'none',
backgroundColor: defaultTheme.colors.white,
borderColor: defaultTheme.borderColor.default,
borderWidth: defaultTheme.borderWidth.default,
borderRadius: defaultTheme.borderRadius.default,
paddingTop: defaultTheme.spacing[2],
paddingRight: defaultTheme.spacing[3],
paddingBottom: defaultTheme.spacing[2],
paddingLeft: defaultTheme.spacing[3],
fontSize: defaultTheme.fontSize.base,
lineHeight: defaultTheme.lineHeight.normal,
'&:focus': {
outline: 'none',
boxShadow: defaultTheme.boxShadow.outline,
borderColor: defaultTheme.colors.blue[400],
},
},
select: {
appearance: 'none',
colorAdjust: 'exact',
'&::-ms-expand': {
border: 'none', // The select padding is causing some whitespace around the chevron which looks weird with a border
'@media not print': {
display: 'none',
},
},
backgroundRepeat: 'no-repeat',
backgroundColor: defaultTheme.colors.white,
borderColor: defaultTheme.borderColor.default,
borderWidth: defaultTheme.borderWidth.default,
borderRadius: defaultTheme.borderRadius.default,
paddingTop: defaultTheme.spacing[2],
paddingRight: defaultTheme.spacing[10],
paddingBottom: defaultTheme.spacing[2],
paddingLeft: defaultTheme.spacing[3],
fontSize: defaultTheme.fontSize.base,
lineHeight: defaultTheme.lineHeight.normal,
backgroundPosition: `right ${defaultTheme.spacing[2]} center`,
backgroundSize: `1.5em 1.5em`,
iconColor: defaultTheme.colors.gray[500],
icon: iconColor => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="${iconColor}"><path d="M15.3 9.3a1 1 0 0 1 1.4 1.4l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 0 1 1.4-1.4l3.3 3.29 3.3-3.3z"/></svg>`,
'&:focus': {
outline: 'none',
boxShadow: defaultTheme.boxShadow.outline,
borderColor: defaultTheme.colors.blue[400],
},
},
checkbox: {
appearance: 'none',
colorAdjust: 'exact',
'&::-ms-check': {
'@media not print': {
color: 'transparent', // Hide the check
background: 'inherit',
borderColor: 'inherit',
borderRadius: 'inherit',
}
},
display: 'inline-block',
verticalAlign: 'middle',
backgroundOrigin: 'border-box',
userSelect: 'none',
flexShrink: 0,
height: '1em',
width: '1em',
color: defaultTheme.colors.blue[500],
backgroundColor: defaultTheme.colors.white,
borderColor: defaultTheme.borderColor.default,
borderWidth: defaultTheme.borderWidth.default,
borderRadius: defaultTheme.borderRadius.default,
iconColor: defaultTheme.colors.white,
icon: iconColor => `<svg viewBox="0 0 16 16" fill="${iconColor}" xmlns="http://www.w3.org/2000/svg"><path d="M5.707 7.293a1 1 0 0 0-1.414 1.414l2 2a1 1 0 0 0 1.414 0l4-4a1 1 0 0 0-1.414-1.414L7 8.586 5.707 7.293z"/></svg>`,
'&:focus': {
outline: 'none',
boxShadow: defaultTheme.boxShadow.outline,
borderColor: defaultTheme.colors.blue[400],
},
'&:checked': {
borderColor: 'transparent',
backgroundColor: 'currentColor',
backgroundSize: '100% 100%',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
},
},
radio: {
appearance: 'none',
colorAdjust: 'exact',
'&::-ms-check': {
'@media not print': {
color: 'transparent', // Hide the check
background: 'inherit',
borderColor: 'inherit',
borderRadius: 'inherit',
}
},
display: 'inline-block',
verticalAlign: 'middle',
backgroundOrigin: 'border-box',
userSelect: 'none',
flexShrink: 0,
borderRadius: '100%',
height: '1em',
width: '1em',
color: defaultTheme.colors.blue[500],
backgroundColor: defaultTheme.colors.white,
borderColor: defaultTheme.borderColor.default,
borderWidth: defaultTheme.borderWidth.default,
iconColor: defaultTheme.colors.white,
icon: iconColor => `<svg viewBox="0 0 16 16" fill="${iconColor}" xmlns="http://www.w3.org/2000/svg"><circle cx="8" cy="8" r="3"/></svg>`,
'&:focus': {
outline: 'none',
boxShadow: defaultTheme.boxShadow.outline,
borderColor: defaultTheme.colors.blue[400],
},
'&:checked': {
borderColor: 'transparent',
backgroundColor: 'currentColor',
backgroundSize: '100% 100%',
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
}
},
range: {
thumbSize: "1.25rem",
focusColor: defaultTheme.colors.blue[400],
thumbBorderColor: defaultTheme.colors.gray[500],
thumbBackgroundColor: defaultTheme.colors.white,
trackBorderColor: defaultTheme.colors.gray[300],
trackBackgroundColor: defaultTheme.colors.gray[100],
disabledThumbBorderColor: defaultTheme.colors.gray[300],
disabledThumbBackgroundColor: defaultTheme.colors.white,
disabledTrackBorderColor: defaultTheme.colors.gray[200],
disabledTrackBackgroundColor: defaultTheme.colors.gray[100],
activeThumbBorderColor: defaultTheme.colors.gray[600],
activeThumbBackgroundColor: defaultTheme.colors.gray[300],
}
}