material_components_web-sass 0.14.0.1 → 0.15.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.
@@ -19,7 +19,6 @@
19
19
  @import "@material/elevation/mixins";
20
20
  @import "@material/ripple/mixins";
21
21
  @import "@material/theme/mixins";
22
- @import "@material/typography/mixins";
23
22
 
24
23
  // postcss-bem-linter: define button
25
24
 
@@ -27,7 +26,6 @@
27
26
  @include mdc-ripple-base;
28
27
  @include mdc-ripple-bg((pseudo: "::before"));
29
28
  @include mdc-ripple-fg((pseudo: "::after"));
30
- @include mdc-typography(body2);
31
29
  @include mdc-theme-prop(color, text-primary-on-light);
32
30
 
33
31
  display: inline-block;
@@ -39,9 +37,10 @@
39
37
  border-radius: 2px;
40
38
  outline: none;
41
39
  background: transparent;
42
- font-size: 14px; // Override font to specifically be px as spec defined pt
40
+ font-size: 14px;
43
41
  font-weight: 500;
44
- line-height: 36px; // Override line-height so text aligns centered
42
+ letter-spacing: .04em;
43
+ line-height: 36px;
45
44
  text-align: center;
46
45
  text-decoration: none;
47
46
  text-transform: uppercase;
@@ -56,7 +56,7 @@
56
56
  // Span classes.
57
57
  // stylelint-disable max-nesting-depth
58
58
  @at-root .mdc-layout-grid__cell--span-#{$span},
59
- .mdc-layout-grid__cell--span-#{$span}-#{$size}.mdc-layout-grid__cell--span-#{$span}-#{$size} {
59
+ .mdc-layout-grid__cell--span-#{$span}-#{$size} {
60
60
  @include mdc-layout-grid-cell-span_($size, $span, $gutter);
61
61
  }
62
62
  // stylelint-enable max-nesting-depth
@@ -97,4 +97,13 @@
97
97
  }
98
98
  }
99
99
 
100
+ .mdc-layout-grid--align-left {
101
+ margin-right: auto;
102
+ margin-left: 0;
103
+ }
104
+
105
+ .mdc-layout-grid--align-right {
106
+ margin-right: 0;
107
+ margin-left: auto;
108
+ }
100
109
  // postcss-bem-linter: end
@@ -15,6 +15,7 @@
15
15
  //
16
16
 
17
17
  @import "@material/theme/mixins";
18
+ @import "@material/typography/mixins";
18
19
  @import "@material/rtl/mixins";
19
20
  @import "./variables";
20
21
 
@@ -77,6 +78,50 @@ $mdc-slider-dark-theme-grey: #5c5c5c;
77
78
  }
78
79
  }
79
80
 
81
+ &__track-marker-container {
82
+ display: flex;
83
+ margin-right: 0;
84
+ margin-left: -1px;
85
+ visibility: hidden;
86
+
87
+ @include mdc-rtl(".mdc-slider") {
88
+ margin-right: -1px;
89
+ margin-left: 0;
90
+ }
91
+
92
+ &::after {
93
+ display: block;
94
+ width: 2px;
95
+ height: 2px;
96
+ background-color: $mdc-slider-dark-theme-grey;
97
+ content: "";
98
+
99
+ @include mdc-theme-dark(".mdc-slider", true) {
100
+ background-color: $mdc-slider-main-grey;
101
+ }
102
+ }
103
+ }
104
+
105
+ &__track-marker {
106
+ flex: 1;
107
+
108
+ &::after {
109
+ display: block;
110
+ width: 2px;
111
+ height: 2px;
112
+ background-color: $mdc-slider-dark-theme-grey;
113
+ content: "";
114
+
115
+ @include mdc-theme-dark(".mdc-slider", true) {
116
+ background-color: $mdc-slider-main-grey;
117
+ }
118
+ }
119
+
120
+ &:first-child::after {
121
+ width: 3px;
122
+ }
123
+ }
124
+
80
125
  &__thumb-container {
81
126
  position: absolute;
82
127
  top: 15px;
@@ -109,6 +154,37 @@ $mdc-slider-dark-theme-grey: #5c5c5c;
109
154
  border-radius: 50%;
110
155
  opacity: 0;
111
156
  }
157
+
158
+ &__pin {
159
+ @include mdc-theme-prop(background-color, primary);
160
+ @include mdc-theme-prop(color, text-primary-on-primary);
161
+
162
+ display: flex;
163
+ position: absolute;
164
+ top: 0;
165
+ left: 0;
166
+ align-items: center;
167
+ justify-content: center;
168
+ width: 26px;
169
+ height: 26px;
170
+ margin-top: -2px;
171
+ margin-left: -2px;
172
+ transform: rotate(-45deg) scale(0) translate(0, 0);
173
+ transition: transform 100ms ease-out;
174
+ border-radius: 50% 50% 50% 0%;
175
+
176
+ /**
177
+ * Ensuring that the pin is higher than the thumb in the stacking order
178
+ * removes some rendering jank observed in Chrome.
179
+ */
180
+ z-index: 1;
181
+ }
182
+
183
+ &__pin-value-marker {
184
+ @include mdc-typography(caption);
185
+
186
+ transform: rotate(45deg);
187
+ }
112
188
  }
113
189
 
114
190
  .mdc-slider--active {
@@ -172,6 +248,14 @@ $mdc-slider-dark-theme-grey: #5c5c5c;
172
248
  }
173
249
  }
174
250
 
251
+ .mdc-slider__pin {
252
+ background-color: $mdc-slider-main-grey;
253
+
254
+ @include mdc-theme-dark(".mdc-slider", true) {
255
+ background-color: $mdc-slider-dark-theme-grey;
256
+ }
257
+ }
258
+
175
259
  // stylelint-disable plugin/selector-bem-pattern
176
260
  &.mdc-slider--focus {
177
261
  .mdc-slider__thumb {
@@ -223,4 +307,35 @@ $mdc-slider-dark-theme-grey: #5c5c5c;
223
307
  }
224
308
  }
225
309
 
310
+ .mdc-slider--discrete {
311
+ // stylelint-disable plugin/selector-bem-pattern
312
+ &.mdc-slider--active {
313
+ .mdc-slider__thumb {
314
+ transform: scale(calc(12 / 21));
315
+ }
316
+
317
+ .mdc-slider__pin {
318
+ transform: rotate(-45deg) scale(1) translate(19px, -20px);
319
+ }
320
+ }
321
+
322
+ &.mdc-slider--focus {
323
+ .mdc-slider__thumb {
324
+ animation: none;
325
+ }
326
+
327
+ .mdc-slider__focus-ring {
328
+ transform: none;
329
+ opacity: 0;
330
+ }
331
+ }
332
+
333
+ &.mdc-slider--display-markers {
334
+ .mdc-slider__track-marker-container {
335
+ visibility: visible;
336
+ }
337
+ }
338
+ // stylelint-enable plugin/selector-bem-pattern
339
+ }
340
+
226
341
  // postcss-bem-linter: end
@@ -16,6 +16,7 @@
16
16
 
17
17
  // Hard coded since the color is not present in any palette.
18
18
  $mdc-snackbar-background-color: #323232;
19
+ $mdc-snackbar-background-color-on-dark: #fafafa;
19
20
  $mdc-snackbar-foreground-color: white;
20
21
  // TODO: Better spot to pull this breakpoint?
21
22
  //$snackbar-tablet-breakpoint: $grid-tablet-breakpoint;
@@ -30,31 +30,60 @@
30
30
  justify-content: flex-start;
31
31
  padding-right: 24px;
32
32
  padding-left: 24px;
33
- transform: translate(0, 100%);
33
+ transform: translate(-50%, 100%);
34
34
  transition: mdc-animation-exit(transform, .25s);
35
35
  background-color: $mdc-snackbar-background-color;
36
+
37
+ @include mdc-theme-dark(".mdc-snackbar") {
38
+ background-color: $mdc-snackbar-background-color-on-dark;
39
+ }
40
+
36
41
  will-change: transform;
37
42
  pointer-events: none;
38
43
 
39
44
  @media (max-width: ($mdc-snackbar-tablet-breakpoint - 1)) {
40
45
  left: 0;
41
46
  width: calc(100% - 48px);
47
+ transform: translate(0, 100%);
42
48
  }
43
49
 
44
50
  @media (min-width: $mdc-snackbar-tablet-breakpoint) {
45
51
  min-width: 288px;
46
52
  max-width: 568px;
47
- transform: translate(-50%, 100%);
48
53
  border-radius: 2px;
49
54
  }
50
55
 
56
+ &--align-start {
57
+ @media (min-width: $mdc-snackbar-tablet-breakpoint) {
58
+ bottom: 24px;
59
+
60
+ @include mdc-rtl-reflexive-position(left, 24px);
61
+
62
+ transform: translate(0, 200%);
63
+ }
64
+
65
+ @media (max-width: ($mdc-snackbar-tablet-breakpoint - 1)) {
66
+ bottom: 0;
67
+ left: 0;
68
+ width: calc(100% - 48px);
69
+ transform: translate(0, 100%);
70
+ }
71
+ }
72
+
51
73
  &--active {
52
- transform: translate(0, 0);
74
+ transform: translate(0);
53
75
  pointer-events: auto;
54
76
  transition: mdc-animation-enter(transform, .25s);
55
77
 
56
- @media (min-width: $mdc-snackbar-tablet-breakpoint) {
78
+ &:not(.mdc-snackbar--align-start) {
57
79
  transform: translate(-50%, 0);
80
+
81
+ @media (max-width: ($mdc-snackbar-tablet-breakpoint - 1)) {
82
+ bottom: 0;
83
+ left: 0;
84
+ width: calc(100% - 48px);
85
+ transform: translate(0);
86
+ }
58
87
  }
59
88
  }
60
89
 
@@ -84,6 +113,11 @@
84
113
  height: 48px;
85
114
  transition: mdc-animation-exit(opacity, .3s);
86
115
  color: $mdc-snackbar-foreground-color;
116
+
117
+ @include mdc-theme-dark(".mdc-snackbar") {
118
+ @include mdc-theme-prop(color, text-primary-on-light);
119
+ }
120
+
87
121
  opacity: 0;
88
122
  }
89
123
 
@@ -99,6 +133,11 @@
99
133
 
100
134
  &__action-button {
101
135
  @include mdc-theme-prop(color, accent);
136
+
137
+ @include mdc-theme-dark(".mdc-snackbar") {
138
+ @include mdc-theme-prop(color, primary);
139
+ }
140
+
102
141
  @include mdc-rtl-reflexive-box(margin, right, -16px, ".mdc-snackbar");
103
142
 
104
143
  min-width: auto;
@@ -79,7 +79,7 @@
79
79
 
80
80
  align-self: center;
81
81
  margin: 0;
82
- margin-left: 16px;
82
+ margin-left: 24px;
83
83
  padding: $mdc-toobar-element-vertical-padding 0;
84
84
  line-height: 1.5rem;
85
85
  text-overflow: ellipsis;
@@ -93,9 +93,33 @@
93
93
  @include mdc-theme-prop(color, text-primary-on-primary);
94
94
  }
95
95
 
96
+ &__icon:last-child {
97
+ padding-right: 16px;
98
+ }
99
+
96
100
  &__icon--menu {
97
101
  @include mdc-shared-icon-style(menu);
98
102
  @include mdc-theme-prop(color, text-primary-on-primary);
103
+
104
+ padding: 16px 24px;
105
+ }
106
+ }
107
+
108
+ .mdc-toolbar__icon--menu + .mdc-toolbar__title {
109
+ margin-left: 8px;
110
+ }
111
+
112
+ @media (max-width: $mdc-toolbar-mobile-breakpoint) {
113
+ .mdc-toolbar__icon--menu {
114
+ padding: 16px;
115
+ }
116
+
117
+ .mdc-toolbar__icon:last-child {
118
+ padding: 16px 8px;
119
+ }
120
+
121
+ .mdc-toolbar__title {
122
+ margin-left: 16px !important;
99
123
  }
100
124
  }
101
125
 
@@ -103,7 +127,7 @@
103
127
  position: fixed;
104
128
  top: 0;
105
129
  left: 0;
106
- z-index: 1;
130
+ z-index: 4;
107
131
 
108
132
  @include mdc-elevation(4);
109
133
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: material_components_web-sass
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0.1
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmitriy Tarasov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-28 00:00:00.000000000 Z
11
+ date: 2017-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: autoprefixer-rails