material_components_web-sass 0.6.0 → 0.7.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.
@@ -0,0 +1,177 @@
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
+ @import "@material/animation/functions";
16
+ @import "@material/elevation/mixins";
17
+ @import "@material/rtl/mixins";
18
+ @import "@material/theme/mixins";
19
+ @import "@material/typography/mixins";
20
+ @import "@material/typography/variables";
21
+
22
+ $mdc-dialog-dark-theme-bg-color: #303030 !default;
23
+
24
+ :root {
25
+ --mdc-dialog-dark-theme-bg-color: $mdc-dialog-dark-theme-bg-color;
26
+ }
27
+
28
+ // postcss-bem-linter: define dialog
29
+
30
+ .mdc-dialog {
31
+ display: flex;
32
+ position: fixed;
33
+ align-items: center;
34
+ justify-content: center;
35
+ opacity: 0;
36
+ z-index: -1;
37
+
38
+ &__surface {
39
+ display: inline-flex;
40
+ position: absolute;
41
+ bottom: 50vh;
42
+ flex-direction: column;
43
+
44
+ @include mdc-elevation(24);
45
+
46
+ width: calc(100% - 30px);
47
+ min-width: 640px;
48
+ max-width: 865px;
49
+ transform: translateY(150px) scale(.8);
50
+ transition: mdc-animation-enter(opacity, 120ms), mdc-animation-enter(transform, 120ms);
51
+
52
+ @include mdc-theme-prop(background-color, background);
53
+
54
+ @include mdc-theme-dark(".mdc-dialog") {
55
+ @include mdc-theme-prop(color, text-primary-on-dark);
56
+
57
+ background-color: $mdc-dialog-dark-theme-bg-color;
58
+ background-color: var(--mdc-dialog-dark-theme-bg-color, #{$mdc-dialog-dark-theme-bg-color});
59
+ }
60
+
61
+ @include mdc-rtl(".mdc-dialog") {
62
+ text-align: right;
63
+ }
64
+
65
+ opacity: 0;
66
+ }
67
+
68
+ &__backdrop {
69
+ display: flex;
70
+ position: fixed;
71
+ top: 0;
72
+ left: 0;
73
+ align-items: center;
74
+ justify-content: center;
75
+ width: 100%;
76
+ height: 100%;
77
+
78
+ @include mdc-theme-prop(background-color, text-primary-on-light);
79
+
80
+ opacity: 0;
81
+ z-index: -1;
82
+ }
83
+
84
+ &__header {
85
+ display: flex;
86
+ align-items: center;
87
+ padding: 24px 24px 0;
88
+
89
+ &__empty {
90
+ padding: 0;
91
+ }
92
+
93
+ @include mdc-rtl(".mdc-dialog") {
94
+ text-align: right;
95
+ }
96
+
97
+ &__title {
98
+ flex: 1;
99
+ margin: 0;
100
+
101
+ @include mdc-typography(title);
102
+ }
103
+ }
104
+
105
+ &__body {
106
+ margin-top: 20px;
107
+ padding: 0 24px 24px;
108
+
109
+ @include mdc-theme-prop(color, text-secondary-on-light);
110
+
111
+ @include mdc-theme-dark(".mdc-dialog", true) {
112
+ @include mdc-theme-prop(color, text-secondary-on-dark);
113
+ }
114
+
115
+ @include mdc-typography(body1);
116
+
117
+ &--scrollable {
118
+ max-height: 195px;
119
+ border-top: 1px solid rgba(0, 0, 0, .1);
120
+ border-bottom: 1px solid rgba(0, 0, 0, .1);
121
+ overflow-y: scroll;
122
+ overflow-x: auto;
123
+ -webkit-overflow-scrolling: touch;
124
+ }
125
+ }
126
+
127
+ &__footer {
128
+ display: flex;
129
+ flex-wrap: wrap;
130
+ align-items: center;
131
+ justify-content: flex-end;
132
+ padding: 8px;
133
+ }
134
+
135
+ // TODO: Replace with breakpoint variable
136
+ @media (max-width: 640px) {
137
+ min-width: 280px;
138
+
139
+ &__surface {
140
+ min-width: 280px;
141
+ }
142
+
143
+ &__body {
144
+ line-height: 24px;
145
+ }
146
+ }
147
+ }
148
+
149
+ .mdc-dialog--open {
150
+ display: flex;
151
+ top: 0;
152
+ left: 0;
153
+ align-items: center;
154
+ justify-content: center;
155
+ width: 100%;
156
+ height: 100%;
157
+ opacity: 1;
158
+ z-index: 2;
159
+
160
+ .mdc-dialog__surface {
161
+ transform: translateY(0) scale(1);
162
+ transition: mdc-animation-enter(opacity, 120ms), mdc-animation-enter(transform, 120ms);
163
+ opacity: 1;
164
+ }
165
+
166
+ .mdc-dialog__backdrop {
167
+ transition: mdc-animation-enter(opacity, 120ms);
168
+ opacity: .3;
169
+ }
170
+ }
171
+
172
+ // postcss-bem-linter: end
173
+
174
+ .mdc-dialog-scroll-lock {
175
+ height: 100vh;
176
+ overflow: hidden;
177
+ }
@@ -0,0 +1,194 @@
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
+
17
+ @import "@material/rtl/mixins";
18
+ @import "@material/theme/mixins";
19
+ @import "@material/typography/mixins";
20
+
21
+ $mdc-grid-list-tile-width: 200px !default;
22
+ $mdc-grid-list-tile-secondary-padding: 16px;
23
+ $mdc-grid-list-tile-secondary-padding-narrow: 8px;
24
+ $mdc-grid-list-oneline-cap-secondary-height: 48px;
25
+ $mdc-grid-list-twoline-cap-secondary-height: 68px;
26
+ $mdc-grid-list-tile-secondary-icon-size: 24px;
27
+
28
+ @mixin mdc-grid-list-tile-aspect($width-height-ratio) {
29
+ .mdc-grid-tile__primary {
30
+ padding-bottom: calc(100% / #{$width-height-ratio});
31
+ }
32
+ }
33
+
34
+ @mixin mdc-grid-list-tile-gutter($gutter-width) {
35
+ .mdc-grid-tile {
36
+ margin: $gutter-width/2 0;
37
+ padding: 0 $gutter-width/2;
38
+
39
+ &__secondary {
40
+ left: $gutter-width/2;
41
+ width: calc(100% - #{$gutter-width});
42
+ }
43
+ }
44
+
45
+ .mdc-grid-list__tiles {
46
+ margin: $gutter-width/2 auto;
47
+ }
48
+ }
49
+
50
+ // postcss-bem-linter: define grid-list
51
+ .mdc-grid-list {
52
+ @include mdc-grid-list-tile-aspect(1);
53
+ @include mdc-grid-list-tile-gutter(4px);
54
+
55
+ &__tiles {
56
+ display: flex;
57
+ flex-direction: row;
58
+ flex-wrap: wrap;
59
+ margin: 0;
60
+ padding: 0;
61
+ }
62
+ }
63
+
64
+ .mdc-grid-list--tile-gutter-1 {
65
+ @include mdc-grid-list-tile-gutter(1px);
66
+ }
67
+
68
+ .mdc-grid-list--tile-aspect-16x9 {
69
+ @include mdc-grid-list-tile-aspect(16 / 9);
70
+ }
71
+
72
+ .mdc-grid-list--tile-aspect-3x2 {
73
+ @include mdc-grid-list-tile-aspect(3 / 2);
74
+ }
75
+
76
+ .mdc-grid-list--tile-aspect-2x3 {
77
+ @include mdc-grid-list-tile-aspect(2 / 3);
78
+ }
79
+
80
+ .mdc-grid-list--tile-aspect-4x3 {
81
+ @include mdc-grid-list-tile-aspect(4 / 3);
82
+ }
83
+
84
+ .mdc-grid-list--tile-aspect-3x4 {
85
+ @include mdc-grid-list-tile-aspect(3 / 4);
86
+ }
87
+
88
+ // stylelint-disable plugin/selector-bem-pattern
89
+ // We need to disable linter here because we are nesting grid-tile under grid list here.
90
+ .mdc-grid-list--twoline-caption {
91
+ .mdc-grid-tile__secondary {
92
+ height: $mdc-grid-list-twoline-cap-secondary-height;
93
+ }
94
+ }
95
+
96
+ .mdc-grid-list--header-caption {
97
+ .mdc-grid-tile__secondary {
98
+ top: 0;
99
+ bottom: auto;
100
+ }
101
+ }
102
+
103
+ .mdc-grid-list--with-icon-align-start {
104
+ .mdc-grid-tile__secondary {
105
+ @include mdc-rtl-reflexive-property(padding, $mdc-grid-list-tile-secondary-padding * 2 + $mdc-grid-list-tile-secondary-icon-size, $mdc-grid-list-tile-secondary-padding-narrow, ".mdc-grid-list");
106
+ }
107
+
108
+ .mdc-grid-tile__icon {
109
+ @include mdc-rtl-reflexive-position(left, $mdc-grid-list-tile-secondary-padding, ".mdc-grid-list");
110
+
111
+ font-size: $mdc-grid-list-tile-secondary-icon-size;
112
+ }
113
+ }
114
+
115
+ .mdc-grid-list--with-icon-align-end {
116
+ .mdc-grid-tile__secondary {
117
+ @include mdc-rtl-reflexive-property(padding, $mdc-grid-list-tile-secondary-padding, $mdc-grid-list-tile-secondary-padding * 2 + $mdc-grid-list-tile-secondary-icon-size, ".mdc-grid-list");
118
+ }
119
+
120
+ .mdc-grid-tile__icon {
121
+ @include mdc-rtl-reflexive-position(right, $mdc-grid-list-tile-secondary-padding, ".mdc-grid-list");
122
+
123
+ font-size: $mdc-grid-list-tile-secondary-icon-size;
124
+ }
125
+ }
126
+ // stylelint-enable plugin/selector-bem-pattern
127
+ // postcss-bem-linter: end
128
+
129
+ // postcss-bem-linter: define grid-tile
130
+ .mdc-grid-tile {
131
+ display: block;
132
+ position: relative;
133
+ width: var(--mdc-grid-list-tile-width, $mdc-grid-list-tile-width);
134
+
135
+ &__primary {
136
+ position: relative;
137
+ height: 0;
138
+
139
+ @include mdc-theme-prop(background-color, background);
140
+ @include mdc-theme-prop(color, text-primary-on-background);
141
+
142
+ &-content {
143
+ position: absolute;
144
+ top: 0;
145
+ right: 0;
146
+ bottom: 0;
147
+ left: 0;
148
+ width: 100%;
149
+ height: 100%;
150
+ background-repeat: no-repeat;
151
+ background-position: center;
152
+ background-size: cover;
153
+ }
154
+ }
155
+
156
+ &__secondary {
157
+ position: absolute;
158
+ box-sizing: border-box;
159
+ bottom: 0;
160
+ height: $mdc-grid-list-oneline-cap-secondary-height;
161
+ padding: $mdc-grid-list-tile-secondary-padding;
162
+
163
+ @include mdc-theme-prop(background-color, primary);
164
+ @include mdc-theme-prop(color, text-primary-on-primary);
165
+ }
166
+
167
+ &__title {
168
+ display: block;
169
+ margin: 0;
170
+ padding: 0;
171
+ font-size: 1rem;
172
+ font-weight: #{map-get($mdc-typography-font-weight-values, medium)};
173
+ line-height: 1rem;
174
+ text-overflow: ellipsis;
175
+ white-space: nowrap;
176
+ overflow: hidden;
177
+ }
178
+
179
+ &__support-text {
180
+ @include mdc-typography(body1);
181
+
182
+ display: block;
183
+ margin: 0;
184
+ margin-top: 4px;
185
+ padding: 0;
186
+ }
187
+
188
+ &__icon {
189
+ position: absolute;
190
+ top: calc(50% - #{$mdc-grid-list-tile-secondary-icon-size} / 2);
191
+ font-size: 0;
192
+ }
193
+ }
194
+ // postcss-bem-linter: end
@@ -18,10 +18,12 @@
18
18
  @import "@material/button/mdc-button";
19
19
  @import "@material/card/mdc-card";
20
20
  @import "@material/checkbox/mdc-checkbox";
21
+ @import "@material/dialog/mdc-dialog";
21
22
  @import "@material/drawer/mdc-drawer";
22
23
  @import "@material/elevation/mdc-elevation";
23
24
  @import "@material/fab/mdc-fab";
24
25
  @import "@material/form-field/mdc-form-field";
26
+ @import "@material/grid-list/mdc-grid-list";
25
27
  @import "@material/icon-toggle/mdc-icon-toggle";
26
28
  @import "@material/layout-grid/mdc-layout-grid";
27
29
  @import "@material/list/mdc-list";
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.6.0
4
+ version: 0.7.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-03-06 00:00:00.000000000 Z
11
+ date: 2017-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: autoprefixer-rails
@@ -133,6 +133,7 @@ files:
133
133
  - vendor/assets/stylesheets/@material/checkbox/_keyframes.scss
134
134
  - vendor/assets/stylesheets/@material/checkbox/_variables.scss
135
135
  - vendor/assets/stylesheets/@material/checkbox/mdc-checkbox.scss
136
+ - vendor/assets/stylesheets/@material/dialog/mdc-dialog.scss
136
137
  - vendor/assets/stylesheets/@material/drawer/_mixins.scss
137
138
  - vendor/assets/stylesheets/@material/drawer/mdc-drawer.scss
138
139
  - vendor/assets/stylesheets/@material/drawer/permanent/mdc-permanent-drawer.scss
@@ -144,6 +145,7 @@ files:
144
145
  - vendor/assets/stylesheets/@material/fonts/material-icons.scss
145
146
  - vendor/assets/stylesheets/@material/fonts/roboto.scss
146
147
  - vendor/assets/stylesheets/@material/form-field/mdc-form-field.scss
148
+ - vendor/assets/stylesheets/@material/grid-list/mdc-grid-list.scss
147
149
  - vendor/assets/stylesheets/@material/icon-toggle/mdc-icon-toggle.scss
148
150
  - vendor/assets/stylesheets/@material/layout-grid/_mixins.scss
149
151
  - vendor/assets/stylesheets/@material/layout-grid/_variables.scss