blob: f04e827ecba5bb1d03926c183d0601ef074c0551 [file] [log] [blame]
Dixsie Wolmersc652ed12019-07-19 13:03:28 -05001label,
2legend {
3 font-size: 1em;
Michael Daviscb8bb192017-02-09 15:45:13 -06004 font-weight: 300;
5 margin: 0;
Michael Daviscb8bb192017-02-09 15:45:13 -06006 .error {
Dixsie Wolmersc652ed12019-07-19 13:03:28 -05007 font-size: 0.9em;
Michael Daviscb8bb192017-02-09 15:45:13 -06008 }
9}
10
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050011// TODO: Start replacing use of label__helper-text
12.label__helper-text,
13.form__helper-text {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050014 color: $text-02;
Yoshie Muranakae4194ce2019-05-24 14:33:56 -050015 line-height: 1.2;
16 font-size: 0.9em;
17 margin-bottom: 0.4em;
18}
19
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050020input[type="email"],
21input[type="number"],
22input[type="password"],
23input[type="search"],
24input[type="tel"],
25input[type="url"],
26input[type="text"],
27input[type="date"],
28input[type="time"],
Michael Daviscb8bb192017-02-09 15:45:13 -060029textarea {
30 border-radius: 0px;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050031 border: 1px solid $border-color-02;
beccabroeka09cc2d2019-01-23 14:26:55 -060032 margin: 0;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050033 background: $primary-light;
Michael Davise15a9562017-03-03 14:30:24 -060034 box-shadow: 0 0 0;
35 transition: none !important;
Yoshie Muranaka5bd1dec2019-05-16 13:06:32 -050036 max-height: 2.1em;
Michael Daviscb8bb192017-02-09 15:45:13 -060037 &:focus {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050038 border-color: $border-color-01;
39 box-shadow: 0 -3px $primary-accent inset;
Michael Daviscb8bb192017-02-09 15:45:13 -060040 }
Michael Davis51946552017-05-01 10:30:38 -050041 &:disabled,
42 .disabled {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050043 background: $background-03;
44 border: 1px solid $border-color-02;
Michael Daviscb8bb192017-02-09 15:45:13 -060045 }
46 &.input__error {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050047 box-shadow: 0 -5px $status-error inset;
48 color: $status-error;
Michael Davis51946552017-05-01 10:30:38 -050049 &:focus {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050050 box-shadow: 0 -5px $primary-accent inset;
Michael Davis51946552017-05-01 10:30:38 -050051 }
Michael Daviscb8bb192017-02-09 15:45:13 -060052 }
53}
54
beccabroeka09cc2d2019-01-23 14:26:55 -060055//input validation
56.ng-invalid.ng-touched {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050057 box-shadow: 0 -3px $status-error inset;
beccabroeka09cc2d2019-01-23 14:26:55 -060058 &:focus {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050059 border-color: $border-color-01;
60 box-shadow: 0 -3px $status-error inset;
beccabroeka09cc2d2019-01-23 14:26:55 -060061 }
62}
63.submitted .ng-invalid {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050064 box-shadow: 0 -3px $status-error inset;
beccabroeka09cc2d2019-01-23 14:26:55 -060065 &:focus {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050066 border-color: $border-color-01;
67 box-shadow: 0 -3px $status-error inset;
beccabroeka09cc2d2019-01-23 14:26:55 -060068 }
69}
70
71.form-error {
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050072 margin-bottom: 0.7em;
beccabroeka09cc2d2019-01-23 14:26:55 -060073 font-size: 0.8rem;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050074 color: $status-error;
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050075 height: 1rem;
beccabroeka09cc2d2019-01-23 14:26:55 -060076 display: block;
77 visibility: hidden;
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050078 // TODO: Create state rulesets rather than relying on one off solutions
beccabroeka09cc2d2019-01-23 14:26:55 -060079 .visible {
80 visibility: visible;
81 }
82}
Michael Davis4ac71d42017-06-19 14:47:50 -050083//Foundation overwrite
Dixsie Wolmersc652ed12019-07-19 13:03:28 -050084[type="color"],
85[type="date"],
86[type="datetime-local"],
87[type="datetime"],
88[type="email"],
89[type="month"],
90[type="number"],
91[type="password"],
92[type="search"],
93[type="tel"],
94[type="text"],
95[type="time"],
96[type="url"],
97[type="week"],
98textarea {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -050099 border-color: $border-color-02;
Michael Davis4ac71d42017-06-19 14:47:50 -0500100}
101
Michael Davis51946552017-05-01 10:30:38 -0500102input[readonly],
Dixsie Wolmersc652ed12019-07-19 13:03:28 -0500103input[readonly]:focus {
Michael Davis51946552017-05-01 10:30:38 -0500104 box-shadow: 0 0 0;
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500105 background: $background-03;
106 border: 1px solid $border-color-02;
Michael Davis51946552017-05-01 10:30:38 -0500107}
108
Dixsie Wolmersc652ed12019-07-19 13:03:28 -0500109textarea {
110 padding: 0.2em;
111 height: auto;
112}
113
114input[type="submit"],
115.submit {
Michael Daviscb8bb192017-02-09 15:45:13 -0600116 margin: 1em 0;
117 width: 100%;
118}
119
Dixsie Wolmersc652ed12019-07-19 13:03:28 -0500120// Custom select
121select {
Michael Daviscb8bb192017-02-09 15:45:13 -0600122 border-radius: 0px;
Yoshie Muranakade382082019-04-30 13:56:10 -0500123 height: auto;
124 padding-right: 0.5rem; //override inherited Foundation style
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500125 border-color: $border-color-02;
Michael Daviscb8bb192017-02-09 15:45:13 -0600126 @include fastTransition-all;
127 @include bgImage__arrowDown-primary;
128 &:focus {
Michael Daviscb8bb192017-02-09 15:45:13 -0600129 box-shadow: 0 0 0;
130 }
Yoshie Muranakade382082019-04-30 13:56:10 -0500131 &[disabled] {
132 @include bgImage__arrowDown-disabled;
133 }
Michael Daviscb8bb192017-02-09 15:45:13 -0600134}
Yoshie Muranaka5bd1dec2019-05-16 13:06:32 -0500135
136#login__form {
137 input {
138 height: 3em;
139 max-height: none;
140 }
141}
Yoshie Muranakae4194ce2019-05-24 14:33:56 -0500142.form__validation-message {
Yoshie Muranaka6f7ec802019-06-24 14:35:41 -0500143 color: $status-error;
Yoshie Muranakae4194ce2019-05-24 14:33:56 -0500144 font-size: 0.9em;
145}
Dixsie Wolmersc652ed12019-07-19 13:03:28 -0500146
147/**
148 * Used for basic vertically stacked forms
149 * that do not need a grid for layout
150 * Should only wrap form elements and label
151 * Helper text shoul not be wrapped in the
152 * form-field container
153 * EX: Manage Power Usage
154 * Markup
155 <div class="section-content">
156 <p class="form__helper-text">Some helper text</p>
157 <div class=" form__field">
158 <label for="power-cap" class="content-label">POWER CAP VALUE IN WATTS</label>
159 <input id="power-cap type="number" />
160 </div>
161 </div>
162 */
163
164.form__field {
165 min-width: 150px;
166 max-width: 240px;
167}
168
169.form__field--large {
170 max-width: 330px;
171}
172
173// TODO Replace form-actions with form__actions. see below
174.form-actions {
175 width: 100%;
176 margin-top: 3rem;
177 padding-top: 1rem;
178 border-top: 1px solid $border-color-01;
179
180 button {
181 display: block;
182 float: right;
183 margin: 0.5em 0 0 1em;
184 }
185}
186
187/**
188 * Use to wrap the cancel and submit buttons on
189 * a form to create the top border and white space
190 * Markup
191 <div class="form-actions">
192 <button type="submit" class="btn-primary" ng-click="setPowerCap()">
193 Save settings
194 </button>
195 <button type="button" class="btn btn-secondary" ng-click="refresh()">
196 Cancel
197 </button>
198 </div>
199 */
200
201.form__actions {
202 margin-top: 3rem;
203 padding-top: 1rem;
204 border-top: 1px solid $border-color-01;
205 display: flex;
206 justify-content: flex-end;
207
208 button:first-of-type {
209 order: 1;
210 margin-left: 1rem;
211 }
212}