material_components_web-sass 0.17.0 → 0.18.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 (28) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/lib/material_components_web/sass/version.rb +1 -1
  4. data/vendor/assets/javascripts/material-components-web.js +1207 -1035
  5. data/vendor/assets/stylesheets/@material/button/mdc-button.scss +91 -110
  6. data/vendor/assets/stylesheets/@material/dialog/mdc-dialog.scss +2 -2
  7. data/vendor/assets/stylesheets/@material/drawer/permanent/mdc-permanent-drawer.scss +1 -1
  8. data/vendor/assets/stylesheets/@material/drawer/persistent/mdc-persistent-drawer.scss +1 -1
  9. data/vendor/assets/stylesheets/@material/drawer/slidable/_mixins.scss +15 -15
  10. data/vendor/assets/stylesheets/@material/drawer/slidable/_variables.scss +15 -15
  11. data/vendor/assets/stylesheets/@material/fab/mdc-fab.scss +2 -2
  12. data/vendor/assets/stylesheets/@material/grid-list/mdc-grid-list.scss +3 -0
  13. data/vendor/assets/stylesheets/@material/icon-toggle/mdc-icon-toggle.scss +3 -3
  14. data/vendor/assets/stylesheets/@material/layout-grid/_variables.scss +1 -1
  15. data/vendor/assets/stylesheets/@material/layout-grid/mdc-layout-grid.scss +3 -3
  16. data/vendor/assets/stylesheets/@material/linear-progress/mdc-linear-progress.scss +1 -1
  17. data/vendor/assets/stylesheets/@material/ripple/mdc-ripple.scss +2 -2
  18. data/vendor/assets/stylesheets/@material/snackbar/mdc-snackbar.scss +1 -1
  19. data/vendor/assets/stylesheets/@material/tabs/tab-bar/mdc-tab-bar.scss +3 -3
  20. data/vendor/assets/stylesheets/@material/textfield/mdc-textfield.scss +1 -1
  21. data/vendor/assets/stylesheets/@material/theme/_color_palette.scss +290 -0
  22. data/vendor/assets/stylesheets/@material/theme/_constants.scss +10 -12
  23. data/vendor/assets/stylesheets/@material/theme/_functions.scss +6 -12
  24. data/vendor/assets/stylesheets/@material/theme/_mixins.scss +36 -40
  25. data/vendor/assets/stylesheets/@material/theme/_variables.scss +79 -17
  26. data/vendor/assets/stylesheets/@material/theme/mdc-theme.scss +4 -4
  27. data/vendor/assets/stylesheets/@material/toolbar/mdc-toolbar.scss +2 -2
  28. metadata +3 -2
@@ -17,62 +17,33 @@
17
17
  @import "@material/elevation/mixins";
18
18
  @import "@material/ripple/mixins";
19
19
  @import "@material/theme/mixins";
20
+ @import "@material/theme/variables";
20
21
  @import "@material/typography/mixins";
21
22
 
22
23
  // postcss-bem-linter: define button
23
-
24
24
  .mdc-button {
25
25
  @include mdc-ripple-base;
26
26
  @include mdc-ripple-bg((pseudo: "::before"));
27
27
  @include mdc-ripple-fg((pseudo: "::after"));
28
+ @include mdc-typography(button);
28
29
  @include mdc-theme-prop(color, text-primary-on-light);
29
- @include mdc-typography-base;
30
30
 
31
31
  display: inline-block;
32
32
  position: relative;
33
- min-width: 64px;
33
+ min-width: 88px;
34
34
  height: 36px;
35
35
  padding: 0 16px;
36
36
  border: none;
37
- border-radius: 2px;
37
+ border-radius: 4px;
38
+ box-sizing: border-box;
38
39
  outline: none;
39
40
  background: transparent;
40
- font-size: 14px;
41
- font-weight: 500;
42
- letter-spacing: .04em;
43
- line-height: 36px;
44
41
  text-align: center;
45
- text-decoration: none;
46
- text-transform: uppercase;
47
42
  overflow: hidden;
48
43
  vertical-align: middle;
49
44
  user-select: none;
50
- box-sizing: border-box;
51
45
  -webkit-appearance: none;
52
46
 
53
- &:not(.mdc-ripple-upgraded) {
54
- -webkit-tap-highlight-color: rgba(black, .18);
55
- }
56
-
57
- @include mdc-theme-dark {
58
- @include mdc-ripple-base;
59
- @include mdc-ripple-bg((pseudo: "::before", base-color: white, opacity: .14));
60
- @include mdc-ripple-fg((pseudo: "::after", base-color: white, opacity: .14));
61
- @include mdc-theme-prop(color, text-primary-on-dark);
62
-
63
- &:not(.mdc-ripple-upgraded) {
64
- -webkit-tap-highlight-color: rgba(white, .18);
65
- }
66
- }
67
-
68
- @each $theme-style in (primary, accent) {
69
- &.mdc-button--#{$theme-style} {
70
- @include mdc-ripple-base;
71
- @include mdc-ripple-bg((pseudo: "::before", theme-style: $theme-style, opacity: .12));
72
- @include mdc-ripple-fg((pseudo: "::after", theme-style: $theme-style, opacity: .12));
73
- }
74
- }
75
-
76
47
  // postcss-bem-linter: ignore
77
48
  &:active {
78
49
  outline: none;
@@ -87,110 +58,120 @@
87
58
  border: 0;
88
59
  }
89
60
 
90
- &--dense {
91
- height: 32px;
92
- font-size: .8125rem; // 13sp
93
- line-height: 32px;
61
+ &:not(.mdc-ripple-upgraded) {
62
+ -webkit-tap-highlight-color: rgba(black, .3);
94
63
  }
95
64
 
96
- // TODO(cristobalchao): Disable ink wash on hover and alter elevation instead for raised surfaces.
97
- &--raised {
98
- @include mdc-elevation(2);
99
- @include mdc-elevation-transition;
100
-
101
- min-width: 88px;
102
-
103
- &:active {
104
- @include mdc-elevation(8);
105
- }
106
-
107
- @each $theme-style in (primary, accent) {
108
- &.mdc-button--#{$theme-style} {
109
- @include mdc-ripple-base;
110
- @include mdc-ripple-bg((pseudo: "::before", base-color: white, opacity: .14));
111
- @include mdc-ripple-fg((pseudo: "::after", base-color: white, opacity: .14));
112
- }
113
- }
65
+ fieldset:disabled &,
66
+ &:disabled {
67
+ color: rgba(black, .38);
68
+ cursor: default;
69
+ pointer-events: none;
114
70
 
115
71
  @include mdc-theme-dark(".mdc-button") {
116
- @include mdc-theme-prop(background-color, primary);
117
- @include mdc-theme-prop(color, text-primary-on-primary);
118
-
119
- // postcss-bem-linter: ignore
120
- &::before {
121
- // We are explicitly not fully adhering to Material Design here.
122
- // This should be the 700-shade when active instead of a black shade.
123
- // Due to the complexity involved in adhering fully it is being ignored.
124
- // Instead re-using the existing architecture for shading works just fine.
125
- color: black;
126
- }
72
+ @include mdc-theme-prop(color, text-disabled-on-dark);
127
73
  }
128
74
  }
129
75
 
130
- &--primary {
131
- @include mdc-theme-prop(color, primary);
132
-
133
- @include mdc-theme-dark(".mdc-button") {
134
- @include mdc-theme-prop(color, primary);
135
- }
76
+ @include mdc-theme-dark(".mdc-button") {
77
+ @include mdc-ripple-base;
78
+ @include mdc-ripple-bg((pseudo: "::before", base-color: white, opacity: .16));
79
+ @include mdc-ripple-fg((pseudo: "::after", base-color: white, opacity: .16));
80
+ @include mdc-theme-prop(color, text-primary-on-dark);
136
81
 
137
- // postcss-bem-linter: ignore
138
- &.mdc-button--raised {
139
- @include mdc-theme-prop(background-color, primary);
140
- @include mdc-theme-prop(color, text-primary-on-primary);
141
-
142
- // postcss-bem-linter: ignore
143
- &::before {
144
- color: black;
145
- }
82
+ &:not(.mdc-ripple-upgraded) {
83
+ -webkit-tap-highlight-color: rgba(white, .18);
146
84
  }
147
85
  }
86
+ }
148
87
 
149
- &--accent {
150
- @include mdc-theme-prop(color, accent);
88
+ .mdc-button--raised {
89
+ @include mdc-elevation(2);
90
+ @include mdc-elevation-transition;
91
+ @include mdc-ripple-base;
92
+ @include mdc-ripple-bg((pseudo: "::before", base-color: white, opacity: .32));
93
+ @include mdc-ripple-fg((pseudo: "::after", base-color: white, opacity: .32));
94
+ @include mdc-theme-prop(color, text-primary-on-dark);
151
95
 
152
- @include mdc-theme-dark(".mdc-button") {
153
- @include mdc-theme-prop(color, accent);
154
- }
96
+ background-color: black;
155
97
 
156
- // postcss-bem-linter: ignore
157
- &.mdc-button--raised {
158
- @include mdc-theme-prop(background-color, accent);
159
- @include mdc-theme-prop(color, text-primary-on-accent);
160
-
161
- // postcss-bem-linter: ignore
162
- &::before {
163
- color: black;
164
- }
165
- }
98
+ &:hover,
99
+ &:focus {
100
+ @include mdc-elevation(4);
166
101
  }
167
102
 
168
- &--compact {
169
- padding: 0 8px;
103
+ &:active {
104
+ @include mdc-elevation(8);
170
105
  }
171
106
 
172
107
  fieldset:disabled &,
173
108
  &:disabled {
174
- color: rgba(0, 0, 0, .26);
175
- cursor: default;
176
- pointer-events: none;
109
+ @include mdc-elevation(0);
110
+ @include mdc-theme-prop(color, text-primary-on-dark);
111
+
112
+ background-color: rgba(black, .15);
177
113
 
178
114
  @include mdc-theme-dark(".mdc-button") {
179
- color: rgba(255, 255, 255, .3);
115
+ @include mdc-theme-prop(color, text-disabled-on-dark);
116
+
117
+ background-color: rgba(255, 255, 255, .15);
180
118
  }
181
119
  }
182
120
 
183
- fieldset:disabled &--raised,
184
- &--raised:disabled {
185
- @include mdc-elevation(0);
121
+ @include mdc-theme-dark(".mdc-button") {
122
+ @include mdc-ripple-base;
123
+ @include mdc-ripple-bg((pseudo: "::before", base-color: black, opacity: .32));
124
+ @include mdc-ripple-fg((pseudo: "::after", base-color: black, opacity: .32));
125
+ @include mdc-theme-prop(color, text-primary-on-light);
186
126
 
187
- background-color: rgba(0, 0, 0, .12);
188
- pointer-events: none;
127
+ background-color: white;
189
128
 
190
- @include mdc-theme-dark(".mdc-button") {
191
- background-color: rgba(255, 255, 255, .12);
129
+ &:not(.mdc-ripple-upgraded) {
130
+ -webkit-tap-highlight-color: rgba(black, .18);
192
131
  }
193
132
  }
194
133
  }
195
134
 
135
+ .mdc-button--compact {
136
+ padding: 0 8px;
137
+ }
138
+
139
+ .mdc-button--dense {
140
+ height: 32px;
141
+ font-size: .8125rem; // 13sp
142
+ line-height: 32px;
143
+ }
144
+
145
+ @each $theme-style in (primary, secondary) {
146
+ // Needed for backward compatibility. Theme uses the term "secondary", but button still calls it "accent" for now.
147
+ $modifier: if($theme-style == "secondary", "accent", $theme-style);
148
+
149
+ // postcss-bem-linter: ignore
150
+ .mdc-button--#{$modifier} {
151
+ $theme-value: map-get($mdc-theme-property-values, $theme-style);
152
+
153
+ @include mdc-ripple-base;
154
+ @include mdc-ripple-bg((pseudo: "::before", base-color: $theme-value, opacity: .16));
155
+ @include mdc-ripple-fg((pseudo: "::after", base-color: $theme-value, opacity: .16));
156
+ @include mdc-theme-prop(color, $theme-style);
157
+
158
+ @include mdc-theme-dark(".mdc-button") {
159
+ @include mdc-ripple-base;
160
+ @include mdc-ripple-bg((pseudo: "::before", base-color: $theme-value, opacity: .16));
161
+ @include mdc-ripple-fg((pseudo: "::after", base-color: $theme-value, opacity: .16));
162
+ @include mdc-theme-prop(color, $theme-style);
163
+ }
164
+ // postcss-bem-linter: ignore
165
+ &.mdc-button--raised,
166
+ &.mdc-button--unelevated {
167
+ $theme-value: map-get($mdc-theme-property-values, text-primary-on-#{$theme-style});
168
+
169
+ @include mdc-ripple-base;
170
+ @include mdc-ripple-bg((pseudo: "::before", base-color: $theme-value, opacity: .32));
171
+ @include mdc-ripple-fg((pseudo: "::after", base-color: $theme-value, opacity: .32));
172
+ @include mdc-theme-prop(background-color, $theme-style);
173
+ @include mdc-theme-prop(color, text-primary-on-#{$theme-style});
174
+ }
175
+ }
176
+ }
196
177
  // postcss-bem-linter: end
@@ -24,7 +24,7 @@
24
24
  $mdc-dialog-dark-theme-bg-color: #303030 !default;
25
25
 
26
26
  :root {
27
- --mdc-dialog-dark-theme-bg-color: $mdc-dialog-dark-theme-bg-color;
27
+ --mdc-dialog-dark-theme-bg-color: #{$mdc-dialog-dark-theme-bg-color};
28
28
  }
29
29
 
30
30
  // postcss-bem-linter: define dialog
@@ -143,7 +143,7 @@ $mdc-dialog-dark-theme-bg-color: #303030 !default;
143
143
  }
144
144
 
145
145
  &__action {
146
- @include mdc-theme-prop(color, accent);
146
+ @include mdc-theme-prop(color, secondary);
147
147
  }
148
148
  }
149
149
 
@@ -22,7 +22,7 @@ $mdc-permanent-drawer-width: 240px;
22
22
  $mdc-permanent-drawer-dark-theme-bg-color: #212121 !default;
23
23
 
24
24
  :root {
25
- --mdc-permanent-drawer-dark-theme-bg-color: $mdc-permanent-drawer-dark-theme-bg-color;
25
+ --mdc-permanent-drawer-dark-theme-bg-color: #{$mdc-permanent-drawer-dark-theme-bg-color};
26
26
  }
27
27
 
28
28
  .mdc-permanent-drawer {
@@ -24,7 +24,7 @@ $mdc-persistent-drawer-width: 240px;
24
24
  $mdc-persistent-drawer-dark-theme-bg-color: #212121 !default;
25
25
 
26
26
  :root {
27
- --mdc-persistent-drawer-dark-theme-bg-color: $mdc-persistent-drawer-dark-theme-bg-color;
27
+ --mdc-persistent-drawer-dark-theme-bg-color: #{$mdc-persistent-drawer-dark-theme-bg-color};
28
28
  }
29
29
 
30
30
  .mdc-persistent-drawer {
@@ -1,18 +1,18 @@
1
- /**
2
- * Copyright 2016 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
- */
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
16
 
17
17
  @import "@material/rtl/mixins";
18
18
 
@@ -1,18 +1,18 @@
1
- /**
2
- * Copyright 2016 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
- */
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
16
 
17
17
  $mdc-slidable-drawer-transition-close-time: .195s;
18
18
  $mdc-slidable-drawer-transition-open-time: .225s;
@@ -45,8 +45,8 @@
45
45
  -webkit-tap-highlight-color: rgba(0, 0, 0, .18);
46
46
  }
47
47
 
48
- @include mdc-theme-prop(background-color, accent);
49
- @include mdc-theme-prop(color, text-primary-on-accent);
48
+ @include mdc-theme-prop(background-color, secondary);
49
+ @include mdc-theme-prop(color, text-primary-on-secondary);
50
50
  @include mdc-elevation(6);
51
51
 
52
52
  &--mini {
@@ -129,6 +129,9 @@ $mdc-grid-list-tile-secondary-icon-size: 24px;
129
129
  .mdc-grid-tile {
130
130
  display: block;
131
131
  position: relative;
132
+
133
+ /* @alternate */
134
+ width: $mdc-grid-list-tile-width;
132
135
  width: var(--mdc-grid-list-tile-width, $mdc-grid-list-tile-width);
133
136
 
134
137
  &__primary {
@@ -81,9 +81,9 @@
81
81
  }
82
82
 
83
83
  .mdc-icon-toggle--accent {
84
- @include mdc-theme-prop(color, accent);
85
- @include mdc-ripple-bg((pseudo: "::before", theme-style: accent, opacity: .14));
86
- @include mdc-ripple-fg((pseudo: "::after", theme-style: accent, opacity: .14));
84
+ @include mdc-theme-prop(color, secondary);
85
+ @include mdc-ripple-bg((pseudo: "::before", theme-style: secondary, opacity: .14));
86
+ @include mdc-ripple-fg((pseudo: "::after", theme-style: secondary, opacity: .14));
87
87
  }
88
88
 
89
89
  .mdc-icon-toggle--disabled {
@@ -44,4 +44,4 @@ $mdc-layout-grid-column-width: (
44
44
 
45
45
  $mdc-layout-grid-default-column-span: 4 !default;
46
46
 
47
- $mdc-layout-grid-max-width: null;
47
+ $mdc-layout-grid-max-width: null !default;
@@ -17,9 +17,9 @@
17
17
 
18
18
  :root {
19
19
  @each $size in map-keys($mdc-layout-grid-columns) {
20
- --mdc-layout-grid-margin-#{$size}: map-get($mdc-layout-grid-default-margin, $size);
21
- --mdc-layout-grid-gutter-#{$size}: map-get($mdc-layout-grid-default-gutter, $size);
22
- --mdc-layout-grid-column-width-#{$size}: map-get($mdc-layout-grid-column-width, $size);
20
+ --mdc-layout-grid-margin-#{$size}: #{map-get($mdc-layout-grid-default-margin, $size)};
21
+ --mdc-layout-grid-gutter-#{$size}: #{map-get($mdc-layout-grid-default-gutter, $size)};
22
+ --mdc-layout-grid-column-width-#{$size}: #{map-get($mdc-layout-grid-column-width, $size)};
23
23
  }
24
24
  }
25
25
 
@@ -44,7 +44,7 @@
44
44
  }
45
45
 
46
46
  &--accent .mdc-linear-progress__bar-inner {
47
- @include mdc-theme-prop(background-color, accent);
47
+ @include mdc-theme-prop(background-color, secondary);
48
48
  }
49
49
 
50
50
  &__buffering-dots {
@@ -49,8 +49,8 @@
49
49
  @include mdc-theme-prop(background-color, primary);
50
50
  }
51
51
 
52
- @include mdc-ripple-bg((pseudo: "::before", theme-style: accent, opacity: .16));
53
- @include mdc-ripple-fg((pseudo: "::after", theme-style: accent, opacity: .16));
52
+ @include mdc-ripple-bg((pseudo: "::before", theme-style: secondary, opacity: .16));
53
+ @include mdc-ripple-fg((pseudo: "::after", theme-style: secondary, opacity: .16));
54
54
  }
55
55
  }
56
56