material_components_web-sass 0.3.0 → 0.4.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.
@@ -39,6 +39,7 @@
39
39
  font-weight: 500;
40
40
  line-height: 36px; // Override line-height so text aligns centered
41
41
  text-align: center;
42
+ text-decoration: none;
42
43
  text-transform: uppercase;
43
44
  vertical-align: middle;
44
45
  box-sizing: border-box;
@@ -1,24 +1,24 @@
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 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
+ //
16
16
 
17
17
  @import "@material/elevation/mixins";
18
18
  @import "@material/theme/mixins";
19
19
  @import "@material/typography/mixins";
20
20
 
21
- /* postcss-bem-linter: define card */
21
+ // postcss-bem-linter: define card
22
22
  .mdc-card {
23
23
  @include mdc-elevation(2);
24
24
 
@@ -31,12 +31,12 @@
31
31
  &__primary {
32
32
  padding: 16px;
33
33
 
34
- /* Add extra space before large title. */
34
+ // Add extra space before large title.
35
35
  .mdc-card__title--large {
36
36
  padding-top: 8px;
37
37
  }
38
38
 
39
- /* Add extra padding if this is the last block. */
39
+ // Add extra padding if this is the last block.
40
40
  &:last-child {
41
41
  padding-bottom: 24px;
42
42
  }
@@ -53,13 +53,13 @@
53
53
  @include mdc-theme-prop(color, text-primary-on-dark);
54
54
  }
55
55
 
56
- /* Remove top padding if immediately preceded by a primary block. */
56
+ // Remove top padding if immediately preceded by a primary block.
57
57
  .mdc-card__primary + & {
58
58
  margin-top: -8px;
59
59
  padding-top: 0;
60
60
  }
61
61
 
62
- /* Add extra padding if this is the last block. */
62
+ // Add extra padding if this is the last block.
63
63
  &:last-child {
64
64
  padding-bottom: 24px;
65
65
  }
@@ -70,12 +70,12 @@
70
70
  padding: 8px;
71
71
  box-sizing: border-box;
72
72
 
73
- /* Adjust text color for dark theme. */
73
+ // Adjust text color for dark theme.
74
74
  @include mdc-theme-dark(".mdc-card") {
75
75
  @include mdc-theme-prop(color, text-primary-on-dark);
76
76
  }
77
77
 
78
- /* Tweak button paddings and margins when they're used as actions */
78
+ // Tweak button paddings and margins when they're used as actions
79
79
  .mdc-card__action {
80
80
  margin: 0 8px 0 0;
81
81
  }
@@ -84,7 +84,7 @@
84
84
  margin-right: 0;
85
85
  }
86
86
 
87
- /* Vertical actions (one per line) */
87
+ // Vertical actions (one per line)
88
88
  &--vertical {
89
89
  flex-flow: column;
90
90
  align-items: flex-start;
@@ -127,12 +127,12 @@
127
127
  @include mdc-typography(body2);
128
128
  @include mdc-theme-prop(color, text-primary-on-background);
129
129
 
130
- /* Adjust text color for dark theme. */
130
+ // Adjust text color for dark theme.
131
131
  @include mdc-theme-dark(".mdc-card") {
132
132
  @include mdc-theme-prop(color, text-primary-on-dark);
133
133
  }
134
134
 
135
- margin: -.063rem 0; /* -1sp 0 */
135
+ margin: -.063rem 0; // -1sp 0
136
136
  }
137
137
 
138
138
  &__title--large {
@@ -145,12 +145,12 @@
145
145
  @include mdc-typography(body1);
146
146
  @include mdc-theme-prop(color, text-primary-on-background);
147
147
 
148
- /* Adjust text color for dark theme. */
148
+ // Adjust text color for dark theme.
149
149
  @include mdc-theme-dark(".mdc-card") {
150
150
  @include mdc-theme-prop(color, text-primary-on-dark);
151
151
  }
152
152
 
153
- margin: -.063rem 0; /* -1sp 0 */
153
+ margin: -.063rem 0; // -1sp 0
154
154
  }
155
155
 
156
156
  &__horizontal-block {
@@ -170,10 +170,11 @@
170
170
  margin-left: 16px;
171
171
  }
172
172
 
173
- &:last-child .mdc-card__media-item {
173
+ // postcss-bem-linter: ignore
174
+ .mdc-card__media-item--3x {
174
175
  margin-bottom: 16px;
175
176
  }
176
177
  }
177
178
  }
178
179
 
179
- /* postcss-bem-linter: end */
180
+ // postcss-bem-linter: end
@@ -20,7 +20,9 @@ $mdc-checkbox-border-color-dark: white !default;
20
20
  $mdc-checkbox-disabled-color: rgba(black, .26) !default;
21
21
  $mdc-checkbox-disabled-color-dark: rgba(white, .3) !default;
22
22
 
23
+ $mdc-checkbox-touch-area: 40px;
23
24
  $mdc-checkbox-size: 18px;
25
+ $mdc-checkbox-ui-pct: percentage($mdc-checkbox-size / $mdc-checkbox-touch-area);
24
26
  $mdc-checkbox-mark-stroke-size: 2/15 * $mdc-checkbox-size;
25
27
  $mdc-checkbox-border-width: 2px;
26
28
  $mdc-checkbox-transition-duration: 90ms;
@@ -1,20 +1,21 @@
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 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
+ //
16
16
 
17
17
  @import "@material/animation/functions";
18
+ @import "@material/ripple/mixins";
18
19
  @import "@material/animation/mixins";
19
20
  @import "./variables";
20
21
  @import "./keyframes";
@@ -40,20 +41,22 @@
40
41
  }
41
42
 
42
43
  @mixin mdc-checkbox-outer-box {
43
- border-radius: 2px;
44
-
45
44
  @include mdc-checkbox-cover-element;
46
45
 
46
+ top: ($mdc-checkbox-touch-area - $mdc-checkbox-size) / 2;
47
+ left: ($mdc-checkbox-touch-area - $mdc-checkbox-size) / 2;
48
+ border-radius: 2px;
47
49
  box-sizing: border-box;
48
50
  pointer-events: none;
49
51
  }
50
52
 
51
- /* postcss-bem-linter: define checkbox */
53
+ // postcss-bem-linter: define checkbox
52
54
  .mdc-checkbox {
53
55
  display: inline-block;
54
56
  position: relative;
55
57
  width: $mdc-checkbox-size;
56
58
  height: $mdc-checkbox-size;
59
+ padding: ($mdc-checkbox-touch-area - $mdc-checkbox-size) / 2;
57
60
  line-height: 0;
58
61
  white-space: nowrap;
59
62
  cursor: pointer;
@@ -65,6 +68,9 @@
65
68
  display: inline-flex;
66
69
  align-items: center;
67
70
  justify-content: center;
71
+ width: $mdc-checkbox-ui-pct;
72
+ height: $mdc-checkbox-ui-pct;
73
+ box-sizing: border-box;
68
74
  transition:
69
75
  mdc-checkbox-transition-exit(background-color),
70
76
  mdc-checkbox-transition-exit(border-color);
@@ -76,10 +82,12 @@
76
82
  border-color: $mdc-checkbox-border-color-dark;
77
83
  }
78
84
 
79
- /** The frame's ::before element is used as a focus indicator for the checkbox */
85
+ // The frame's ::before element is used as a focus indicator for the checkbox
80
86
  &::before {
81
87
  @include mdc-checkbox-cover-element;
82
88
 
89
+ width: 100%;
90
+ height: 100%;
83
91
  transform: scale(0, 0);
84
92
  transition: mdc-checkbox-transition-exit(opacity), mdc-checkbox-transition-exit(transform);
85
93
  border-radius: 50%;
@@ -203,7 +211,7 @@ fieldset:disabled .mdc-checkbox__native-control,
203
211
  [aria-disabled="true"] .mdc-checkbox__native-control {
204
212
  cursor: default;
205
213
 
206
- /* postcss-bem-linter: ignore */
214
+ // postcss-bem-linter: ignore
207
215
  ~ .mdc-checkbox__background {
208
216
  border-color: $mdc-checkbox-disabled-color;
209
217
 
@@ -217,11 +225,11 @@ fieldset:disabled .mdc-checkbox__native-control,
217
225
  ~ .mdc-checkbox__background {
218
226
  border-color: transparent;
219
227
  background-color: $mdc-checkbox-disabled-color;
220
- /* stylelint-disable selector-max-compound-selectors, selector-max-specificity */
228
+ // stylelint-disable selector-max-compound-selectors, selector-max-specificity
221
229
  @include mdc-theme-dark(".mdc-checkbox") {
222
230
  background-color: $mdc-checkbox-disabled-color-dark;
223
231
  }
224
- /* stylelint-enable selector-max-compound-selectors, selector-max-specificity */
232
+ // stylelint-enable selector-max-compound-selectors, selector-max-specificity
225
233
  }
226
234
  }
227
235
  }
@@ -306,5 +314,14 @@ fieldset:disabled .mdc-checkbox__native-control,
306
314
  }
307
315
  }
308
316
  }
317
+ // postcss-bem-linter: end
309
318
 
310
- /* postcss-bem-linter: end */
319
+ .mdc-checkbox.mdc-ripple-upgraded {
320
+ @include mdc-ripple-base;
321
+ @include mdc-ripple-bg((pseudo: "::before", theme-style: primary, opacity: .14));
322
+ @include mdc-ripple-fg((pseudo: "::after", theme-style: primary, opacity: .14));
323
+
324
+ .mdc-checkbox__background::before {
325
+ content: none;
326
+ }
327
+ }
@@ -32,6 +32,7 @@
32
32
  pointer-events: none;
33
33
  box-sizing: border-box;
34
34
  contain: strict;
35
+ z-index: 3;
35
36
 
36
37
  /* Shaded background */
37
38
  &::before {
@@ -0,0 +1,134 @@
1
+ // Copyright 2017 Google Inc. All Rights Reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ // Private mixins, meant for internal use.
16
+ @mixin mdc-layout-grid-media-query_($size) {
17
+ @if $size == phone {
18
+ // Phone
19
+ @media (max-width: map-get($mdc-layout-grid-breakpoints, tablet) - 1px) {
20
+ @content;
21
+ }
22
+ }
23
+
24
+ @if $size == tablet {
25
+ // Tablet
26
+ @media (min-width: map-get($mdc-layout-grid-breakpoints, tablet)) and (max-width: map-get($mdc-layout-grid-breakpoints, desktop) - 1px) {
27
+ @content;
28
+ }
29
+ }
30
+
31
+ @if $size == desktop {
32
+ // Desktop
33
+ @media (min-width: map-get($mdc-layout-grid-breakpoints, desktop)) {
34
+ @content;
35
+ }
36
+ }
37
+ }
38
+
39
+ @mixin mdc-layout-grid-cell-span_($size, $span, $gutter) {
40
+ $percent: percentage($span / map-get($mdc-layout-grid-columns, $size));
41
+
42
+ @if $percent > 100% {
43
+ $percent: 100%;
44
+ }
45
+
46
+ width: calc(#{$percent} - #{$gutter});
47
+ width: calc(#{$percent} - var(--mdc-layout-grid-gutter, #{$gutter}));
48
+
49
+ @supports (display: grid) {
50
+ width: auto;
51
+ grid-column-end: span min($span, map-get($mdc-layout-grid-columns, $size));
52
+ }
53
+ }
54
+
55
+ @mixin mdc-layout-grid-cell-spans_($span, $gutter) {
56
+ @each $size in map-keys($mdc-layout-grid-columns) {
57
+ @include mdc-layout-grid-media-query_($size) {
58
+ @include mdc-layout-grid-cell-span_($size, $span, $gutter);
59
+ }
60
+ }
61
+ }
62
+
63
+ // Public mixins, meant for developer usage.
64
+ @mixin mdc-layout-grid($margin, $gutter, $max-width: null) {
65
+ display: flex;
66
+ flex-flow: row wrap;
67
+ align-items: stretch;
68
+ margin: 0 auto;
69
+ box-sizing: border-box;
70
+
71
+ padding: $margin - $gutter / 2;
72
+ padding: calc(var(--mdc-layout-grid-margin, #{$margin}) - var(--mdc-layout-grid-gutter, #{$gutter}) / 2);
73
+
74
+ @if $max-width {
75
+ max-width: $max-width;
76
+ }
77
+
78
+ @supports (display: grid) {
79
+ display: grid;
80
+ grid-gap: $gutter;
81
+ grid-gap: var(--mdc-layout-grid-gutter, $gutter);
82
+
83
+ padding: $margin;
84
+ padding: var(--mdc-layout-grid-margin, #{$margin});
85
+
86
+ @each $size in map-keys($mdc-layout-grid-columns) {
87
+ @include mdc-layout-grid-media-query_($size) {
88
+ grid-template-columns: repeat(map-get($mdc-layout-grid-columns, $size), minmax(0, 1fr));
89
+ }
90
+ }
91
+ }
92
+ }
93
+
94
+ @mixin mdc-layout-grid-cell($gutter, $span: 4) {
95
+ margin: $gutter / 2;
96
+ margin: calc(var(--mdc-layout-grid-gutter, #{$gutter}) / 2);
97
+ box-sizing: border-box;
98
+
99
+ @supports (display: grid) {
100
+ margin: 0;
101
+ }
102
+
103
+ @include mdc-layout-grid-cell-spans_($span, $gutter);
104
+ }
105
+
106
+ @mixin mdc-layout-grid-cell-order($order) {
107
+ order: $order;
108
+ }
109
+
110
+ @mixin mdc-layout-grid-cell-align($position) {
111
+ @if $position == "top" {
112
+ align-self: flex-start;
113
+
114
+ @supports (display: grid) {
115
+ align-self: start;
116
+ }
117
+ }
118
+
119
+ @if $position == "middle" {
120
+ align-self: center;
121
+ }
122
+
123
+ @if $position == "bottom" {
124
+ align-self: flex-end;
125
+
126
+ @supports (display: grid) {
127
+ align-self: end;
128
+ }
129
+ }
130
+
131
+ @if $position == "stretch" {
132
+ align-self: stretch;
133
+ }
134
+ }
@@ -0,0 +1,29 @@
1
+ // Copyright 2017 Google Inc. All Rights Reserved.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ $mdc-layout-grid-breakpoints: (
16
+ desktop: 840px,
17
+ tablet: 480px,
18
+ phone: 0px
19
+ ) !default;
20
+
21
+ $mdc-layout-grid-columns: (
22
+ desktop: 12,
23
+ tablet: 8,
24
+ phone: 4
25
+ ) !default;
26
+
27
+ $mdc-layout-grid-default-column-span: 4 !default;
28
+ $mdc-layout-grid-default-margin: 16px !default;
29
+ $mdc-layout-grid-default-gutter: 16px !default;