1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | $input-color: $black !default;
|
12 |
|
13 |
|
14 |
|
15 | $input-placeholder-color: $medium-gray !default;
|
16 |
|
17 |
|
18 |
|
19 | $input-font-family: inherit !default;
|
20 |
|
21 |
|
22 |
|
23 | $input-font-size: rem-calc(16) !default;
|
24 |
|
25 |
|
26 |
|
27 | $input-font-weight: $global-weight-normal !default;
|
28 |
|
29 |
|
30 |
|
31 | $input-line-height: $global-lineheight !default;
|
32 |
|
33 |
|
34 |
|
35 | $input-background: $white !default;
|
36 |
|
37 |
|
38 |
|
39 | $input-background-focus: $white !default;
|
40 |
|
41 |
|
42 |
|
43 | $input-background-disabled: $light-gray !default;
|
44 |
|
45 |
|
46 |
|
47 | $input-border: 1px solid $medium-gray !default;
|
48 |
|
49 |
|
50 |
|
51 | $input-border-focus: 1px solid $dark-gray !default;
|
52 |
|
53 |
|
54 |
|
55 | $input-padding: $form-spacing / 2 !default;
|
56 |
|
57 |
|
58 |
|
59 | $input-shadow: inset 0 1px 2px rgba($black, 0.1) !default;
|
60 |
|
61 |
|
62 |
|
63 | $input-shadow-focus: 0 0 5px $medium-gray !default;
|
64 |
|
65 |
|
66 |
|
67 | $input-cursor-disabled: not-allowed !default;
|
68 |
|
69 |
|
70 |
|
71 | $input-transition: box-shadow 0.5s, border-color 0.25s ease-in-out !default;
|
72 |
|
73 |
|
74 |
|
75 | $input-number-spinners: true !default;
|
76 |
|
77 |
|
78 |
|
79 | $input-radius: $global-radius !default;
|
80 |
|
81 |
|
82 |
|
83 | $form-button-radius: $global-radius !default;
|
84 |
|
85 | @mixin form-element {
|
86 | $height: ($input-font-size * unitless-calc($input-line-height)) + (get-side($input-padding, 'top') + get-side($input-padding, 'bottom')) - rem-calc(1);
|
87 |
|
88 | display: block;
|
89 | box-sizing: border-box;
|
90 | width: 100%;
|
91 | height: $height;
|
92 | margin: 0 0 $form-spacing;
|
93 | padding: $input-padding;
|
94 |
|
95 | border: $input-border;
|
96 | border-radius: $input-radius;
|
97 | background-color: $input-background;
|
98 | box-shadow: $input-shadow;
|
99 |
|
100 | font-family: $input-font-family;
|
101 | font-size: $input-font-size;
|
102 | font-weight: $input-font-weight;
|
103 | line-height: $input-line-height;
|
104 | color: $input-color;
|
105 |
|
106 | @if has-value($input-transition) {
|
107 | transition: $input-transition;
|
108 | }
|
109 |
|
110 |
|
111 | &:focus {
|
112 | outline: none;
|
113 | border: $input-border-focus;
|
114 | background-color: $input-background-focus;
|
115 | box-shadow: $input-shadow-focus;
|
116 |
|
117 | @if has-value($input-transition) {
|
118 | transition: $input-transition;
|
119 | }
|
120 | }
|
121 | }
|
122 |
|
123 | @mixin foundation-form-text {
|
124 |
|
125 | #{text-inputs()},
|
126 | textarea {
|
127 | @include form-element;
|
128 | appearance: none;
|
129 | }
|
130 |
|
131 |
|
132 | textarea {
|
133 | max-width: 100%;
|
134 |
|
135 | &[rows] {
|
136 | height: auto;
|
137 | }
|
138 | }
|
139 |
|
140 | input,
|
141 | textarea {
|
142 |
|
143 | &::placeholder {
|
144 | color: $input-placeholder-color;
|
145 | }
|
146 |
|
147 |
|
148 | &:disabled,
|
149 | &[readonly] {
|
150 | background-color: $input-background-disabled;
|
151 | cursor: $input-cursor-disabled;
|
152 | }
|
153 | }
|
154 |
|
155 |
|
156 | [type='submit'],
|
157 | [type='button'] {
|
158 | appearance: none;
|
159 | border-radius: $form-button-radius;
|
160 | }
|
161 |
|
162 |
|
163 | input[type='search'] {
|
164 | box-sizing: border-box;
|
165 | }
|
166 |
|
167 |
|
168 | [type='number'] {
|
169 | @if not $input-number-spinners {
|
170 | -moz-appearance: textfield;
|
171 |
|
172 | &::-webkit-inner-spin-button,
|
173 | &::-webkit-outer-spin-button {
|
174 | -webkit-appearance: none;
|
175 | margin: 0;
|
176 | }
|
177 | }
|
178 | }
|
179 | }
|