forked from ConciseCSS/concise.css
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_forms.scss
More file actions
189 lines (160 loc) · 3.42 KB
/
_forms.scss
File metadata and controls
189 lines (160 loc) · 3.42 KB
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
187
188
189
//
// Forms
// =============================================================================
input:not([type="submit"]),
select,
textarea {
border: 1px solid getColor(base, lines);
border-radius: 3px;
height: 1.5lh;
padding: 0 .75em;
transition: $transition-duration;
width: 100%;
font-size: typeScale(1);
&:focus {
border-color: getColor(blue, lighter);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075),
0 0 6px rgba(getColor(blue, base), .5);
outline: none;
}
&[disabled] {
background-color: getColor(background, light);
cursor: not-allowed;
}
label + & {
margin-top: 0.25lh;
}
}
input:not([type="submit"]) {
line-height: normal;
min-height: 1lh;
// Remove focus styles
&[type="checkbox"],
&[type="radio"],
&[type="range"],
&[type="file"],
&[type="color"],
&[type="submit"] {
&:focus {
border-color: transparent;
box-shadow: none;
outline: none;
}
}
}
input[type="submit"] {
@extend button;
}
label {
display: block;
font-size: typeScale(1);
}
fieldset {
border: 1px solid getColor(base, lines);
border-radius: 3px;
padding: 1lh 1em;
margin-bottom: 1lh;
}
legend {
font-weight: bold;
padding: 0 1em;
}
// Keep the original size for this small inputs
input[type="checkbox"],
input[type="file"],
input[type="image"],
input[type="radio"] {
height: auto;
width: auto;
}
// Checkbox & radio
input[type="checkbox"],
input[type="radio"] {
line-height: normal;
padding: 0;
vertical-align: middle;
margin-top: 0 !important;
}
// Checkbox & radio elements are inline with their label
input[type="checkbox"] + label,
input[type="radio"] + label {
display: inline-block;
margin: 0 0 0 .5em;
line-height: 1.25lh;
vertical-align: middle;
}
// File upload
input[type="file"] {
border: none;
line-height: 100%;
padding: 0;
}
// Textarea
textarea {
height: auto;
padding: 0.25lh 0.5em;
resize: vertical;
}
// Style select like a standard input - Internet Explorer 11+
select {
background-color: transparent;
border-radius: 5px;
padding: 0 0 0 0.5em;
&[disabled] { color: getColor(text, secondary); }
&[multiple] { height: auto; }
&::-ms-expand { display: none; }
&::-ms-value { color: currentColor; }
option { padding: 0 .75em }
}
// Range input
input[type="range"] {
border: none;
padding: 0;
width: 100%;
-webkit-appearance: none;
&:focus { outline: none; }
&::-webkit-slider-runnable-track {
background-color: darken(getColor(background, light), 10%);
border: none;
border-radius: 3px;
height: 5px;
}
&::-webkit-slider-thumb {
border: none;
border-radius: 50%;
background-color: getColor(base, primary);
height: 16px;
margin-top: -5px;
width: 16px;
-webkit-appearance: none;
}
&::-moz-range-track {
background-color: darken(getColor(background, light), 10%);
border: none;
border-radius: 3px;
height: 5px;
}
&::-moz-range-thumb {
border: none;
border-radius: 50%;
background-color: getColor(base, primary);
height: 16px;
margin-top: -5px;
width: 16px;
}
&::-ms-track {
background-color: darken(getColor(background, light), 10%);
border: none;
border-radius: 3px;
color: transparent;
height: 5px;
}
&::-ms-thumb {
border: none;
border-radius: 50%;
background-color: getColor(base, primary);
height: 16px;
margin-top: -5px;
width: 16px;
}
}