UNPKG

7.39 kBSCSSView Raw
1@import "../../themes/ionic.globals.md";
2
3// Material Design Card
4// --------------------------------------------------
5
6/// @prop - Margin top of the card
7$card-md-margin-top: 10px !default;
8
9// deprecated
10$card-md-margin-right: 10px !default;
11/// @prop - Margin end of the card
12$card-md-margin-end: $card-md-margin-right !default;
13
14/// @prop - Margin bottom of the card
15$card-md-margin-bottom: 10px !default;
16
17// deprecated
18$card-md-margin-left: 10px !default;
19/// @prop - Margin start of the card
20$card-md-margin-start: $card-md-margin-left !default;
21
22
23/// @prop - Padding top of the card
24$card-md-padding-top: 13px !default;
25
26// deprecated
27$card-md-padding-right: 16px !default;
28/// @prop - Padding right of the card
29$card-md-padding-end: $card-md-padding-right !default;
30
31/// @prop - Padding bottom of the card
32$card-md-padding-bottom: 13px !default;
33
34// deprecated
35$card-md-padding-left: 16px !default;
36/// @prop - Padding start of the card
37$card-md-padding-start: $card-md-padding-left !default;
38
39/// @prop - Padding top of the media on the card
40$card-md-padding-media-top: 10px !default;
41
42/// @prop - Padding bottom of the media on the card
43$card-md-padding-media-bottom: 10px !default;
44
45/// @prop - Size of the card avatar
46$card-md-avatar-size: 4rem !default;
47
48/// @prop - Size of the card thumbnail
49$card-md-thumbnail-size: 8rem !default;
50
51/// @prop - Background color of the card
52$card-md-background-color: $list-md-background-color !default;
53
54/// @prop - Box shadow of the card
55$card-md-box-shadow: 0 2px 2px 0 rgba(0, 0, 0, .14), 0 3px 1px -2px rgba(0, 0, 0, .2), 0 1px 5px 0 rgba(0, 0, 0, .12) !default;
56
57/// @prop - Border radius of the card
58$card-md-border-radius: 2px !default;
59
60
61/// @prop - Font size of the card
62$card-md-font-size: 1.4rem !default;
63
64/// @prop - Line height of the card
65$card-md-line-height: 1.5 !default;
66
67/// @prop - Color of the card text
68$card-md-text-color: #222 !default;
69
70/// @prop - Font size of the card title
71$card-md-title-font-size: 2.4rem !default;
72
73// deprecated
74$card-md-title-padding: null !default;
75
76/// @prop - Padding top of the card title
77$card-md-title-padding-top: 8px !default;
78
79/// @prop - Padding end of the card title
80$card-md-title-padding-end: 0 !default;
81
82/// @prop - Padding bottom of the card title
83$card-md-title-padding-bottom: 8px !default;
84
85/// @prop - Padding start of the card title
86$card-md-title-padding-start: 0 !default;
87
88// deprecated
89$card-md-title-margin: null !default;
90
91/// @prop - Margin top of the card title
92$card-md-title-margin-top: 2px !default;
93
94/// @prop - Margin end of the card title
95$card-md-title-margin-end: 0 !default;
96
97/// @prop - Margin bottom of the card title
98$card-md-title-margin-bottom: 2px !default;
99
100/// @prop - Margin start of the card title
101$card-md-title-margin-start: $card-md-title-margin-end !default;
102
103/// @prop - Color of the card title
104$card-md-title-text-color: #222 !default;
105
106/// @prop - Font size of the card header
107$card-md-header-font-size: 1.6rem !default;
108
109// deprecated
110$card-md-header-padding: null !default;
111
112/// @prop - Padding top of the card header
113$card-md-header-padding-top: 16px !default;
114
115/// @prop - Padding end of the card header
116$card-md-header-padding-end: $card-md-header-padding-top !default;
117
118/// @prop - Padding bottom of the card header
119$card-md-header-padding-bottom: $card-md-header-padding-top !default;
120
121/// @prop - Padding start of the card header
122$card-md-header-padding-start: $card-md-header-padding-end !default;
123
124/// @prop - Color of the card header
125$card-md-header-color: #222 !default;
126
127
128.card-md {
129 @include margin($card-md-margin-top, $card-md-margin-end, $card-md-margin-bottom, $card-md-margin-start);
130 @include border-radius($card-md-border-radius);
131
132 width: calc(100% - #{($card-md-margin-end + $card-md-margin-start)});
133
134 font-size: $card-md-font-size;
135
136 background: $card-md-background-color;
137 box-shadow: $card-md-box-shadow;
138}
139
140.card-md ion-list {
141 @include margin(null, null, 0, null);
142}
143
144.card-md > .item:last-child,
145.card-md > .item:last-child .item-inner,
146.card-md > .item-wrapper:last-child .item {
147 border-bottom: 0;
148}
149
150.card-md .item-md.item-block .item-inner {
151 border: 0;
152}
153
154.card-content-md {
155 @include padding($card-md-padding-top, $card-md-padding-end, $card-md-padding-bottom, $card-md-padding-start);
156
157 font-size: $card-md-font-size;
158 line-height: $card-md-line-height;
159}
160
161.card-header-md {
162 font-size: $card-md-header-font-size;
163 color: $card-md-header-color;
164
165 @include deprecated-variable(padding, $card-md-header-padding) {
166 @include padding($card-md-header-padding-top, $card-md-header-padding-end, $card-md-header-padding-bottom, $card-md-header-padding-start);
167 }
168}
169
170.card-header-md + .card-content-md,
171.card-md .item + .card-content-md {
172 @include padding(0, null, null, null);
173}
174
175.card .note-md {
176 font-size: 1.3rem;
177}
178
179.card-title-md {
180 display: block;
181
182 font-size: $card-md-title-font-size;
183 line-height: 1.2;
184 color: $card-md-title-text-color;
185
186 @include deprecated-variable(margin, $card-md-title-margin) {
187 @include margin($card-md-title-margin-top, $card-md-title-margin-end, $card-md-title-margin-bottom, $card-md-title-margin-start);
188 }
189
190 @include deprecated-variable(padding, $card-md-title-padding) {
191 @include padding($card-md-title-padding-top, $card-md-title-padding-end, $card-md-title-padding-bottom, $card-md-title-padding-start);
192 }
193}
194
195.card-md h1 {
196 @include margin(0, 0, 2px);
197
198 font-size: 2.4rem;
199 font-weight: normal;
200 color: $card-md-text-color;
201}
202
203.card-md h2 {
204 @include margin(2px, 0);
205
206 font-size: 1.6rem;
207 font-weight: normal;
208 color: $card-md-text-color;
209}
210
211.card-md h3,
212.card-md h4,
213.card-md h5,
214.card-md h6 {
215 @include margin(2px, 0);
216
217 font-size: 1.4rem;
218 font-weight: normal;
219 color: $card-md-text-color;
220}
221
222.card-md p {
223 @include margin(0, 0, 2px);
224
225 font-size: 1.4rem;
226 font-weight: normal;
227 line-height: 1.5;
228 color: $card-md-text-color;
229}
230
231.card-md + ion-card {
232 @include margin(0, null, null, null);
233}
234
235
236// Generate Material Design Card Colors
237// --------------------------------------------------
238
239@each $color-name, $color-base, $color-contrast in get-colors($colors-md) {
240
241 .card-md .text-md-#{$color-name} {
242 color: $color-base;
243 }
244
245 .card-md-#{$color-name} {
246 color: $color-contrast;
247 background-color: $color-base;
248
249 .card-header-md,
250 .card-title-md,
251 .card-content-md,
252 h1,
253 h2,
254 h3,
255 h4,
256 h5,
257 h6,
258 p {
259 color: $color-contrast;
260 }
261
262 @each $color-name, $color-base, $color-contrast in get-colors($colors-md) {
263 .text-md-#{$color-name},
264 .card-header-md-#{$color-name},
265 .card-title-md-#{$color-name},
266 .card-content-md-#{$color-name} {
267 color: $color-base;
268 }
269 }
270 }
271
272 .card-header-md-#{$color-name},
273 .card-title-md-#{$color-name},
274 .card-content-md-#{$color-name} {
275 color: $color-base;
276 }
277
278}