material_components_web-sass 0.21.1 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -28,10 +28,10 @@
28
28
 
29
29
  @if ($light-or-dark == "light") {
30
30
  @include mdc-button-ink-color(text-primary-on-dark);
31
- @include mdc-button-ripple((base-color: white, opacity: .32));
31
+ @include mdc-button-ripple((theme-style: text-primary-on-dark, opacity: $mdc-filled-button-ripple-opacity));
32
32
  } @else {
33
33
  @include mdc-button-ink-color(text-primary-on-light);
34
- @include mdc-button-ripple((base-color: black, opacity: .32));
34
+ @include mdc-button-ripple((theme-style: text-primary-on-light, opacity: $mdc-filled-button-ripple-opacity));
35
35
  }
36
36
  }
37
37
 
@@ -39,7 +39,7 @@
39
39
  // :not(:disabled) is used to support link styled as button
40
40
  // as link does not support :enabled style
41
41
  &:not(:disabled) {
42
- @include mdc-theme-prop(background-color, $color);
42
+ @include mdc-theme-prop(background-color, $color, $edgeOptOut: true);
43
43
  }
44
44
  }
45
45
 
@@ -60,12 +60,6 @@
60
60
  @include mdc-ripple-base;
61
61
  @include mdc-ripple-bg(map-merge((pseudo: "::before"), $ripple-config));
62
62
  @include mdc-ripple-fg(map-merge((pseudo: "::after"), $ripple-config));
63
-
64
- &:not(.mdc-ripple-upgraded) {
65
- $tap-highlight-color: rgba(map-get($ripple-config, base-color), map-get($ripple-config, opacity));
66
-
67
- @include mdc-theme-prop(-webkit-tap-highlight-color, $tap-highlight-color);
68
- }
69
63
  }
70
64
  }
71
65
 
@@ -100,6 +94,7 @@
100
94
  text-align: center;
101
95
  user-select: none;
102
96
  -webkit-appearance: none;
97
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
103
98
  overflow: hidden;
104
99
  vertical-align: middle;
105
100
 
@@ -16,3 +16,6 @@
16
16
 
17
17
  $mdc-button-height: 36px;
18
18
  $mdc-dense-button-height: 32px;
19
+
20
+ $mdc-unfilled-button-ripple-opacity: .16;
21
+ $mdc-filled-button-ripple-opacity: .32;
@@ -16,29 +16,23 @@
16
16
 
17
17
  @import "@material/theme/mixins";
18
18
  @import "./mixins";
19
+ @import "./variables";
19
20
 
20
21
  // postcss-bem-linter: define button
21
22
  .mdc-button {
22
23
  @include mdc-button-base_;
23
24
  @include mdc-button-corner-radius(2px);
24
25
  @include mdc-button-container-fill-color(transparent);
25
- @include mdc-button-ink-color(text-primary-on-light);
26
- @include mdc-button-ripple((base-color: black, opacity: .16));
27
-
28
- @include mdc-theme-dark(".mdc-button") {
29
- @include mdc-button-ink-color(text-primary-on-dark);
30
- @include mdc-button-ripple((base-color: white, opacity: .16));
31
- }
26
+ @include mdc-button-ink-color(primary);
27
+ @include mdc-button-ripple((theme-style: primary, opacity: $mdc-unfilled-button-ripple-opacity));
32
28
  }
33
29
 
34
30
  .mdc-button--raised,
35
31
  .mdc-button--unelevated {
36
32
  @include mdc-button--filled_;
37
- @include mdc-button-filled-accessible(black);
38
-
39
- @include mdc-theme-dark(".mdc-button") {
40
- @include mdc-button-filled-accessible(white);
41
- }
33
+ @include mdc-button-container-fill-color(primary);
34
+ @include mdc-button-ink-color(text-primary-on-primary);
35
+ @include mdc-button-ripple((theme-style: text-primary-on-primary, opacity: $mdc-filled-button-ripple-opacity));
42
36
  }
43
37
 
44
38
  .mdc-button--raised {
@@ -48,11 +42,7 @@
48
42
  .mdc-button--stroked {
49
43
  @include mdc-button--stroked_;
50
44
  @include mdc-button-stroke-width(2px);
51
- @include mdc-button-stroke-color(text-primary-on-light);
52
-
53
- @include mdc-theme-dark(".mdc-button") {
54
- @include mdc-button-stroke-color(text-primary-on-dark);
55
- }
45
+ @include mdc-button-stroke-color(primary);
56
46
  }
57
47
 
58
48
  .mdc-button--compact {
@@ -98,7 +98,7 @@
98
98
  // The frame's ::before element is used as a focus indicator for the checkbox
99
99
  &::before {
100
100
  @include mdc-checkbox-cover-element;
101
- @include mdc-theme-prop(background, primary);
101
+ @include mdc-theme-prop(background, primary, $edgeOptOut: true);
102
102
 
103
103
  width: 100%;
104
104
  height: 100%;
@@ -35,7 +35,7 @@
35
35
  }
36
36
 
37
37
  @mixin mdc-fab-container-color($color) {
38
- @include mdc-theme-prop(background-color, $color);
38
+ @include mdc-theme-prop(background-color, $color, $edgeOptOut: true);
39
39
  }
40
40
 
41
41
  @mixin mdc-fab-ink-color($color) {
@@ -74,6 +74,11 @@ $mdc-fab-icon-enter-duration_: 180ms;
74
74
  -webkit-appearance: none;
75
75
  overflow: hidden;
76
76
 
77
+ &:hover,
78
+ &:focus {
79
+ @include mdc-elevation(8);
80
+ }
81
+
77
82
  &:active {
78
83
  @include mdc-elevation(12);
79
84
  }
@@ -37,7 +37,8 @@ $mdc-simple-menu-item-fade-duration: .3s;
37
37
  background-color: white;
38
38
  white-space: nowrap;
39
39
  opacity: 0;
40
- overflow: hidden;
40
+ overflow-x: hidden;
41
+ overflow-y: auto;
41
42
  box-sizing: border-box;
42
43
  will-change: transform, opacity;
43
44
  z-index: 4;
@@ -73,7 +73,7 @@ $mdc-radio-transition-duration: 120ms;
73
73
  height: $mdc-radio-ui-pct;
74
74
 
75
75
  &::before {
76
- @include mdc-theme-prop(background-color, primary);
76
+ @include mdc-theme-prop(background-color, primary, $edgeOptOut: true);
77
77
 
78
78
  position: absolute;
79
79
  top: 0;
@@ -85,7 +85,6 @@
85
85
  left: 0;
86
86
  max-height: 100%;
87
87
  transform-origin: center center;
88
- overflow-y: scroll;
89
88
  z-index: 4; // Should pop up above everything else. temporary-drawer is next highest at 3.
90
89
  }
91
90
 
@@ -0,0 +1,37 @@
1
+ //
2
+ // Copyright 2017 Google Inc. All Rights Reserved.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+
17
+ @mixin mdc-text-field-invalid-label-shake-keyframes_($modifier, $positionY) {
18
+ @keyframes invalid-shake-float-above-#{$modifier} {
19
+ 0% {
20
+ transform: translateX(0) translateY(-#{$positionY}) scale(.75, .75);
21
+ }
22
+
23
+ 33% {
24
+ animation-timing-function: cubic-bezier(.5, 0, .701732, .495819);
25
+ transform: translateX(10px) translateY(-#{$positionY}) scale(.75, .75);
26
+ }
27
+
28
+ 66% {
29
+ animation-timing-function: cubic-bezier(.302435, .381352, .55, .956352);
30
+ transform: translateX(-5px) translateY(-#{$positionY}) scale(.75, .75);
31
+ }
32
+
33
+ 100% {
34
+ transform: translateX(0) translateY(-#{$positionY}) scale(.75, .75);
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,44 @@
1
+ //
2
+ // Copyright 2017 Google Inc. All Rights Reserved.
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+ //
16
+
17
+ $mdc-textfield-error-on-light: #d50000;
18
+ $mdc-textfield-error-on-dark: #ff6e6e;
19
+ $mdc-textfield-divider-on-light: rgba(black, .12);
20
+ $mdc-textfield-divider-on-dark: rgba(white, .12);
21
+ $mdc-textfield-disabled-border-on-light: rgba(#231f20, .26);
22
+ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
23
+ $mdc-textfield-disabled-icon-on-light: rgba(black, .3);
24
+ $mdc-textfield-disabled-icon-on-dark: rgba(white, .3);
25
+ $mdc-textfield-icon-position: 15px;
26
+ $mdc-textfield-icon-padding: 48px;
27
+ $mdc-textfield-dense-icon-position: 12px;
28
+ $mdc-textfield-dense-icon-padding: 38px;
29
+ $mdc-textfield-underline-on-light: rgba(black, 1);
30
+ $mdc-textfield-underline-on-light-idle: rgba(black, .5);
31
+ $mdc-textfield-underline-on-dark: rgba(white, 1);
32
+ $mdc-textfield-underline-on-dark-idle: rgba(white, .5);
33
+ $mdc-textfield-dark-background: rgba(48, 48, 48, 1);
34
+ $mdc-textfield-dark-label: rgba(white, .6);
35
+ $mdc-textfield-dark-placeholder: rgba(black, .38);
36
+ $mdc-textfield-light-background: rgba(white, 1);
37
+ $mdc-textfield-light-label: rgba(white, .7);
38
+ $mdc-textfield-light-placeholder: rgba(white, .3);
39
+ $mdc-textarea-border-on-light: rgba(black, .73);
40
+ $mdc-textarea-border-on-dark: rgba(white, 1);
41
+ $mdc-textarea-light-background: rgba(white, 1);
42
+ $mdc-textarea-dark-background: rgba(48, 48, 48, 1);
43
+ $mdc-textarea-disabled-background-on-light: rgba(249, 249, 249, 1);
44
+ $mdc-textarea-disabled-background-on-dark: rgba(47, 47, 47, 1);
@@ -14,6 +14,8 @@
14
14
  // limitations under the License.
15
15
  //
16
16
 
17
+ @import "./mixins";
18
+ @import "./variables";
17
19
  @import "@material/animation/variables";
18
20
  @import "@material/ripple/mixins";
19
21
  @import "@material/rtl/mixins";
@@ -22,20 +24,17 @@
22
24
  @import "@material/typography/mixins";
23
25
  @import "@material/typography/variables";
24
26
 
25
- $mdc-textfield-error-on-light: #d50000;
26
- $mdc-textfield-error-on-dark: #ff6e6e;
27
- $mdc-textfield-divider-on-light: rgba(black, .12);
28
- $mdc-textfield-divider-on-dark: rgba(white, .12);
29
- $mdc-textfield-disabled-border-on-light: rgba(#231f20, .26);
30
- $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
31
-
32
27
  @function mdc-textfield-transition($property) {
33
28
  @return #{$property} 180ms $mdc-animation-standard-curve-timing-function;
34
29
  }
35
30
 
31
+ @include mdc-text-field-invalid-label-shake_keyframes_(standard, 100%);
32
+ @include mdc-text-field-invalid-label-shake_keyframes_(box, 50%);
33
+
36
34
  // postcss-bem-linter: define textfield
37
35
  .mdc-textfield {
38
36
  display: inline-block;
37
+ position: relative;
39
38
  margin-bottom: 8px;
40
39
  will-change: opacity, transform, color;
41
40
 
@@ -50,7 +49,9 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
50
49
 
51
50
  width: 100%;
52
51
  padding: 0 0 8px;
52
+ transition: mdc-textfield-transition(opacity);
53
53
  border: none;
54
+ border-bottom: 1px solid $mdc-textfield-underline-on-light-idle;
54
55
  background: none;
55
56
  font-size: inherit;
56
57
  appearance: none;
@@ -62,11 +63,15 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
62
63
  opacity: 1;
63
64
  }
64
65
 
66
+ &:hover {
67
+ border-color: $mdc-textfield-underline-on-light;
68
+ }
69
+
65
70
  &:focus {
66
71
  outline: none;
67
72
 
68
73
  &::placeholder {
69
- @include mdc-theme-prop(color, text-secondary-on-light);
74
+ @include mdc-theme-prop(color, $mdc-textfield-light-placeholder);
70
75
  }
71
76
  }
72
77
 
@@ -78,24 +83,51 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
78
83
  @include mdc-theme-dark {
79
84
  @include mdc-theme-prop(color, text-primary-on-dark);
80
85
 
86
+ border-bottom: 1px solid $mdc-textfield-underline-on-dark-idle;
87
+
88
+ &:hover {
89
+ border-bottom: 1px solid $mdc-textfield-underline-on-dark;
90
+ }
91
+
81
92
  &::placeholder {
82
93
  @include mdc-theme-prop(color, text-hint-on-dark);
83
94
  }
84
95
 
85
96
  &:focus::placeholder {
86
- @include mdc-theme-prop(color, text-secondary-on-dark);
97
+ @include mdc-theme-prop(color, $mdc-textfield-dark-placeholder);
87
98
  }
88
99
  }
89
100
  }
90
101
 
91
- &__label {
92
- @include mdc-theme-prop(color, text-hint-on-light);
102
+ &__bottom-line {
103
+ @include mdc-theme-prop(background-color, primary);
93
104
 
105
+ position: absolute;
106
+ bottom: 0;
107
+ left: 0;
108
+ width: 100%;
109
+ height: 2px;
110
+ transform: scaleX(0);
111
+ transition: mdc-textfield-transition(transform), mdc-textfield-transition(opacity);
112
+ opacity: 0;
113
+ z-index: 2;
114
+ }
115
+
116
+ &__bottom-line--active {
117
+ transform: scaleX(1);
118
+ }
119
+
120
+ .mdc-textfield__input:focus ~ .mdc-textfield__bottom-line {
121
+ opacity: 1;
122
+ }
123
+
124
+ &__label {
94
125
  position: absolute;
95
126
  bottom: 8px;
96
127
  left: 0;
97
128
  transform-origin: left top;
98
129
  transition: mdc-textfield-transition(transform), mdc-textfield-transition(color);
130
+ color: $mdc-textfield-underline-on-light-idle;
99
131
  cursor: text;
100
132
 
101
133
  // stylelint-disable plugin/selector-bem-pattern
@@ -107,7 +139,7 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
107
139
  // stylelint-enable plugin/selector-bem-pattern
108
140
 
109
141
  @include mdc-theme-dark(".mdc-textfield") {
110
- @include mdc-theme-prop(color, text-hint-on-dark);
142
+ @include mdc-theme-prop(color, $mdc-textfield-dark-label);
111
143
  }
112
144
 
113
145
  &--float-above {
@@ -186,8 +218,12 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
186
218
 
187
219
  position: absolute;
188
220
  bottom: 20px;
221
+ width: calc(100% - #{$mdc-textfield-icon-padding});
189
222
  color: rgba(black, .6);
223
+ text-overflow: ellipsis;
224
+ white-space: nowrap;
190
225
  pointer-events: none;
226
+ overflow: hidden;
191
227
  // Force the label into its own layer to prevent to prevent visible layer promotion adjustments
192
228
  // when the ripple is activated behind it.
193
229
  will-change: transform;
@@ -201,6 +237,12 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
201
237
  }
202
238
  }
203
239
 
240
+ .mdc-textfield__label--float-above {
241
+ &.mdc-textfield__label--shake {
242
+ animation: invalid-shake-float-above-box 250ms 1;
243
+ }
244
+ }
245
+
204
246
  &.mdc-ripple-upgraded {
205
247
  @include mdc-ripple-base;
206
248
  // TODO: Add ::before as ripple bg once #194 lands
@@ -224,94 +266,122 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
224
266
  }
225
267
 
226
268
  &.mdc-textfield--disabled {
269
+ @include mdc-theme-prop(background-color, $mdc-textfield-light-background);
270
+ @include mdc-theme-prop(color, $mdc-textfield-light-placeholder);
271
+
227
272
  border-bottom: none;
228
273
  background-color: rgba(black, .02);
229
- color: rgba(black, .38);
230
274
 
231
275
  @include mdc-theme-dark(".mdc-textfield", true) {
276
+ @include mdc-theme-prop(background-color, $mdc-textfield-dark-background);
277
+ @include mdc-theme-prop(color, $mdc-textfield-dark-placeholder);
278
+
232
279
  border-bottom: none;
233
- background-color: rgba(white, .05);
234
280
  }
235
281
 
236
282
  .mdc-textfield__label {
237
283
  bottom: 20px;
238
284
  }
239
285
 
240
- .mdc-textfield__input {
241
- padding-bottom: 0;
286
+ .mdc-textfield__icon {
287
+ @include mdc-theme-prop(color, $mdc-textfield-disabled-icon-on-light);
288
+
289
+ @include mdc-theme-dark() {
290
+ @include mdc-theme-prop(color, $mdc-textfield-disabled-icon-on-dark);
291
+ }
242
292
  }
243
293
  }
244
294
 
245
- // TODO: Move into general .mdc-textfield decl and replace ::after textfield styles with this
246
- // element as part of #675
247
- .mdc-textfield__bottom-line {
248
- position: absolute;
249
- bottom: 0;
250
- left: 0;
251
- width: 100%;
252
- height: 1px;
253
- transform: scaleY(1);
254
- transform-origin: center bottom;
255
- transition:
256
- background-color 33ms $mdc-animation-standard-curve-timing-function,
257
- mdc-textfield-transition(transform);
258
- background-color: rgba(black, .42);
259
- pointer-events: none;
260
-
261
- &::after {
262
- position: absolute;
263
- top: 0;
264
- left: 0;
265
- width: 100%;
266
- height: 100%;
267
- transition: mdc-textfield-transition(opacity);
268
- background-color: $mdc-textfield-error-on-light;
269
- opacity: 0;
270
- content: "";
295
+ &.mdc-textfield--dense {
296
+ .mdc-textfield__input {
297
+ padding: 12px 12px 0;
271
298
  }
272
299
 
273
- @include mdc-theme-dark(".mdc-textfield") {
274
- @include mdc-theme-prop(background-color, text-hint-on-dark);
300
+ .mdc-textfield__label {
301
+ @include mdc-rtl-reflexive-position(left, 12px);
275
302
 
276
- &::after {
277
- background-color: $mdc-textfield-error-on-dark;
303
+ bottom: 20px;
304
+
305
+ &--float-above {
306
+ transform: translateY(calc(-75% - 2px)) scale(.923, .923);
278
307
  }
279
308
  }
280
309
  }
310
+ // stylelint-enable plugin/selector-bem-pattern
311
+ }
281
312
 
282
- &.mdc-textfield--focused .mdc-textfield__bottom-line {
283
- @include mdc-theme-prop(background-color, primary);
313
+ .mdc-textfield--with-leading-icon .mdc-textfield__icon,
314
+ .mdc-textfield--with-trailing-icon .mdc-textfield__icon {
315
+ position: absolute;
316
+ bottom: 16px;
317
+ cursor: pointer;
284
318
 
285
- transform: scaleY(2);
319
+ @include mdc-theme-dark(".mdc-textfield") {
320
+ @include mdc-theme-prop(color, text-secondary-on-dark);
286
321
  }
322
+ }
287
323
 
288
- &.mdc-textfield--disabled .mdc-textfield__bottom-line {
289
- display: none;
324
+ .mdc-textfield--with-leading-icon {
325
+ .mdc-textfield__input {
326
+ @include mdc-rtl-reflexive-property(padding, $mdc-textfield-icon-padding, $mdc-textfield-icon-position);
290
327
  }
291
328
 
292
- &.mdc-textfield--invalid .mdc-textfield__bottom-line::after {
293
- opacity: 1;
329
+ .mdc-textfield__icon {
330
+ @include mdc-rtl-reflexive-position(left, $mdc-textfield-icon-position);
294
331
  }
295
332
 
296
- &.mdc-textfield--dense {
297
- height: 44px;
333
+ .mdc-textfield__label {
334
+ @include mdc-rtl-reflexive-position(left, $mdc-textfield-icon-padding);
335
+ }
336
+ }
298
337
 
299
- .mdc-textfield__input {
300
- padding: 12px 12px 0;
301
- }
338
+ .mdc-textfield--with-trailing-icon {
339
+ .mdc-textfield__input {
340
+ @include mdc-rtl-reflexive-property(padding, $mdc-textfield-icon-position, $mdc-textfield-icon-padding);
341
+ }
302
342
 
303
- .mdc-textfield__label {
304
- @include mdc-rtl-reflexive-position(left, 12px);
343
+ .mdc-textfield__icon {
344
+ @include mdc-rtl-reflexive-position(right, $mdc-textfield-icon-position);
345
+ }
346
+ }
305
347
 
306
- bottom: 12px;
348
+ .mdc-textfield__icon:not([tabindex]),
349
+ .mdc-textfield__icon[tabindex="-1"] {
350
+ cursor: default;
351
+ pointer-events: none;
352
+ }
307
353
 
308
- &--float-above {
309
- transform: translateY(calc(-75% - 2px)) scale(.923, .923);
310
- }
311
- }
354
+ // stylelint-disable plugin/selector-bem-pattern
355
+ .mdc-textfield--with-leading-icon.mdc-textfield--dense .mdc-textfield__icon,
356
+ .mdc-textfield--with-trailing-icon.mdc-textfield--dense .mdc-textfield__icon {
357
+ bottom: 16px;
358
+ transform: scale(.8);
359
+ }
360
+
361
+ .mdc-textfield--with-leading-icon.mdc-textfield--dense {
362
+ .mdc-textfield__input {
363
+ @include mdc-rtl-reflexive-property(padding, $mdc-textfield-dense-icon-padding, $mdc-textfield-dense-icon-position);
364
+ }
365
+
366
+ .mdc-textfield__icon {
367
+ @include mdc-rtl-reflexive-position(left, $mdc-textfield-dense-icon-position);
368
+ }
369
+
370
+ .mdc-textfield__label {
371
+ @include mdc-rtl-reflexive-position(left, $mdc-textfield-dense-icon-padding);
372
+ }
373
+ }
374
+
375
+ .mdc-textfield--with-trailing-icon.mdc-textfield--dense {
376
+ .mdc-textfield__input {
377
+ @include mdc-rtl-reflexive-property(padding, $mdc-textfield-dense-icon-position, $mdc-textfield-dense-icon-padding);
378
+ }
379
+
380
+ .mdc-textfield__icon {
381
+ @include mdc-rtl-reflexive-position(right, $mdc-textfield-dense-icon-position);
312
382
  }
313
- // stylelint-enable plugin/selector-bem-pattern
314
383
  }
384
+ // stylelint-enable plugin/selector-bem-pattern
315
385
 
316
386
  .mdc-textfield--upgraded:not(.mdc-textfield--fullwidth):not(.mdc-textfield--box) {
317
387
  display: inline-flex;
@@ -320,25 +390,8 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
320
390
  box-sizing: border-box;
321
391
  margin-top: 16px;
322
392
 
323
- &:not(.mdc-textfield--multiline) {
393
+ &:not(.mdc-textfield--textarea) {
324
394
  height: 48px;
325
-
326
- &::after {
327
- position: absolute;
328
- bottom: 0;
329
- left: 0;
330
- width: 100%;
331
- height: 1px;
332
- transform: translateY(50%) scaleY(1);
333
- transform-origin: center bottom;
334
- transition: mdc-textfield-transition(background-color), mdc-textfield-transition(transform);
335
- background-color: $mdc-textfield-divider-on-light;
336
- content: "";
337
-
338
- @include mdc-theme-dark(".mdc-textfield") {
339
- background-color: $mdc-textfield-divider-on-dark;
340
- }
341
- }
342
395
  }
343
396
 
344
397
  .mdc-textfield__label {
@@ -346,34 +399,31 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
346
399
  }
347
400
  }
348
401
 
349
- .mdc-textfield--focused {
350
- @mixin mdc-textfield-after-styles {
351
- @include mdc-theme-prop(background-color, primary);
352
-
353
- transform: translateY(100%) scaleY(2);
354
- transition: mdc-textfield-transition(transform);
402
+ .mdc-textfield--invalid {
403
+ .mdc-textfield__label {
404
+ color: $mdc-textfield-error-on-light;
355
405
  }
356
406
 
357
- @mixin mdc-textfield-label-styles {
358
- @include mdc-theme-prop(color, primary);
407
+ .mdc-textfield__input {
408
+ border-color: $mdc-textfield-error-on-light;
359
409
  }
360
410
 
361
- &.mdc-textfield--upgraded:not(.mdc-textfield--fullwidth):not(.mdc-textfield--multiline):not(.mdc-textfield--box)::after {
362
- @include mdc-textfield-after-styles;
363
-
364
- @include mdc-theme-dark(".mdc-textfield", true) {
365
- @include mdc-textfield-after-styles;
366
- }
411
+ .mdc-textfield__bottom-line {
412
+ background-color: $mdc-textfield-error-on-light;
367
413
  }
414
+ }
368
415
 
369
- .mdc-textfield__label {
370
- @include mdc-textfield-label-styles;
416
+ // stylelint-disable plugin/selector-bem-pattern
417
+ .mdc-textfield--invalid.mdc-textfield--textarea {
418
+ border-color: $mdc-textfield-error-on-light;
419
+ }
371
420
 
372
- @include mdc-theme-dark(".mdc-textfield") {
373
- @include mdc-textfield-label-styles;
374
- }
421
+ .mdc-textfield__label--float-above {
422
+ &.mdc-textfield__label--shake {
423
+ animation: invalid-shake-float-above-standard 250ms 1;
375
424
  }
376
425
  }
426
+ // stylelint-enable plugin/selector-bem-pattern
377
427
 
378
428
  .mdc-textfield--dense {
379
429
  margin-top: 12px;
@@ -386,47 +436,15 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
386
436
  }
387
437
  }
388
438
 
389
- .mdc-textfield--invalid {
390
- &:not(.mdc-textfield--focused):not(.mdc-textfield--box) {
391
- &::after,
392
- &.mdc-textfield--upgraded::after {
393
- background-color: $mdc-textfield-error-on-light;
394
- }
395
-
396
- .mdc-textfield__label {
397
- color: $mdc-textfield-error-on-light;
398
- }
399
- }
400
-
401
- @include mdc-theme-dark(".mdc-textfield", true) {
402
- &:not(.mdc-textfield--focused) {
403
- &::after,
404
- &.mdc-textfield--upgraded::after {
405
- background-color: $mdc-textfield-error-on-dark;
406
- }
407
-
408
- .mdc-textfield__label {
409
- color: $mdc-textfield-error-on-dark;
410
- }
411
- }
412
- }
413
- }
414
-
415
439
  .mdc-textfield--disabled {
416
- border-bottom: 1px dotted $mdc-textfield-disabled-border-on-light;
417
440
  pointer-events: none;
418
441
 
419
- &::after {
420
- display: none;
421
- }
422
-
423
- // Account for offset by border
424
442
  .mdc-textfield__input {
425
- padding-bottom: 7px;
426
- }
443
+ border-bottom: 1px dotted $mdc-textfield-disabled-border-on-light;
427
444
 
428
- @include mdc-theme-dark(".mdc-textfield", true) {
429
- border-bottom: 1px dotted $mdc-textfield-disabled-border-on-dark;
445
+ @include mdc-theme-dark(".mdc-textfield", true) {
446
+ border-bottom: 1px dotted $mdc-textfield-disabled-border-on-dark;
447
+ }
430
448
  }
431
449
 
432
450
  // stylelint-disable plugin/selector-bem-pattern
@@ -453,11 +471,21 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
453
471
  }
454
472
 
455
473
  .mdc-textfield__label {
456
- bottom: 7px;
474
+ bottom: 8px;
457
475
  cursor: default;
458
476
  }
459
477
  }
460
478
 
479
+ .mdc-textfield--invalid.mdc-textfield--disabled {
480
+ .mdc-textfield__label {
481
+ @include mdc-theme-prop(color, text-disabled-on-light);
482
+
483
+ @include mdc-theme-dark(".mdc-textfield") {
484
+ @include mdc-theme-prop(color, text-disabled-on-dark);
485
+ }
486
+ }
487
+ }
488
+
461
489
  .mdc-textfield__input:required + .mdc-textfield__label::after {
462
490
  margin-left: 1px;
463
491
  content: "*";
@@ -471,31 +499,28 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
471
499
  }
472
500
  }
473
501
 
474
- .mdc-textfield--multiline {
475
- $padding-inset: 4px;
502
+ .mdc-textfield--textarea {
503
+ $padding-inset: 16px;
476
504
  $label-offset-y: $padding-inset + 2;
477
505
  $label-offset-x: $padding-inset;
478
506
 
479
507
  display: flex;
480
508
  height: initial;
481
509
  transition: none;
510
+ border: 1px solid $mdc-textarea-border-on-light;
511
+ border-radius: 4px;
482
512
 
483
- &::after {
484
- content: initial;
513
+ @include mdc-theme-dark(".mdc-textfield") {
514
+ border-color: $mdc-textarea-border-on-dark;
485
515
  }
486
516
 
487
517
  // stylelint-disable plugin/selector-bem-pattern
488
-
489
518
  .mdc-textfield__input {
490
519
  padding: $padding-inset;
491
- transition: mdc-textfield-transition(border-color);
492
- border: 1px solid $mdc-textfield-divider-on-light;
520
+ padding-top: $padding-inset * 2;
521
+ border: 1px solid transparent;
493
522
  border-radius: 2px;
494
523
 
495
- @include mdc-theme-dark(".mdc-textfield") {
496
- border-color: $mdc-textfield-divider-on-dark;
497
- }
498
-
499
524
  &:focus {
500
525
  @include mdc-theme-prop(border-color, primary);
501
526
  }
@@ -505,6 +530,14 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
505
530
  }
506
531
 
507
532
  @include mdc-theme-dark(".mdc-textfield") {
533
+ &:hover {
534
+ border-bottom-color: transparent;
535
+ }
536
+
537
+ &:focus {
538
+ @include mdc-theme-prop(border-color, secondary);
539
+ }
540
+
508
541
  &:invalid:not(:focus) {
509
542
  border-color: $mdc-textfield-error-on-dark;
510
543
  }
@@ -512,100 +545,92 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
512
545
  }
513
546
 
514
547
  .mdc-textfield__label {
548
+ @include mdc-rtl-reflexive-position(left, 1px);
549
+
515
550
  top: $label-offset-y;
516
- bottom: initial;
517
- left: $label-offset-x;
551
+ bottom: auto;
552
+ padding: 8px 16px;
553
+ background-color: $mdc-textarea-light-background;
518
554
 
519
- @include mdc-rtl(".mdc-textfield--multiline") {
520
- right: $label-offset-x;
521
- left: auto;
555
+ @include mdc-theme-dark(".mdc-textfield") {
556
+ background-color: $mdc-textarea-dark-background;
522
557
  }
523
558
 
524
559
  &--float-above {
525
560
  // Translate above the top of the input, and compensate for the amount of offset needed
526
561
  // to position the label within the bounds of the inset padding.
527
562
  // Note that the scale factor is an eyeball'd approximation of what's shown in the mocks.
528
- transform: translateY(calc(-100% - #{$label-offset-y})) scale(.923, .923);
563
+ transform: translateY(-50%) scale(.923, .923);
529
564
  }
530
565
  }
531
566
 
532
567
  &.mdc-textfield--disabled {
533
- border-bottom: none;
568
+ border-style: solid;
569
+ border-color: $mdc-textfield-disabled-border-on-light;
570
+ background-color: $mdc-textarea-disabled-background-on-light;
534
571
 
535
- .mdc-textfield__input {
536
- border: 1px dotted $mdc-textfield-disabled-border-on-light;
572
+ @include mdc-theme-dark(".mdc-textfield") {
573
+ border-color: $mdc-textfield-disabled-border-on-dark;
574
+ background-color: $mdc-textarea-disabled-background-on-dark;
575
+ }
576
+
577
+ .mdc-textfield__label {
578
+ background-color: $mdc-textarea-disabled-background-on-light;
537
579
 
538
580
  @include mdc-theme-dark(".mdc-textfield") {
539
- border-color: $mdc-textfield-disabled-border-on-dark;
581
+ background-color: $mdc-textarea-disabled-background-on-dark;
540
582
  }
541
583
  }
542
584
  }
543
- // stylelint-enable plugin/selector-bem-pattern
585
+
586
+ &:not(.mdc-textfield--upgraded) {
587
+ .mdc-textfield__input {
588
+ padding-top: $padding-inset;
589
+ }
590
+ }
544
591
  }
545
592
 
593
+ .mdc-textfield--textarea.mdc-textfield--focused {
594
+ @include mdc-theme-prop(border-color, primary);
595
+ }
596
+
597
+ // stylelint-enable plugin/selector-bem-pattern
598
+
546
599
  .mdc-textfield--fullwidth {
547
- display: block;
548
- box-sizing: border-box;
549
600
  width: 100%;
550
- margin: 0;
551
- border: none;
552
- border-bottom: 1px solid $mdc-textfield-divider-on-light;
553
- outline: none;
554
601
 
555
602
  // stylelint-disable plugin/selector-bem-pattern
556
603
 
557
- &:not(.mdc-textfield--multiline) {
604
+ &:not(.mdc-textfield--textarea) {
605
+ display: block;
606
+ box-sizing: border-box;
558
607
  height: 56px;
559
- }
560
-
561
- &.mdc-textfield--multiline {
562
- padding: 20px 0 0;
563
- }
564
-
565
- &.mdc-textfield--dense {
566
- &:not(.mdc-textfield--multiline) {
567
- height: 48px;
568
- }
569
-
570
- &.mdc-textfield--multiline {
571
- padding: 16px 0 0;
572
- }
573
- }
608
+ margin: 0;
609
+ border: none;
610
+ border-bottom: 1px solid $mdc-textfield-divider-on-light;
611
+ outline: none;
574
612
 
575
- &.mdc-textfield--disabled {
576
- &,
577
- &.mdc-textfield--multiline {
578
- border-bottom: 1px dotted $mdc-textfield-divider-on-light;
613
+ .mdc-textfield__input {
614
+ width: 100%;
615
+ height: 100%;
616
+ padding: 0;
617
+ resize: none;
618
+ // Use !important here to override all other border treatments
619
+ border: none !important;
579
620
  }
580
621
  }
581
622
 
582
623
  @include mdc-theme-dark {
583
624
  border-bottom: 1px solid $mdc-textfield-divider-on-dark;
584
-
585
- &.mdc-textfield--disabled {
586
- &,
587
- &.mdc-textfield--multiline {
588
- border-bottom: 1px dotted $mdc-textfield-divider-on-dark;
589
- }
590
- }
591
625
  }
592
626
 
593
627
  // stylelint-enable plugin/selector-bem-pattern
594
-
595
- .mdc-textfield__input {
596
- width: 100%;
597
- height: 100%;
598
- padding: 0;
599
- resize: none;
600
- // Use !important here to override all other border treatments
601
- border: none !important;
602
- }
603
628
  }
604
629
 
605
630
  // Graceful degredation for css-only inputs
606
631
 
607
632
  .mdc-textfield {
608
- &:not(.mdc-textfield--upgraded):not(.mdc-textfield--multiline) .mdc-textfield__input {
633
+ &:not(.mdc-textfield--upgraded):not(.mdc-textfield--textarea) .mdc-textfield__input {
609
634
  transition: mdc-textfield-transition(border-bottom-color);
610
635
  border-bottom: 1px solid $mdc-textfield-divider-on-light;
611
636
  }
@@ -616,10 +641,9 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
616
641
  }
617
642
 
618
643
  &:disabled {
619
- @include mdc-theme-prop(color, text-disabled-on-light);
644
+ @include mdc-theme-prop(color, $mdc-textfield-dark-placeholder);
620
645
 
621
- border-style: dotted;
622
- border-color: $mdc-textfield-disabled-border-on-light;
646
+ border-bottom-style: dotted;
623
647
  }
624
648
 
625
649
  &:invalid:not(:focus) {
@@ -634,9 +658,10 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
634
658
  }
635
659
 
636
660
  &:disabled {
637
- @include mdc-theme-prop(color, text-disabled-on-dark);
661
+ @include mdc-theme-prop(color, $mdc-textfield-dark-placeholder);
638
662
 
639
663
  border-color: $mdc-textfield-disabled-border-on-dark;
664
+ background-color: $mdc-textarea-disabled-background-on-dark;
640
665
  }
641
666
 
642
667
  &:invalid:not(:focus) {
@@ -647,7 +672,7 @@ $mdc-textfield-disabled-border-on-dark: rgba(white, .3);
647
672
  }
648
673
 
649
674
  .mdc-textfield--box:not(.mdc-textfield--upgraded) {
650
- height: 36px;
675
+ height: 56px;
651
676
 
652
677
  &::before,
653
678
  &::after {