blob: 6699d447c44f703db46cc22d33f65ad48bdf49fb [file] [log] [blame]
Yoshie Muranaka4148f2e2020-01-29 13:21:12 -08001.label,
Dixsie Wolmersc652ed12019-07-19 13:03:28 -05002label,
3legend {
Michael Daviscb8bb192017-02-09 15:45:13 -06004 margin: 0;
Yoshie Muranakafa562732019-07-17 11:23:15 -05005 color: $text-02;
6 text-transform: uppercase;
7 font-weight: 700;
8 font-size: 0.75em;
9 margin-bottom: 0;
10 line-height: 2.2;
Michael Daviscb8bb192017-02-09 15:45:13 -060011 .error {
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050012 font-size: 0.9em;
Michael Daviscb8bb192017-02-09 15:45:13 -060013 }
14}
15
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050016// TODO: Start replacing use of label__helper-text
17.label__helper-text,
18.form__helper-text {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050019 color: $text-02;
Yoshie Muranakae4194ce2019-05-24 14:33:56 -050020 line-height: 1.2;
21 font-size: 0.9em;
22 margin-bottom: 0.4em;
23}
24
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050025input[type="email"],
26input[type="number"],
27input[type="password"],
28input[type="search"],
29input[type="tel"],
30input[type="url"],
31input[type="text"],
32input[type="date"],
33input[type="time"],
Michael Daviscb8bb192017-02-09 15:45:13 -060034textarea {
35 border-radius: 0px;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050036 border: 1px solid $border-color-02;
beccabroeka09cc2d2019-01-23 14:26:55 -060037 margin: 0;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050038 background: $primary-light;
Michael Davise15a9562017-03-03 14:30:24 -060039 box-shadow: 0 0 0;
40 transition: none !important;
Yoshie Muranaka5bd1dec2019-05-16 13:06:32 -050041 max-height: 2.1em;
Michael Daviscb8bb192017-02-09 15:45:13 -060042 &:focus {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050043 border-color: $border-color-01;
44 box-shadow: 0 -3px $primary-accent inset;
Michael Daviscb8bb192017-02-09 15:45:13 -060045 }
Michael Davis51946552017-05-01 10:30:38 -050046 &:disabled,
47 .disabled {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050048 background: $background-03;
49 border: 1px solid $border-color-02;
Michael Daviscb8bb192017-02-09 15:45:13 -060050 }
51 &.input__error {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050052 box-shadow: 0 -5px $status-error inset;
53 color: $status-error;
Michael Davis51946552017-05-01 10:30:38 -050054 &:focus {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050055 box-shadow: 0 -5px $primary-accent inset;
Michael Davis51946552017-05-01 10:30:38 -050056 }
Michael Daviscb8bb192017-02-09 15:45:13 -060057 }
58}
59
beccabroeka09cc2d2019-01-23 14:26:55 -060060//input validation
61.ng-invalid.ng-touched {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050062 box-shadow: 0 -3px $status-error inset;
beccabroeka09cc2d2019-01-23 14:26:55 -060063 &:focus {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050064 border-color: $border-color-01;
65 box-shadow: 0 -3px $status-error inset;
beccabroeka09cc2d2019-01-23 14:26:55 -060066 }
67}
68.submitted .ng-invalid {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050069 box-shadow: 0 -3px $status-error inset;
beccabroeka09cc2d2019-01-23 14:26:55 -060070 &:focus {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050071 border-color: $border-color-01;
72 box-shadow: 0 -3px $status-error inset;
beccabroeka09cc2d2019-01-23 14:26:55 -060073 }
74}
75
76.form-error {
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050077 margin-bottom: 0.7em;
beccabroeka09cc2d2019-01-23 14:26:55 -060078 font-size: 0.8rem;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050079 color: $status-error;
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050080 height: 1rem;
beccabroeka09cc2d2019-01-23 14:26:55 -060081 display: block;
82 visibility: hidden;
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050083 // TODO: Create state rulesets rather than relying on one off solutions
beccabroeka09cc2d2019-01-23 14:26:55 -060084 .visible {
85 visibility: visible;
86 }
87}
Michael Davis4ac71d42017-06-19 14:47:50 -050088//Foundation overwrite
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050089[type="color"],
90[type="date"],
91[type="datetime-local"],
92[type="datetime"],
93[type="email"],
94[type="month"],
95[type="number"],
96[type="password"],
97[type="search"],
98[type="tel"],
99[type="text"],
100[type="time"],
101[type="url"],
102[type="week"],
103textarea {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500104 border-color: $border-color-02;
Michael Davis4ac71d42017-06-19 14:47:50 -0500105}
106
Michael Davis51946552017-05-01 10:30:38 -0500107input[readonly],
Dixsie Wolmersc652ed12019-07-19 13:03:28 -0500108input[readonly]:focus {
Michael Davis51946552017-05-01 10:30:38 -0500109 box-shadow: 0 0 0;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500110 background: $background-03;
111 border: 1px solid $border-color-02;
Michael Davis51946552017-05-01 10:30:38 -0500112}
113
Dixsie Wolmersc652ed12019-07-19 13:03:28 -0500114textarea {
115 padding: 0.2em;
116 height: auto;
117}
118
119input[type="submit"],
120.submit {
Michael Daviscb8bb192017-02-09 15:45:13 -0600121 margin: 1em 0;
122 width: 100%;
123}
124
Dixsie Wolmersc652ed12019-07-19 13:03:28 -0500125// Custom select
126select {
Michael Daviscb8bb192017-02-09 15:45:13 -0600127 border-radius: 0px;
Yoshie Muranakade382082019-04-30 13:56:10 -0500128 height: auto;
129 padding-right: 0.5rem; //override inherited Foundation style
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500130 border-color: $border-color-02;
Michael Daviscb8bb192017-02-09 15:45:13 -0600131 @include fastTransition-all;
132 @include bgImage__arrowDown-primary;
133 &:focus {
Michael Daviscb8bb192017-02-09 15:45:13 -0600134 box-shadow: 0 0 0;
135 }
Yoshie Muranakade382082019-04-30 13:56:10 -0500136 &[disabled] {
137 @include bgImage__arrowDown-disabled;
138 }
Michael Daviscb8bb192017-02-09 15:45:13 -0600139}
Yoshie Muranaka5bd1dec2019-05-16 13:06:32 -0500140
141#login__form {
142 input {
143 height: 3em;
144 max-height: none;
145 }
146}
Yoshie Muranakae4194ce2019-05-24 14:33:56 -0500147.form__validation-message {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500148 color: $status-error;
Yoshie Muranakafa562732019-07-17 11:23:15 -0500149 font-size: 0.8em;
150 line-height: 1.1;
151 padding-top: 2px;
152}
153
154.radio-label {
155 text-transform: none;
156 font-weight: normal;
Yoshie Muranakae4194ce2019-05-24 14:33:56 -0500157 font-size: 0.9em;
Yoshie Muranakafa562732019-07-17 11:23:15 -0500158 line-height: 1.2;
159 margin: 0.8em 0;
160 color: $text-01;
161 input[type=radio] {
162 margin-bottom: 0;
163 }
Yoshie Muranakae4194ce2019-05-24 14:33:56 -0500164}
Dixsie Wolmersc652ed12019-07-19 13:03:28 -0500165
166/**
167 * Used for basic vertically stacked forms
168 * that do not need a grid for layout
169 * Should only wrap form elements and label
170 * Helper text shoul not be wrapped in the
171 * form-field container
172 * EX: Manage Power Usage
173 * Markup
174 <div class="section-content">
175 <p class="form__helper-text">Some helper text</p>
176 <div class=" form__field">
177 <label for="power-cap" class="content-label">POWER CAP VALUE IN WATTS</label>
178 <input id="power-cap type="number" />
179 </div>
180 </div>
181 */
182
183.form__field {
184 min-width: 150px;
185 max-width: 240px;
186}
187
188.form__field--large {
189 max-width: 330px;
190}
191
192// TODO Replace form-actions with form__actions. see below
193.form-actions {
194 width: 100%;
195 margin-top: 3rem;
196 padding-top: 1rem;
197 border-top: 1px solid $border-color-01;
198
199 button {
200 display: block;
201 float: right;
202 margin: 0.5em 0 0 1em;
203 }
204}
205
206/**
207 * Use to wrap the cancel and submit buttons on
208 * a form to create the top border and white space
209 * Markup
210 <div class="form-actions">
211 <button type="submit" class="btn-primary" ng-click="setPowerCap()">
212 Save settings
213 </button>
214 <button type="button" class="btn btn-secondary" ng-click="refresh()">
215 Cancel
216 </button>
217 </div>
218 */
219
220.form__actions {
221 margin-top: 3rem;
222 padding-top: 1rem;
223 border-top: 1px solid $border-color-01;
224 display: flex;
225 justify-content: flex-end;
226
227 button:first-of-type {
228 order: 1;
229 margin-left: 1rem;
230 }
231}
Yoshie Muranakafa562732019-07-17 11:23:15 -0500232
233.radio-option__input-field-group {
234 margin-left: 1.5em;
235}
236
237.field-group-container {
238 margin-bottom: 30px;
239 position: relative;
240 &:last-child {
241 margin-bottom: 12px;
242 }
243
244 input + .form__validation-message {
245 position: absolute;
246 }
247}