11
11
</div >
12
12
13
13
<div class =" card-container short" >
14
- <Card style =" width: 250px;" ><Content >You can also use <code >Content</code >.</Content ></Card >
14
+ <Card style =" width: 250px;"
15
+ ><Content >You can also use <code >Content</code >.</Content ></Card
16
+ >
15
17
</div >
16
18
17
19
<div class =" card-container short" >
18
- <Card style =" width: 250px;" variant =" outlined" padded >An outlined, padded card.</Card >
20
+ <Card style =" width: 250px;" variant =" outlined" padded
21
+ >An outlined, padded card.</Card
22
+ >
19
23
</div >
20
24
21
25
<div class =" card-container short" >
22
26
<Card style =" width: 250px;" >
23
- <PrimaryAction on:click ={() => clicked ++ } padded >Primary Action</PrimaryAction >
27
+ <PrimaryAction on:click ={() => clicked ++ } padded
28
+ >Primary Action</PrimaryAction
29
+ >
24
30
</Card >
25
31
</div >
26
32
54
60
<Card style =" width: 320px;" >
55
61
<Content >A card with action icons.</Content >
56
62
<Actions >
57
- <IconButton on:click ={() => clicked ++ } toggle aria-label =" Add to favorites" title =" Add to favorites" >
63
+ <IconButton
64
+ on:click ={() => clicked ++ }
65
+ toggle
66
+ aria-label =" Add to favorites"
67
+ title =" Add to favorites"
68
+ >
58
69
<Icon class =" material-icons" on >favorite</Icon >
59
70
<Icon class =" material-icons" >favorite_border</Icon >
60
71
</IconButton >
61
- <IconButton class ="material-icons" on:click ={() => clicked ++ } title =" Share" >share</IconButton >
62
- <IconButton class ="material-icons" on:click ={() => clicked ++ } title =" More options" >more_vert</IconButton >
72
+ <IconButton
73
+ class =" material-icons"
74
+ on:click ={() => clicked ++ }
75
+ title =" Share" >share</IconButton
76
+ >
77
+ <IconButton
78
+ class =" material-icons"
79
+ on:click ={() => clicked ++ }
80
+ title =" More options" >more_vert</IconButton
81
+ >
63
82
</Actions >
64
83
</Card >
65
84
</div >
77
96
</Button >
78
97
</ActionButtons >
79
98
<ActionIcons >
80
- <IconButton on:click ={() => clicked ++ } toggle aria-label =" Add to favorites" title =" Add to favorites" >
99
+ <IconButton
100
+ on:click ={() => clicked ++ }
101
+ toggle
102
+ aria-label =" Add to favorites"
103
+ title =" Add to favorites"
104
+ >
81
105
<Icon class =" material-icons" on >favorite</Icon >
82
106
<Icon class =" material-icons" >favorite_border</Icon >
83
107
</IconButton >
84
- <IconButton class ="material-icons" on:click ={() => clicked ++ } title =" Share" >share</IconButton >
85
- <IconButton class ="material-icons" on:click ={() => clicked ++ } title =" More options" >more_vert</IconButton >
108
+ <IconButton
109
+ class =" material-icons"
110
+ on:click ={() => clicked ++ }
111
+ title =" Share" >share</IconButton
112
+ >
113
+ <IconButton
114
+ class =" material-icons"
115
+ on:click ={() => clicked ++ }
116
+ title =" More options" >more_vert</IconButton
117
+ >
86
118
</ActionIcons >
87
119
</Actions >
88
120
</Card >
92
124
<Card style =" width: 320px;" >
93
125
<Media class =" card-media-16x9" aspectRatio =" 16x9" >
94
126
<MediaContent >
95
- <h2 class =" mdc-typography--headline6" style =" color: #fff; position: absolute; bottom: 16px; left: 16px; margin: 0;" >A card with 16x9 media.</h2 >
127
+ <h2
128
+ class =" mdc-typography--headline6"
129
+ style =" color: #fff; position: absolute; bottom: 16px; left: 16px; margin: 0;"
130
+ >
131
+ A card with 16x9 media.
132
+ </h2 >
96
133
</MediaContent >
97
134
</Media >
98
- <Content style =" color: #888;" >
99
- Here's some gray text down here.
100
- </Content >
135
+ <Content style =" color: #888;" >Here's some gray text down here.</Content >
101
136
</Card >
102
137
</div >
103
138
104
139
<div class =" card-container" >
105
140
<Card style =" width: 320px;" >
106
141
<Media class =" card-media-square" aspectRatio =" square" >
107
- <div style =" color: #fff; position: absolute; bottom: 16px; left: 16px;" >
108
- <h2 class =" mdc-typography--headline6" style =" margin: 0;" >A card with square media.</h2 >
109
- <h3 class =" mdc-typography--subtitle2" style =" margin: 0;" >And a subtitle.</h3 >
142
+ <div
143
+ style =" color: #fff; position: absolute; bottom: 16px; left: 16px;"
144
+ >
145
+ <h2 class =" mdc-typography--headline6" style =" margin: 0;" >
146
+ A card with square media.
147
+ </h2 >
148
+ <h3 class =" mdc-typography--subtitle2" style =" margin: 0;" >
149
+ And a subtitle.
150
+ </h3 >
110
151
</div >
111
152
</Media >
112
153
</Card >
115
156
<div class =" card-container" >
116
157
<Card style =" width: 320px;" >
117
158
<div style =" padding: 1rem;" >
118
- <h2 class =" mdc-typography--headline6" style =" margin: 0;" >A card with media.</h2 >
119
- <h3 class =" mdc-typography--subtitle2" style =" margin: 0; color: #888;" >And a subtitle.</h3 >
159
+ <h2 class =" mdc-typography--headline6" style =" margin: 0;" >
160
+ A card with media.
161
+ </h2 >
162
+ <h3 class =" mdc-typography--subtitle2" style =" margin: 0; color: #888;" >
163
+ And a subtitle.
164
+ </h3 >
120
165
</div >
121
166
<PrimaryAction on:click ={() => clicked ++ }>
122
- <Media class =" card-media-16x9" aspectRatio =" 16x9" ></ Media >
167
+ <Media class =" card-media-16x9" aspectRatio =" 16x9" / >
123
168
<Content class =" mdc-typography--body2" >
124
169
And some info text. And it's a primary action for the card.
125
170
</Content >
129
174
130
175
<div class =" card-container" >
131
176
<div >
132
- <div style =" width: 320px;" >
133
- A card with a list as content:
134
- </div >
177
+ <div style =" width: 320px;" >A card with a list as content:</div >
135
178
<Card style =" width: 320px;" >
136
179
<Content component ={List }>
137
180
{#each [... Array (6 )].map ((v , i ) => i + 1 ) as item }
149
192
<PrimaryAction on:click ={() => clicked ++ }>
150
193
<Media class =" card-media-16x9" aspectRatio =" 16x9" >
151
194
<MediaContent >
152
- <div style =" color: #fff; position: absolute; bottom: 16px; left: 16px;" >
153
- <h2 class =" mdc-typography--headline6" style =" margin: 0;" >A card with media.</h2 >
154
- <h3 class =" mdc-typography--subtitle2" style =" margin: 0;" >And a subtitle.</h3 >
195
+ <div
196
+ style =" color: #fff; position: absolute; bottom: 16px; left: 16px;"
197
+ >
198
+ <h2 class =" mdc-typography--headline6" style =" margin: 0;" >
199
+ A card with media.
200
+ </h2 >
201
+ <h3 class =" mdc-typography--subtitle2" style =" margin: 0;" >
202
+ And a subtitle.
203
+ </h3 >
155
204
</div >
156
205
</MediaContent >
157
206
</Media >
158
207
<Content class =" mdc-typography--body2" >
159
- It's all in this card. It's a veritable smorgasbord of card features.
208
+ It's all in this card. It's a veritable smorgasbord of card
209
+ features.
160
210
</Content >
161
211
</PrimaryAction >
162
212
<Actions >
169
219
</Button >
170
220
</ActionButtons >
171
221
<ActionIcons >
172
- <IconButton on:click ={() => clicked ++ } toggle aria-label =" Add to favorites" title =" Add to favorites" >
222
+ <IconButton
223
+ on:click ={() => clicked ++ }
224
+ toggle
225
+ aria-label =" Add to favorites"
226
+ title =" Add to favorites"
227
+ >
173
228
<Icon class =" material-icons" on >favorite</Icon >
174
229
<Icon class =" material-icons" >favorite_border</Icon >
175
230
</IconButton >
176
- <IconButton class ="material-icons" on:click ={() => clicked ++ } title =" Share" >share</IconButton >
177
- <IconButton class ="material-icons" on:click ={() => clicked ++ } title =" More options" >more_vert</IconButton >
231
+ <IconButton
232
+ class =" material-icons"
233
+ on:click ={() => clicked ++ }
234
+ title =" Share" >share</IconButton
235
+ >
236
+ <IconButton
237
+ class =" material-icons"
238
+ on:click ={() => clicked ++ }
239
+ title =" More options" >more_vert</IconButton
240
+ >
178
241
</ActionIcons >
179
242
</Actions >
180
243
</Card >
183
246
<div class =" card-container" >
184
247
<Card style =" width: 360px;" >
185
248
<PrimaryAction on:click ={() => clicked ++ }>
186
- <Media class =" card-media-16x9" aspectRatio =" 16x9" ></ Media >
249
+ <Media class =" card-media-16x9" aspectRatio =" 16x9" / >
187
250
<Content class =" mdc-typography--body2" >
188
- <h2 class =" mdc-typography--headline6" style =" margin: 0;" >A card with media.</h2 >
189
- <h3 class =" mdc-typography--subtitle2" style =" margin: 0 0 10px; color: #888;" >And a subtitle.</h3 >
251
+ <h2 class =" mdc-typography--headline6" style =" margin: 0;" >
252
+ A card with media.
253
+ </h2 >
254
+ <h3
255
+ class =" mdc-typography--subtitle2"
256
+ style =" margin: 0 0 10px; color: #888;"
257
+ >
258
+ And a subtitle.
259
+ </h3 >
190
260
It's all in this card. It's a veritable smorgasbord of card features.
191
261
</Content >
192
262
</PrimaryAction >
200
270
</Button >
201
271
</ActionButtons >
202
272
<ActionIcons >
203
- <IconButton on:click ={() => clicked ++ } toggle aria-label =" Add to favorites" title =" Add to favorites" >
273
+ <IconButton
274
+ on:click ={() => clicked ++ }
275
+ toggle
276
+ aria-label =" Add to favorites"
277
+ title =" Add to favorites"
278
+ >
204
279
<Icon class =" material-icons" on >favorite</Icon >
205
280
<Icon class =" material-icons" >favorite_border</Icon >
206
281
</IconButton >
207
- <IconButton class ="material-icons" on:click ={() => clicked ++ } title =" Share" >share</IconButton >
208
- <IconButton class ="material-icons" on:click ={() => clicked ++ } title =" More options" >more_vert</IconButton >
282
+ <IconButton
283
+ class =" material-icons"
284
+ on:click ={() => clicked ++ }
285
+ title =" Share" >share</IconButton
286
+ >
287
+ <IconButton
288
+ class =" material-icons"
289
+ on:click ={() => clicked ++ }
290
+ title =" More options" >more_vert</IconButton
291
+ >
209
292
</ActionIcons >
210
293
</Actions >
211
294
</Card >
216
299
</section >
217
300
218
301
<script >
219
- import Card , {Content , PrimaryAction , Media , MediaContent , Actions , ActionButtons , ActionIcons } from ' @smui/card' ;
220
- import Button , {Label } from ' @smui/button' ;
221
- import IconButton , {Icon } from ' @smui/icon-button' ;
222
- import List , {Item , Text } from ' @smui/list' ;
302
+ import Card, {
303
+ Content ,
304
+ PrimaryAction ,
305
+ Media ,
306
+ MediaContent ,
307
+ Actions ,
308
+ ActionButtons ,
309
+ ActionIcons ,
310
+ } from ' @smui/card' ;
311
+ import Button , { Label } from ' @smui/button' ;
312
+ import IconButton , { Icon } from ' @smui/icon-button' ;
313
+ import List , { Item , Text } from ' @smui/list' ;
223
314
224
315
let clicked = 0 ;
225
316
</script >
246
337
* :global(.card-media-square ) {
247
338
background-image : url (https://via.placeholder.com/320x320.png?text=square );
248
339
}
249
- </style >
340
+ </style >
0 commit comments