material_components_web-sass 0.20.0 → 0.21.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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/README.md +0 -1
  4. data/lib/material_components_web/sass/version.rb +1 -1
  5. data/vendor/assets/javascripts/material-components-web.js +24 -5
  6. data/vendor/assets/stylesheets/@material/button/_mixins.scss +166 -14
  7. data/vendor/assets/stylesheets/@material/{animation/mdc-animation.scss → button/_variables.scss} +2 -19
  8. data/vendor/assets/stylesheets/@material/button/mdc-button.scss +22 -160
  9. data/vendor/assets/stylesheets/@material/card/mdc-card.scss +12 -13
  10. data/vendor/assets/stylesheets/@material/checkbox/_keyframes.scss +3 -3
  11. data/vendor/assets/stylesheets/@material/checkbox/mdc-checkbox.scss +9 -10
  12. data/vendor/assets/stylesheets/@material/dialog/mdc-dialog.scss +12 -17
  13. data/vendor/assets/stylesheets/@material/drawer/_mixins.scss +5 -5
  14. data/vendor/assets/stylesheets/@material/fab/_mixins.scss +42 -6
  15. data/vendor/assets/stylesheets/@material/{animation/_mixins.scss → fab/_variables.scss} +1 -19
  16. data/vendor/assets/stylesheets/@material/fab/mdc-fab.scss +6 -8
  17. data/vendor/assets/stylesheets/@material/grid-list/mdc-grid-list.scss +9 -9
  18. data/vendor/assets/stylesheets/@material/icon-toggle/mdc-icon-toggle.scss +4 -4
  19. data/vendor/assets/stylesheets/@material/layout-grid/_mixins.scss +8 -15
  20. data/vendor/assets/stylesheets/@material/linear-progress/mdc-linear-progress.scss +5 -5
  21. data/vendor/assets/stylesheets/@material/radio/mdc-radio.scss +6 -6
  22. data/vendor/assets/stylesheets/@material/ripple/_keyframes.scss +3 -3
  23. data/vendor/assets/stylesheets/@material/ripple/_mixins.scss +16 -1
  24. data/vendor/assets/stylesheets/@material/ripple/mdc-ripple.scss +0 -16
  25. data/vendor/assets/stylesheets/@material/rtl/_mixins.scss +1 -3
  26. data/vendor/assets/stylesheets/@material/select/mdc-select.scss +18 -25
  27. data/vendor/assets/stylesheets/@material/slider/mdc-slider.scss +1 -1
  28. data/vendor/assets/stylesheets/@material/snackbar/mdc-snackbar.scss +18 -14
  29. data/vendor/assets/stylesheets/@material/switch/mdc-switch.scss +8 -9
  30. data/vendor/assets/stylesheets/@material/textfield/mdc-textfield.scss +8 -9
  31. data/vendor/assets/stylesheets/@material/theme/_functions.scss +3 -9
  32. data/vendor/assets/stylesheets/@material/theme/_mixins.scss +5 -15
  33. data/vendor/assets/stylesheets/@material/toolbar/_mixins.scss +6 -6
  34. data/vendor/assets/stylesheets/@material/toolbar/mdc-toolbar.scss +7 -7
  35. data/vendor/assets/stylesheets/_material-components-web.scss +0 -1
  36. metadata +4 -4
@@ -1,12 +1,12 @@
1
- //
1
+ //
2
2
  // Copyright 2016 Google Inc. All Rights Reserved.
3
- //
3
+ //
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // you may not use this file except in compliance with the License.
6
6
  // You may obtain a copy of the License at
7
- //
7
+ //
8
8
  // http://www.apache.org/licenses/LICENSE-2.0
9
- //
9
+ //
10
10
  // Unless required by applicable law or agreed to in writing, software
11
11
  // distributed under the License is distributed on an "AS IS" BASIS,
12
12
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -26,8 +26,8 @@
26
26
  display: flex;
27
27
  flex-direction: column;
28
28
  justify-content: flex-end;
29
- padding: 0;
30
29
  box-sizing: border-box;
30
+ padding: 0;
31
31
  border-radius: 2px;
32
32
  overflow: hidden;
33
33
 
@@ -46,12 +46,12 @@
46
46
  }
47
47
 
48
48
  &__supporting-text {
49
- padding: 8px 16px;
50
- box-sizing: border-box;
51
-
52
49
  @include mdc-typography(body1);
53
50
  @include mdc-theme-prop(color, text-primary-on-light);
54
51
 
52
+ box-sizing: border-box;
53
+ padding: 8px 16px;
54
+
55
55
  @include mdc-theme-dark(".mdc-card") {
56
56
  @include mdc-theme-prop(color, text-primary-on-dark);
57
57
  }
@@ -70,8 +70,8 @@
70
70
 
71
71
  &__actions {
72
72
  display: flex;
73
- padding: 8px;
74
73
  box-sizing: border-box;
74
+ padding: 8px;
75
75
 
76
76
  // Adjust text color for dark theme.
77
77
  @include mdc-theme-dark(".mdc-card") {
@@ -110,8 +110,8 @@
110
110
  display: flex;
111
111
  flex-direction: column;
112
112
  justify-content: flex-end;
113
- padding: 16px;
114
113
  box-sizing: border-box;
114
+ padding: 16px;
115
115
  }
116
116
 
117
117
  &__media-item {
@@ -161,14 +161,13 @@
161
161
  }
162
162
 
163
163
  &__horizontal-block {
164
+ @include mdc-rtl-reflexive-property(padding, 0, 16px);
165
+
164
166
  display: flex;
165
167
  flex-direction: row;
166
168
  align-items: flex-start;
167
169
  justify-content: space-between;
168
170
  box-sizing: border-box;
169
- padding: 0;
170
-
171
- @include mdc-rtl-reflexive-property(padding, 0, 16px);
172
171
 
173
172
  // postcss-bem-linter: ignore
174
173
  .mdc-card__actions--vertical {
@@ -126,9 +126,9 @@
126
126
 
127
127
  @keyframes mdc-checkbox-indeterminate-checked-checkmark {
128
128
  from {
129
+ animation-timing-function: $_mdc-checkbox-indeterminate-checked-easing-function;
129
130
  transform: rotate(45deg);
130
131
  opacity: 0;
131
- animation-timing-function: $_mdc-checkbox-indeterminate-checked-easing-function;
132
132
  }
133
133
 
134
134
  to {
@@ -152,9 +152,9 @@
152
152
 
153
153
  @keyframes mdc-checkbox-indeterminate-checked-mixedmark {
154
154
  from {
155
+ animation-timing-function: $_mdc-checkbox-indeterminate-checked-easing-function;
155
156
  transform: rotate(0deg);
156
157
  opacity: 1;
157
- animation-timing-function: $_mdc-checkbox-indeterminate-checked-easing-function;
158
158
  }
159
159
 
160
160
  to {
@@ -165,9 +165,9 @@
165
165
 
166
166
  @keyframes mdc-checkbox-indeterminate-unchecked-mixedmark {
167
167
  0% {
168
+ animation-timing-function: linear;
168
169
  transform: scaleX(1);
169
170
  opacity: 1;
170
- animation-timing-function: linear;
171
171
  }
172
172
 
173
173
  32.8%,
@@ -44,8 +44,8 @@
44
44
 
45
45
  display: inline-block;
46
46
  position: relative;
47
- box-sizing: content-box;
48
47
  flex: 0 0 $mdc-checkbox-size;
48
+ box-sizing: content-box;
49
49
  width: $mdc-checkbox-size;
50
50
  height: $mdc-checkbox-size;
51
51
  padding: ($mdc-checkbox-touch-area - $mdc-checkbox-size) / 2;
@@ -80,7 +80,6 @@
80
80
  align-items: center;
81
81
  justify-content: center;
82
82
  box-sizing: border-box;
83
- pointer-events: none;
84
83
  width: $mdc-checkbox-ui-pct;
85
84
  height: $mdc-checkbox-ui-pct;
86
85
  transition:
@@ -89,6 +88,7 @@
89
88
  border: $mdc-checkbox-border-width solid $mdc-checkbox-border-color;
90
89
  border-radius: 2px;
91
90
  background-color: transparent;
91
+ pointer-events: none;
92
92
  will-change: background-color, border-color;
93
93
 
94
94
  @include mdc-theme-dark(".mdc-checkbox") {
@@ -98,18 +98,17 @@
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
102
 
102
103
  width: 100%;
103
104
  height: 100%;
104
105
  transform: scale(0, 0);
105
106
  transition: mdc-checkbox-transition-exit(opacity), mdc-checkbox-transition-exit(transform);
106
107
  border-radius: 50%;
107
- content: "";
108
108
  opacity: 0;
109
109
  pointer-events: none;
110
+ content: "";
110
111
  will-change: opacity, transform;
111
-
112
- @include mdc-theme-prop(background, primary);
113
112
  }
114
113
  }
115
114
 
@@ -121,8 +120,8 @@
121
120
  height: 100%;
122
121
  margin: 0;
123
122
  padding: 0;
124
- cursor: inherit;
125
123
  opacity: 0;
124
+ cursor: inherit;
126
125
  }
127
126
 
128
127
  &__checkmark {
@@ -130,8 +129,8 @@
130
129
 
131
130
  width: 100%;
132
131
  transition: mdc-checkbox-transition-exit(opacity, 0ms, $mdc-checkbox-transition-duration * 2);
133
- opacity: 0;
134
132
  fill: $mdc-checkbox-mark-color;
133
+ opacity: 0;
135
134
 
136
135
  &__path {
137
136
  transition:
@@ -171,13 +170,13 @@
171
170
 
172
171
  .mdc-checkbox__native-control:checked {
173
172
  ~ .mdc-checkbox__background {
173
+ @include mdc-theme-prop(border-color, primary);
174
+ @include mdc-theme-prop(background-color, primary);
175
+
174
176
  transition:
175
177
  mdc-checkbox-transition-enter(border-color),
176
178
  mdc-checkbox-transition-enter(background-color);
177
179
 
178
- @include mdc-theme-prop(border-color, primary);
179
- @include mdc-theme-prop(background-color, primary);
180
-
181
180
  .mdc-checkbox__checkmark {
182
181
  transition:
183
182
  mdc-checkbox-transition-enter(opacity, 0ms, $mdc-checkbox-transition-duration * 2),
@@ -42,6 +42,8 @@ $mdc-dialog-dark-theme-bg-color: #303030 !default;
42
42
  z-index: 5;
43
43
 
44
44
  &__backdrop {
45
+ @include mdc-theme-prop(background-color, text-primary-on-light);
46
+
45
47
  position: fixed;
46
48
  top: 0;
47
49
  left: 0;
@@ -49,26 +51,22 @@ $mdc-dialog-dark-theme-bg-color: #303030 !default;
49
51
  justify-content: center;
50
52
  width: 100%;
51
53
  height: 100%;
52
-
53
- @include mdc-theme-prop(background-color, text-primary-on-light);
54
-
55
54
  opacity: 0;
56
55
  z-index: -1;
57
56
  }
58
57
 
59
58
  &__surface {
60
- display: inline-flex;
61
- flex-direction: column;
62
-
63
59
  @include mdc-elevation(24);
60
+ @include mdc-theme-prop(background-color, background);
64
61
 
62
+ display: inline-flex;
63
+ flex-direction: column;
65
64
  width: calc(100% - 30px);
66
65
  min-width: 640px;
67
66
  max-width: 865px;
68
67
  transform: translateY(150px) scale(.8);
69
68
  border-radius: 2px;
70
-
71
- @include mdc-theme-prop(background-color, background);
69
+ opacity: 0;
72
70
 
73
71
  @include mdc-theme-dark(".mdc-dialog") {
74
72
  @include mdc-theme-prop(color, text-primary-on-dark);
@@ -80,8 +78,6 @@ $mdc-dialog-dark-theme-bg-color: #303030 !default;
80
78
  @include mdc-rtl(".mdc-dialog") {
81
79
  text-align: right;
82
80
  }
83
-
84
- opacity: 0;
85
81
  }
86
82
 
87
83
  &__header {
@@ -98,31 +94,30 @@ $mdc-dialog-dark-theme-bg-color: #303030 !default;
98
94
  }
99
95
 
100
96
  &__title {
97
+ @include mdc-typography(title);
98
+
101
99
  flex: 1;
102
100
  margin: 0;
103
-
104
- @include mdc-typography(title);
105
101
  }
106
102
  }
107
103
 
108
104
  &__body {
105
+ @include mdc-theme-prop(color, text-secondary-on-light);
106
+ @include mdc-typography(body1);
107
+
109
108
  margin-top: 20px;
110
109
  padding: 0 24px 24px;
111
110
 
112
- @include mdc-theme-prop(color, text-secondary-on-light);
113
-
114
111
  @include mdc-theme-dark(".mdc-dialog", true) {
115
112
  @include mdc-theme-prop(color, text-secondary-on-dark);
116
113
  }
117
114
 
118
- @include mdc-typography(body1);
119
-
120
115
  &--scrollable {
121
116
  max-height: 195px;
122
117
  border-top: 1px solid rgba(0, 0, 0, .1);
123
118
  border-bottom: 1px solid rgba(0, 0, 0, .1);
124
- overflow-y: scroll;
125
119
  overflow-x: auto;
120
+ overflow-y: scroll;
126
121
  -webkit-overflow-scrolling: touch;
127
122
  }
128
123
  }
@@ -26,10 +26,10 @@
26
26
  flex-direction: row;
27
27
  flex-shrink: 0;
28
28
  align-items: flex-center;
29
+ box-sizing: border-box;
29
30
  height: 56px;
30
31
  padding: 16px;
31
32
  border-bottom: 1px solid rgba(0, 0, 0, .12);
32
- box-sizing: border-box;
33
33
 
34
34
  @include mdc-theme-dark(quote(#{&})) {
35
35
  border-bottom: 1px solid rgba(255, 255, 255, .12);
@@ -64,8 +64,8 @@
64
64
  bottom: 0;
65
65
  left: 0;
66
66
  align-items: flex-end;
67
- padding: 16px;
68
67
  box-sizing: border-box;
68
+ padding: 16px;
69
69
  }
70
70
  // stylelint-enable selector-max-type
71
71
  }
@@ -78,14 +78,14 @@
78
78
  }
79
79
 
80
80
  .mdc-list-item {
81
+ @include mdc-typography(body2);
82
+
81
83
  position: relative;
82
84
  padding: 0 16px;
83
85
  outline: none;
84
86
  color: inherit;
85
87
  text-decoration: none;
86
88
 
87
- @include mdc-typography(body2);
88
-
89
89
  // Remove the 16px left offset since we already expand the padding of the list item to take up
90
90
  // the width of the drawer.
91
91
  &.mdc-ripple-upgraded {
@@ -118,8 +118,8 @@
118
118
  transition: mdc-animation-exit-temporary(opacity, 120ms);
119
119
  border-radius: inherit;
120
120
  background: currentColor;
121
- content: "";
122
121
  opacity: 0;
122
+ content: "";
123
123
  }
124
124
 
125
125
  .mdc-list-item:focus::before {
@@ -12,11 +12,27 @@
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
 
15
- @import "@material/animation/functions";
16
15
  @import "@material/animation/variables";
17
16
  @import "@material/elevation/mixins";
17
+ @import "@material/elevation/variables";
18
18
  @import "@material/ripple/mixins";
19
+ @import "@material/theme/functions";
19
20
  @import "@material/theme/mixins";
21
+ @import "./variables";
22
+
23
+ @mixin mdc-fab-accessible($container-color) {
24
+ @include mdc-fab-container-color($container-color);
25
+ // Calculate whether to use dark or light text on top of given color.
26
+ $light-or-dark-text: mdc-theme-light-or-dark($container-color);
27
+
28
+ @if ($light-or-dark-text == "light") {
29
+ @include mdc-fab-ink-color(text-primary-on-dark);
30
+ @include mdc-fab-ripple($mdc-fab-light-ripple-config);
31
+ } @else {
32
+ @include mdc-fab-ink-color(text-primary-on-light);
33
+ @include mdc-fab-ripple(()); //default dark ripple
34
+ }
35
+ }
20
36
 
21
37
  @mixin mdc-fab-container-color($color) {
22
38
  @include mdc-theme-prop(background-color, $color);
@@ -31,28 +47,33 @@
31
47
  @include mdc-ripple-fg(map-merge((pseudo: "::after"), $ripple-config));
32
48
  }
33
49
 
50
+ $mdc-fab-icon-enter-delay_: 90ms;
51
+ $mdc-fab-icon-enter-duration_: 180ms;
52
+
34
53
  @mixin mdc-fab-base_ {
35
54
  @include mdc-ripple-base;
55
+ @include mdc-elevation(6);
36
56
 
37
57
  display: inline-flex;
38
58
  position: relative;
39
59
  justify-content: center;
60
+ box-sizing: border-box;
40
61
  width: 56px;
41
62
  height: 56px;
42
63
  padding: 0;
43
- transition: box-shadow 280ms $mdc-animation-standard-curve-timing-function;
64
+ transition:
65
+ box-shadow $mdc-elevation-transition-duration $mdc-elevation-transition-timing-function,
66
+ opacity 15ms linear 30ms,
67
+ mdc-animation-enter(transform, $mdc-fab-icon-enter-duration_ + $mdc-fab-icon-enter-delay_);
44
68
  border: none;
45
69
  border-radius: 50%;
70
+ fill: currentColor;
46
71
  cursor: pointer;
47
72
  user-select: none;
48
- box-sizing: border-box;
49
- fill: currentColor;
50
73
  -moz-appearance: none;
51
74
  -webkit-appearance: none;
52
75
  overflow: hidden;
53
76
 
54
- @include mdc-elevation(6);
55
-
56
77
  &:active {
57
78
  @include mdc-elevation(12);
58
79
  }
@@ -96,4 +117,19 @@
96
117
  align-items: center;
97
118
  justify-content: center;
98
119
  width: 100%;
120
+ transition: mdc-animation-enter(transform, $mdc-fab-icon-enter-duration_, $mdc-fab-icon-enter-delay_);
121
+ will-change: transform;
122
+ }
123
+
124
+ @mixin mdc-fab--exited_ {
125
+ transform: scale(0);
126
+ transition:
127
+ opacity 15ms linear 150ms,
128
+ mdc-animation-exit-permanent(transform, 180ms);
129
+ opacity: 0;
130
+
131
+ .mdc-fab__icon {
132
+ transform: scale(0);
133
+ transition: mdc-animation-exit-permanent(transform, 135ms);
134
+ }
99
135
  }
@@ -1,4 +1,3 @@
1
- //
2
1
  // Copyright 2017 Google Inc. All Rights Reserved.
3
2
  //
4
3
  // Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,22 +11,5 @@
12
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
12
  // See the License for the specific language governing permissions and
14
13
  // limitations under the License.
15
- //
16
-
17
- @import "./variables";
18
-
19
- @mixin mdc-animation-deceleration-curve {
20
- animation-timing-function: $mdc-animation-deceleration-curve-timing-function;
21
- }
22
-
23
- @mixin mdc-animation-standard-curve {
24
- animation-timing-function: $mdc-animation-standard-curve-timing-function;
25
- }
26
-
27
- @mixin mdc-animation-acceleration-curve {
28
- animation-timing-function: $mdc-animation-acceleration-curve-timing-function;
29
- }
30
14
 
31
- @mixin mdc-animation-sharp-curve {
32
- animation-timing-function: $mdc-animation-sharp-curve-timing-function;
33
- }
15
+ $mdc-fab-light-ripple-config: (base-color: white, opacity: .16);
@@ -12,8 +12,8 @@
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
 
15
- @import "@material/theme/variables";
16
15
  @import "./mixins";
16
+ @import "./variables";
17
17
 
18
18
  // postcss-bem-linter: define fab
19
19
 
@@ -21,19 +21,13 @@
21
21
  @include mdc-fab-base_;
22
22
  @include mdc-fab-container-color(secondary);
23
23
  @include mdc-fab-ink-color(text-primary-on-secondary);
24
- @include mdc-fab-ripple((base-color: white, opacity: .16));
24
+ @include mdc-fab-ripple($mdc-fab-light-ripple-config);
25
25
 
26
26
  &:not(.mdc-ripple-upgraded) {
27
27
  -webkit-tap-highlight-color: rgba(0, 0, 0, .18);
28
28
  }
29
29
  }
30
30
 
31
- .mdc-fab--plain {
32
- @include mdc-fab-container-color(white);
33
- @include mdc-fab-ink-color(text-primary-on-light);
34
- @include mdc-fab-ripple(()); // default dark ripple
35
- }
36
-
37
31
  .mdc-fab--mini {
38
32
  @include mdc-fab--mini_;
39
33
  }
@@ -42,4 +36,8 @@
42
36
  @include mdc-fab__icon_;
43
37
  }
44
38
 
39
+ .mdc-fab--exited {
40
+ @include mdc-fab--exited_;
41
+ }
42
+
45
43
  // postcss-bem-linter: end