-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathgallery.scss
More file actions
55 lines (41 loc) · 1.1 KB
/
gallery.scss
File metadata and controls
55 lines (41 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
:host {
/**
* @prop --ion-gallery-gap: Space between gallery items
*/
display: grid;
grid-template-columns: repeat(var(--internal-gallery-columns, 2), minmax(0, 1fr));
}
// Layout: Uniform
// --------------------------------------------------
:host(.gallery-layout-uniform) {
gap: var(--ion-gallery-gap, 16px);
}
// Target all slotted elements in the uniform layout. This ensures that nested
// images also have an aspect ratio of 1/1.
:host(.gallery-layout-uniform) ::slotted(*) {
aspect-ratio: 1/1;
}
// Layout: Masonry
// --------------------------------------------------
:host(.gallery-layout-masonry) {
align-items: start;
column-gap: var(--ion-gallery-gap, 16px);
row-gap: 0;
grid-auto-rows: 2px;
}
:host(.gallery-layout-masonry) ::slotted(*) {
display: block;
// Clear min-height so items size to their content
min-height: unset;
margin-bottom: var(--ion-gallery-gap, 16px);
}
// Slotted elements
// --------------------------------------------------
::slotted(*) {
width: 100%;
}
::slotted(img) {
display: block;
object-fit: cover;
object-position: center;
}