748286b5 |
1 | ///\r |
2 | /// Forty by HTML5 UP\r |
3 | /// html5up.net | @ajlkn\r |
4 | /// Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)\r |
5 | ///\r |
6 | \r |
7 | /* Form */\r |
8 | \r |
9 | form {\r |
10 | margin: 0 0 _size(element-margin) 0;\r |
11 | \r |
12 | > :last-child {\r |
13 | margin-bottom: 0;\r |
14 | }\r |
15 | \r |
16 | > .fields {\r |
17 | $gutter: (_size(element-margin) * 0.75);\r |
18 | \r |
19 | @include vendor('display', 'flex');\r |
20 | @include vendor('flex-wrap', 'wrap');\r |
21 | width: calc(100% + #{$gutter * 2});\r |
22 | margin: ($gutter * -1) 0 _size(element-margin) ($gutter * -1);\r |
23 | \r |
24 | > .field {\r |
25 | @include vendor('flex-grow', '0');\r |
26 | @include vendor('flex-shrink', '0');\r |
27 | padding: $gutter 0 0 $gutter;\r |
28 | width: calc(100% - #{$gutter * 1});\r |
29 | \r |
30 | &.half {\r |
31 | width: calc(50% - #{$gutter * 0.5});\r |
32 | }\r |
33 | \r |
34 | &.third {\r |
35 | width: calc(#{100% / 3} - #{$gutter * (1 / 3)});\r |
36 | }\r |
37 | \r |
38 | &.quarter {\r |
39 | width: calc(25% - #{$gutter * 0.25});\r |
40 | }\r |
41 | }\r |
42 | }\r |
43 | \r |
44 | @include breakpoint('<=xsmall') {\r |
45 | > .fields {\r |
46 | $gutter: (_size(element-margin) * 0.75);\r |
47 | \r |
48 | width: calc(100% + #{$gutter * 2});\r |
49 | margin: ($gutter * -1) 0 _size(element-margin) ($gutter * -1);\r |
50 | \r |
51 | > .field {\r |
52 | padding: $gutter 0 0 $gutter;\r |
53 | width: calc(100% - #{$gutter * 1});\r |
54 | \r |
55 | &.half {\r |
56 | width: calc(100% - #{$gutter * 1});\r |
57 | }\r |
58 | \r |
59 | &.third {\r |
60 | width: calc(100% - #{$gutter * 1});\r |
61 | }\r |
62 | \r |
63 | &.quarter {\r |
64 | width: calc(100% - #{$gutter * 1});\r |
65 | }\r |
66 | }\r |
67 | }\r |
68 | }\r |
69 | }\r |
70 | \r |
71 | label {\r |
cb4379e1 |
72 | color: _palette_light(fg-bold);\r |
748286b5 |
73 | display: block;\r |
74 | font-size: 0.8em;\r |
75 | font-weight: _font(weight-bold);\r |
76 | letter-spacing: _font(letter-spacing-alt);\r |
77 | margin: 0 0 (_size(element-margin) * 0.5) 0;\r |
78 | text-transform: uppercase;\r |
3690e1d4 |
79 | @media screen and (prefers-color-scheme: dark) {\r |
80 | color: _palette_dark(fg-bold);\r |
81 | }\r |
748286b5 |
82 | }\r |
83 | \r |
84 | input[type="text"],\r |
85 | input[type="password"],\r |
86 | input[type="email"],\r |
87 | input[type="tel"],\r |
88 | input[type="search"],\r |
89 | input[type="url"],\r |
90 | select,\r |
91 | textarea {\r |
92 | @include vendor('appearance', 'none');\r |
cb4379e1 |
93 | background: _palette_light(border-bg);\r |
ca753082 |
94 | border: 1px solid _palette_light(fg-light);\r |
748286b5 |
95 | border-radius: 0;\r |
96 | color: inherit;\r |
97 | display: block;\r |
98 | outline: 0;\r |
99 | padding: 0 1em;\r |
100 | text-decoration: none;\r |
101 | width: 100%;\r |
3690e1d4 |
102 | @media screen and (prefers-color-scheme: dark) {\r |
ca753082 |
103 | background: _palette_dark(border);\r |
104 | border: 1px solid _palette_dark(fg-light);\r |
3690e1d4 |
105 | }\r |
748286b5 |
106 | \r |
107 | &:invalid {\r |
108 | box-shadow: none;\r |
109 | }\r |
110 | \r |
111 | &:focus {\r |
cb4379e1 |
112 | border-color: _palette_light(highlight);\r |
ca753082 |
113 | box-shadow: inset 0 0 0 2px _palette_light(highlight);\r |
3690e1d4 |
114 | @media screen and (prefers-color-scheme: dark) {\r |
115 | border-color: _palette_dark(highlight);\r |
ca753082 |
116 | box-shadow: inset 0 0 0 2px _palette_dark(highlight);\r |
3690e1d4 |
117 | }\r |
748286b5 |
118 | }\r |
119 | }\r |
120 | \r |
121 | select {\r |
cb4379e1 |
122 | background-image: svg-url("<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' preserveAspectRatio='none' viewBox='0 0 40 40'><path d='M9.4,12.3l10.4,10.4l10.4-10.4c0.2-0.2,0.5-0.4,0.9-0.4c0.3,0,0.6,0.1,0.9,0.4l3.3,3.3c0.2,0.2,0.4,0.5,0.4,0.9 c0,0.4-0.1,0.6-0.4,0.9L20.7,31.9c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4L4.3,17.3c-0.2-0.2-0.4-0.5-0.4-0.9 c0-0.4,0.1-0.6,0.4-0.9l3.3-3.3c0.2-0.2,0.5-0.4,0.9-0.4S9.1,12.1,9.4,12.3z' fill='#{_palette_light(border)}' /></svg>");\r |
748286b5 |
123 | background-size: 1.25rem;\r |
124 | background-repeat: no-repeat;\r |
125 | background-position: calc(100% - 1rem) center;\r |
126 | height: _size(element-height);\r |
127 | padding-right: _size(element-height);\r |
128 | text-overflow: ellipsis;\r |
3690e1d4 |
129 | @media screen and (prefers-color-scheme: dark) {\r |
130 | background-image: svg-url("<svg xmlns='http://www.w3.org/2000/svg' width='40' height='40' preserveAspectRatio='none' viewBox='0 0 40 40'><path d='M9.4,12.3l10.4,10.4l10.4-10.4c0.2-0.2,0.5-0.4,0.9-0.4c0.3,0,0.6,0.1,0.9,0.4l3.3,3.3c0.2,0.2,0.4,0.5,0.4,0.9 c0,0.4-0.1,0.6-0.4,0.9L20.7,31.9c-0.2,0.2-0.5,0.4-0.9,0.4c-0.3,0-0.6-0.1-0.9-0.4L4.3,17.3c-0.2-0.2-0.4-0.5-0.4-0.9 c0-0.4,0.1-0.6,0.4-0.9l3.3-3.3c0.2-0.2,0.5-0.4,0.9-0.4S9.1,12.1,9.4,12.3z' fill='#{_palette_dark(border)}' /></svg>");\r |
131 | }\r |
748286b5 |
132 | \r |
133 | option {\r |
cb4379e1 |
134 | color: _palette_light(fg-bold);\r |
135 | background: _palette_light(bg);\r |
3690e1d4 |
136 | @media screen and (prefers-color-scheme: dark) {\r |
137 | color: _palette_dark(fg-bold);\r |
138 | background: _palette_dark(bg);\r |
139 | }\r |
748286b5 |
140 | }\r |
141 | \r |
142 | &:focus {\r |
143 | &::-ms-value {\r |
144 | background-color: transparent;\r |
145 | }\r |
146 | }\r |
147 | \r |
148 | &::-ms-expand {\r |
149 | display: none;\r |
150 | }\r |
151 | }\r |
152 | \r |
153 | input[type="text"],\r |
154 | input[type="password"],\r |
155 | input[type="email"],\r |
156 | input[type="tel"],\r |
157 | input[type="search"],\r |
158 | input[type="url"],\r |
159 | select {\r |
160 | height: _size(element-height);\r |
161 | }\r |
162 | \r |
163 | textarea {\r |
164 | padding: 0.75em 1em;\r |
165 | }\r |
166 | \r |
167 | input[type="checkbox"],\r |
168 | input[type="radio"], {\r |
169 | @include vendor('appearance', 'none');\r |
170 | display: block;\r |
171 | float: left;\r |
172 | margin-right: -2em;\r |
173 | opacity: 0;\r |
174 | width: 1em;\r |
175 | z-index: -1;\r |
176 | \r |
177 | & + label {\r |
178 | @include icon(false, solid);\r |
cb4379e1 |
179 | color: _palette_light(fg);\r |
748286b5 |
180 | cursor: pointer;\r |
181 | display: inline-block;\r |
182 | font-weight: _font(weight);\r |
183 | padding-left: (_size(element-height) * 0.6) + 1em;\r |
184 | padding-right: 0.75em;\r |
185 | position: relative;\r |
3690e1d4 |
186 | @media screen and (prefers-color-scheme: dark) {\r |
187 | color: _palette_dark(fg);\r |
188 | }\r |
748286b5 |
189 | \r |
190 | &:before {\r |
cb4379e1 |
191 | background: _palette_light(border-bg);\r |
748286b5 |
192 | content: '';\r |
193 | display: inline-block;\r |
194 | font-size: 0.8em;\r |
195 | height: (_size(element-height) * 0.75);\r |
196 | left: 0;\r |
197 | letter-spacing: 0;\r |
198 | line-height: (_size(element-height) * 0.75);\r |
199 | position: absolute;\r |
200 | text-align: center;\r |
201 | top: 0;\r |
202 | width: (_size(element-height) * 0.75);\r |
3690e1d4 |
203 | @media screen and (prefers-color-scheme: dark) {\r |
204 | background: _palette_dark(border-bg);\r |
205 | }\r |
748286b5 |
206 | }\r |
207 | }\r |
208 | \r |
209 | &:checked + label {\r |
210 | &:before {\r |
cb4379e1 |
211 | background: _palette_light(fg-bold);\r |
212 | border-color: _palette_light(highlight);\r |
748286b5 |
213 | content: '\f00c';\r |
cb4379e1 |
214 | color: _palette_light(bg);\r |
3690e1d4 |
215 | @media screen and (prefers-color-scheme: dark) {\r |
216 | background: _palette_dark(fg-bold);\r |
217 | border-color: _palette_dark(highlight);\r |
218 | color: _palette_dark(bg);\r |
219 | }\r |
748286b5 |
220 | }\r |
221 | }\r |
222 | \r |
223 | &:focus + label {\r |
224 | &:before {\r |
ca753082 |
225 | box-shadow: inset 0 0 0 2px _palette_light(highlight);\r |
3690e1d4 |
226 | @media screen and (prefers-color-scheme: dark) {\r |
ca753082 |
227 | box-shadow: inset 0 0 0 2px _palette_dark(highlight);\r |
3690e1d4 |
228 | }\r |
748286b5 |
229 | }\r |
230 | }\r |
231 | }\r |
232 | \r |
233 | input[type="checkbox"] {\r |
234 | & + label {\r |
235 | &:before {\r |
236 | }\r |
237 | }\r |
238 | }\r |
239 | \r |
240 | input[type="radio"] {\r |
241 | & + label {\r |
242 | &:before {\r |
243 | border-radius: 100%;\r |
244 | }\r |
245 | }\r |
246 | }\r |
247 | \r |
248 | ::-webkit-input-placeholder {\r |
cb4379e1 |
249 | color: _palette_light(fg-light) !important;\r |
748286b5 |
250 | opacity: 1.0;\r |
3690e1d4 |
251 | @media screen and (prefers-color-scheme: dark) {\r |
252 | color: _palette_dark(fg-light) !important;\r |
253 | }\r |
748286b5 |
254 | }\r |
255 | \r |
256 | :-moz-placeholder {\r |
cb4379e1 |
257 | color: _palette_light(fg-light) !important;\r |
748286b5 |
258 | opacity: 1.0;\r |
3690e1d4 |
259 | @media screen and (prefers-color-scheme: dark) {\r |
260 | color: _palette_dark(fg-light) !important;\r |
261 | }\r |
748286b5 |
262 | }\r |
263 | \r |
264 | ::-moz-placeholder {\r |
cb4379e1 |
265 | color: _palette_light(fg-light) !important;\r |
748286b5 |
266 | opacity: 1.0;\r |
3690e1d4 |
267 | @media screen and (prefers-color-scheme: dark) {\r |
268 | color: _palette_dark(fg-light) !important;\r |
269 | }\r |
748286b5 |
270 | }\r |
271 | \r |
272 | :-ms-input-placeholder {\r |
cb4379e1 |
273 | color: _palette_light(fg-light) !important;\r |
748286b5 |
274 | opacity: 1.0;\r |
3690e1d4 |
275 | @media screen and (prefers-color-scheme: dark) {\r |
276 | color: _palette_dark(fg-light) !important;\r |
277 | }\r |
748286b5 |
278 | } |