blob: c775c48c15c77522084b910410831eb6469a3a55 [file] [log] [blame]
Dixsie Wolmersc652ed12019-07-19 13:03:28 -05001label,
2legend {
Michael Daviscb8bb192017-02-09 15:45:13 -06003 margin: 0;
Yoshie Muranakafa562732019-07-17 11:23:15 -05004 color: $text-02;
5 text-transform: uppercase;
6 font-weight: 700;
7 font-size: 0.75em;
8 margin-bottom: 0;
9 line-height: 2.2;
Michael Daviscb8bb192017-02-09 15:45:13 -060010 .error {
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050011 font-size: 0.9em;
Michael Daviscb8bb192017-02-09 15:45:13 -060012 }
13}
14
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050015// TODO: Start replacing use of label__helper-text
16.label__helper-text,
17.form__helper-text {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050018 color: $text-02;
Yoshie Muranakae4194ce2019-05-24 14:33:56 -050019 line-height: 1.2;
20 font-size: 0.9em;
21 margin-bottom: 0.4em;
22}
23
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050024input[type="email"],
25input[type="number"],
26input[type="password"],
27input[type="search"],
28input[type="tel"],
29input[type="url"],
30input[type="text"],
31input[type="date"],
32input[type="time"],
Michael Daviscb8bb192017-02-09 15:45:13 -060033textarea {
34 border-radius: 0px;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050035 border: 1px solid $border-color-02;
beccabroeka09cc2d2019-01-23 14:26:55 -060036 margin: 0;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050037 background: $primary-light;
Michael Davise15a9562017-03-03 14:30:24 -060038 box-shadow: 0 0 0;
39 transition: none !important;
Yoshie Muranaka5bd1dec2019-05-16 13:06:32 -050040 max-height: 2.1em;
Michael Daviscb8bb192017-02-09 15:45:13 -060041 &:focus {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050042 border-color: $border-color-01;
43 box-shadow: 0 -3px $primary-accent inset;
Michael Daviscb8bb192017-02-09 15:45:13 -060044 }
Michael Davis51946552017-05-01 10:30:38 -050045 &:disabled,
46 .disabled {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050047 background: $background-03;
48 border: 1px solid $border-color-02;
Michael Daviscb8bb192017-02-09 15:45:13 -060049 }
50 &.input__error {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050051 box-shadow: 0 -5px $status-error inset;
52 color: $status-error;
Michael Davis51946552017-05-01 10:30:38 -050053 &:focus {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050054 box-shadow: 0 -5px $primary-accent inset;
Michael Davis51946552017-05-01 10:30:38 -050055 }
Michael Daviscb8bb192017-02-09 15:45:13 -060056 }
57}
58
beccabroeka09cc2d2019-01-23 14:26:55 -060059//input validation
60.ng-invalid.ng-touched {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050061 box-shadow: 0 -3px $status-error inset;
beccabroeka09cc2d2019-01-23 14:26:55 -060062 &:focus {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050063 border-color: $border-color-01;
64 box-shadow: 0 -3px $status-error inset;
beccabroeka09cc2d2019-01-23 14:26:55 -060065 }
66}
67.submitted .ng-invalid {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050068 box-shadow: 0 -3px $status-error inset;
beccabroeka09cc2d2019-01-23 14:26:55 -060069 &:focus {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050070 border-color: $border-color-01;
71 box-shadow: 0 -3px $status-error inset;
beccabroeka09cc2d2019-01-23 14:26:55 -060072 }
73}
74
75.form-error {
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050076 margin-bottom: 0.7em;
beccabroeka09cc2d2019-01-23 14:26:55 -060077 font-size: 0.8rem;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050078 color: $status-error;
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050079 height: 1rem;
beccabroeka09cc2d2019-01-23 14:26:55 -060080 display: block;
81 visibility: hidden;
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050082 // TODO: Create state rulesets rather than relying on one off solutions
beccabroeka09cc2d2019-01-23 14:26:55 -060083 .visible {
84 visibility: visible;
85 }
86}
Michael Davis4ac71d42017-06-19 14:47:50 -050087//Foundation overwrite
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050088[type="color"],
89[type="date"],
90[type="datetime-local"],
91[type="datetime"],
92[type="email"],
93[type="month"],
94[type="number"],
95[type="password"],
96[type="search"],
97[type="tel"],
98[type="text"],
99[type="time"],
100[type="url"],
101[type="week"],
102textarea {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500103 border-color: $border-color-02;
Michael Davis4ac71d42017-06-19 14:47:50 -0500104}
105
Michael Davis51946552017-05-01 10:30:38 -0500106input[readonly],
Dixsie Wolmersc652ed12019-07-19 13:03:28 -0500107input[readonly]:focus {
Michael Davis51946552017-05-01 10:30:38 -0500108 box-shadow: 0 0 0;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500109 background: $background-03;
110 border: 1px solid $border-color-02;
Michael Davis51946552017-05-01 10:30:38 -0500111}
112
Dixsie Wolmersc652ed12019-07-19 13:03:28 -0500113textarea {
114 padding: 0.2em;
115 height: auto;
116}
117
118input[type="submit"],
119.submit {
Michael Daviscb8bb192017-02-09 15:45:13 -0600120 margin: 1em 0;
121 width: 100%;
122}
123
Dixsie Wolmersc652ed12019-07-19 13:03:28 -0500124// Custom select
125select {
Michael Daviscb8bb192017-02-09 15:45:13 -0600126 border-radius: 0px;
Yoshie Muranakade382082019-04-30 13:56:10 -0500127 height: auto;
128 padding-right: 0.5rem; //override inherited Foundation style
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500129 border-color: $border-color-02;
Michael Daviscb8bb192017-02-09 15:45:13 -0600130 @include fastTransition-all;
131 @include bgImage__arrowDown-primary;
132 &:focus {
Michael Daviscb8bb192017-02-09 15:45:13 -0600133 box-shadow: 0 0 0;
134 }
Yoshie Muranakade382082019-04-30 13:56:10 -0500135 &[disabled] {
136 @include bgImage__arrowDown-disabled;
137 }
Michael Daviscb8bb192017-02-09 15:45:13 -0600138}
Yoshie Muranaka5bd1dec2019-05-16 13:06:32 -0500139
140#login__form {
141 input {
142 height: 3em;
143 max-height: none;
144 }
145}
Yoshie Muranakae4194ce2019-05-24 14:33:56 -0500146.form__validation-message {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500147 color: $status-error;
Yoshie Muranakafa562732019-07-17 11:23:15 -0500148 font-size: 0.8em;
149 line-height: 1.1;
150 padding-top: 2px;
151}
152
153.radio-label {
154 text-transform: none;
155 font-weight: normal;
Yoshie Muranakae4194ce2019-05-24 14:33:56 -0500156 font-size: 0.9em;
Yoshie Muranakafa562732019-07-17 11:23:15 -0500157 line-height: 1.2;
158 margin: 0.8em 0;
159 color: $text-01;
160 input[type=radio] {
161 margin-bottom: 0;
162 }
Yoshie Muranakae4194ce2019-05-24 14:33:56 -0500163}
Dixsie Wolmersc652ed12019-07-19 13:03:28 -0500164
165/**
166 * Used for basic vertically stacked forms
167 * that do not need a grid for layout
168 * Should only wrap form elements and label
169 * Helper text shoul not be wrapped in the
170 * form-field container
171 * EX: Manage Power Usage
172 * Markup
173 <div class="section-content">
174 <p class="form__helper-text">Some helper text</p>
175 <div class=" form__field">
176 <label for="power-cap" class="content-label">POWER CAP VALUE IN WATTS</label>
177 <input id="power-cap type="number" />
178 </div>
179 </div>
180 */
181
182.form__field {
183 min-width: 150px;
184 max-width: 240px;
185}
186
187.form__field--large {
188 max-width: 330px;
189}
190
191// TODO Replace form-actions with form__actions. see below
192.form-actions {
193 width: 100%;
194 margin-top: 3rem;
195 padding-top: 1rem;
196 border-top: 1px solid $border-color-01;
197
198 button {
199 display: block;
200 float: right;
201 margin: 0.5em 0 0 1em;
202 }
203}
204
205/**
206 * Use to wrap the cancel and submit buttons on
207 * a form to create the top border and white space
208 * Markup
209 <div class="form-actions">
210 <button type="submit" class="btn-primary" ng-click="setPowerCap()">
211 Save settings
212 </button>
213 <button type="button" class="btn btn-secondary" ng-click="refresh()">
214 Cancel
215 </button>
216 </div>
217 */
218
219.form__actions {
220 margin-top: 3rem;
221 padding-top: 1rem;
222 border-top: 1px solid $border-color-01;
223 display: flex;
224 justify-content: flex-end;
225
226 button:first-of-type {
227 order: 1;
228 margin-left: 1rem;
229 }
230}
Yoshie Muranakafa562732019-07-17 11:23:15 -0500231
232.radio-option__input-field-group {
233 margin-left: 1.5em;
234}
235
236.field-group-container {
237 margin-bottom: 30px;
238 position: relative;
239 &:last-child {
240 margin-bottom: 12px;
241 }
242
243 input + .form__validation-message {
244 position: absolute;
245 }
246}