1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | @import "@material/feature-targeting/functions";
|
24 | @import "@material/feature-targeting/mixins";
|
25 | @import "@material/rtl/mixins";
|
26 | @import "@material/theme/mixins";
|
27 | @import "@material/typography/mixins";
|
28 | @import "./variables";
|
29 |
|
30 | @mixin mdc-grid-list-core-styles($query: mdc-feature-all()) {
|
31 | $feat-color: mdc-feature-create-target($query, color);
|
32 | $feat-structure: mdc-feature-create-target($query, structure);
|
33 | $feat-typography: mdc-feature-create-target($query, typography);
|
34 |
|
35 |
|
36 | @include mdc-grid-list-tile-aspect(1, $query: $query);
|
37 | @include mdc-grid-list-tile-gutter(4px, $query: $query);
|
38 |
|
39 | .mdc-grid-list__tiles {
|
40 | @include mdc-feature-targets($feat-structure) {
|
41 | display: flex;
|
42 | flex-flow: row wrap;
|
43 | padding: 0;
|
44 | }
|
45 | }
|
46 |
|
47 | .mdc-grid-list--tile-gutter-1 {
|
48 | @include mdc-grid-list-tile-gutter(1px, $query: $query);
|
49 | }
|
50 |
|
51 | .mdc-grid-list--tile-aspect-16x9 {
|
52 | @include mdc-grid-list-tile-aspect(16 / 9, $query: $query);
|
53 | }
|
54 |
|
55 | .mdc-grid-list--tile-aspect-3x2 {
|
56 | @include mdc-grid-list-tile-aspect(3 / 2, $query: $query);
|
57 | }
|
58 |
|
59 | .mdc-grid-list--tile-aspect-2x3 {
|
60 | @include mdc-grid-list-tile-aspect(2 / 3, $query: $query);
|
61 | }
|
62 |
|
63 | .mdc-grid-list--tile-aspect-4x3 {
|
64 | @include mdc-grid-list-tile-aspect(4 / 3, $query: $query);
|
65 | }
|
66 |
|
67 | .mdc-grid-list--tile-aspect-3x4 {
|
68 | @include mdc-grid-list-tile-aspect(3 / 4, $query: $query);
|
69 | }
|
70 |
|
71 |
|
72 |
|
73 | .mdc-grid-tile {
|
74 | @include mdc-feature-targets($feat-structure) {
|
75 | display: block;
|
76 | position: relative;
|
77 |
|
78 | width: $mdc-grid-list-tile-width;
|
79 | width: var(--mdc-grid-list-tile-width, $mdc-grid-list-tile-width);
|
80 | }
|
81 | }
|
82 |
|
83 | .mdc-grid-tile__primary {
|
84 | @include mdc-feature-targets($feat-color) {
|
85 | @include mdc-theme-prop(background-color, background);
|
86 | @include mdc-theme-prop(color, text-primary-on-background);
|
87 | }
|
88 |
|
89 | @include mdc-feature-targets($feat-structure) {
|
90 | position: relative;
|
91 | height: 0;
|
92 | }
|
93 | }
|
94 |
|
95 | .mdc-grid-tile__primary-content {
|
96 | @include mdc-feature-targets($feat-structure) {
|
97 | position: absolute;
|
98 | top: 0;
|
99 | right: 0;
|
100 | bottom: 0;
|
101 | left: 0;
|
102 | width: 100%;
|
103 | height: 100%;
|
104 | background-repeat: no-repeat;
|
105 | background-position: center;
|
106 | background-size: cover;
|
107 | }
|
108 | }
|
109 |
|
110 | .mdc-grid-tile__secondary {
|
111 | @include mdc-feature-targets($feat-color) {
|
112 | @include mdc-theme-prop(background-color, primary);
|
113 | @include mdc-theme-prop(color, on-primary);
|
114 | }
|
115 |
|
116 | @include mdc-feature-targets($feat-structure) {
|
117 | position: absolute;
|
118 | bottom: 0;
|
119 | box-sizing: border-box;
|
120 | height: $mdc-grid-list-oneline-cap-secondary-height;
|
121 | padding: $mdc-grid-list-tile-secondary-padding;
|
122 | }
|
123 | }
|
124 |
|
125 | .mdc-grid-tile__title {
|
126 | @include mdc-typography-overflow-ellipsis($query: $query);
|
127 |
|
128 | @include mdc-feature-targets($feat-structure) {
|
129 | display: block;
|
130 | margin: 0;
|
131 | padding: 0;
|
132 | font-size: 1rem;
|
133 | line-height: 1rem;
|
134 | }
|
135 |
|
136 | @include mdc-feature-targets($feat-typography) {
|
137 | font-weight: #{map-get($mdc-typography-font-weight-values, medium)};
|
138 | }
|
139 | }
|
140 |
|
141 | .mdc-grid-tile__support-text {
|
142 | @include mdc-typography(subtitle1, $query: $query);
|
143 | @include mdc-typography-overflow-ellipsis($query: $query);
|
144 |
|
145 | @include mdc-feature-targets($feat-structure) {
|
146 | display: block;
|
147 | margin: 0;
|
148 | margin-top: 4px;
|
149 | padding: 0;
|
150 | }
|
151 | }
|
152 |
|
153 | .mdc-grid-tile__icon {
|
154 | @include mdc-feature-targets($feat-structure) {
|
155 | position: absolute;
|
156 | top: calc(50% - #{$mdc-grid-list-tile-secondary-icon-size} / 2);
|
157 | font-size: 0;
|
158 | }
|
159 | }
|
160 |
|
161 |
|
162 |
|
163 | .mdc-grid-list--twoline-caption .mdc-grid-tile__secondary {
|
164 | @include mdc-feature-targets($feat-structure) {
|
165 | height: $mdc-grid-list-twoline-cap-secondary-height;
|
166 | }
|
167 | }
|
168 |
|
169 | .mdc-grid-list--header-caption .mdc-grid-tile__secondary {
|
170 | @include mdc-feature-targets($feat-structure) {
|
171 | top: 0;
|
172 | bottom: auto;
|
173 | }
|
174 | }
|
175 |
|
176 | .mdc-grid-list--with-icon-align-start {
|
177 | .mdc-grid-tile__secondary {
|
178 | @include mdc-feature-targets($feat-structure) {
|
179 | @include mdc-rtl-reflexive-property(
|
180 | padding,
|
181 | $mdc-grid-list-tile-secondary-padding * 2 + $mdc-grid-list-tile-secondary-icon-size,
|
182 | $mdc-grid-list-tile-secondary-padding-narrow,
|
183 | ".mdc-grid-list"
|
184 | );
|
185 | }
|
186 | }
|
187 |
|
188 | .mdc-grid-tile__icon {
|
189 | @include mdc-feature-targets($feat-structure) {
|
190 | @include mdc-rtl-reflexive-position(left, $mdc-grid-list-tile-secondary-padding, ".mdc-grid-list");
|
191 |
|
192 | font-size: $mdc-grid-list-tile-secondary-icon-size;
|
193 | }
|
194 | }
|
195 | }
|
196 |
|
197 | .mdc-grid-list--with-icon-align-end {
|
198 | .mdc-grid-tile__secondary {
|
199 | @include mdc-feature-targets($feat-structure) {
|
200 | @include mdc-rtl-reflexive-property(
|
201 | padding,
|
202 | $mdc-grid-list-tile-secondary-padding,
|
203 | $mdc-grid-list-tile-secondary-padding * 2 + $mdc-grid-list-tile-secondary-icon-size,
|
204 | ".mdc-grid-list"
|
205 | );
|
206 | }
|
207 | }
|
208 |
|
209 | .mdc-grid-tile__icon {
|
210 | @include mdc-feature-targets($feat-structure) {
|
211 | @include mdc-rtl-reflexive-position(right, $mdc-grid-list-tile-secondary-padding, ".mdc-grid-list");
|
212 |
|
213 | font-size: $mdc-grid-list-tile-secondary-icon-size;
|
214 | }
|
215 | }
|
216 | }
|
217 | }
|
218 |
|
219 | @mixin mdc-grid-list-tile-aspect($width-height-ratio, $query: mdc-feature-all()) {
|
220 | $feat-structure: mdc-feature-create-target($query, structure);
|
221 |
|
222 | .mdc-grid-tile__primary {
|
223 | @include mdc-feature-targets($feat-structure) {
|
224 | padding-bottom: calc(100% / #{$width-height-ratio});
|
225 | }
|
226 | }
|
227 | }
|
228 |
|
229 | @mixin mdc-grid-list-tile-gutter($gutter-width, $query: mdc-feature-all()) {
|
230 | $feat-structure: mdc-feature-create-target($query, structure);
|
231 |
|
232 | .mdc-grid-tile {
|
233 | @include mdc-feature-targets($feat-structure) {
|
234 | margin: $gutter-width/2 0;
|
235 | padding: 0 $gutter-width/2;
|
236 | }
|
237 | }
|
238 |
|
239 | .mdc-grid-tile__secondary {
|
240 | @include mdc-feature-targets($feat-structure) {
|
241 | left: $gutter-width/2;
|
242 | width: calc(100% - #{$gutter-width});
|
243 | }
|
244 | }
|
245 |
|
246 | .mdc-grid-list__tiles {
|
247 | @include mdc-feature-targets($feat-structure) {
|
248 | margin: $gutter-width/2 auto;
|
249 | }
|
250 | }
|
251 | }
|