summaryrefslogtreecommitdiffstats
path: root/src/layouts
diff options
context:
space:
mode:
Diffstat (limited to 'src/layouts')
-rw-r--r--src/layouts/_card-list.scss78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/layouts/_card-list.scss b/src/layouts/_card-list.scss
new file mode 100644
index 0000000..c27b297
--- /dev/null
+++ b/src/layouts/_card-list.scss
@@ -0,0 +1,78 @@
1@use 'iro-sass/src/index' as iro;
2@use '../functions' as fn;
3@use 'include-media/dist/include-media' as media;
4
5@include iro.props-namespace('card-list') {
6 @include iro.props-store((
7 --dims: (
8 --row-gap: fn.global-dim(--size --800),
9 --col-gap: fn.global-dim(--size --400),
10
11 --grid: (
12 --row-gap: fn.global-dim(--size --800),
13 --col-gap: fn.global-dim(--size --400),
14 --col-width: fn.global-dim(--size --3200),
15 ),
16 --masonry: (
17 --row-gap: fn.global-dim(--size --800),
18 --col-gap: fn.global-dim(--size --400),
19 --col-width: fn.global-dim(--size --3200),
20 ),
21 --masonry-h: (
22 --row-gap: fn.global-dim(--size --800),
23 --col-gap: fn.global-dim(--size --400),
24 --row-height: fn.global-dim(--size --3200),
25 )
26 ),
27 --colors: (
28 --border: fn.global-color(--border),
29 ),
30 ));
31
32 @include iro.bem-layout(iro.props-namespace()) {
33 display: flex;
34 flex-direction: column;
35 gap: fn.dim(--row-gap) fn.dim(--col-gap);
36
37 @include iro.bem-modifier('grid') {
38 display: grid;
39 grid-template-columns: repeat(auto-fill, minmax(fn.dim(--grid --col-width), 1fr));
40 gap: fn.dim(--grid --row-gap) fn.dim(--grid --col-gap);
41 }
42
43 @include iro.bem-modifier('masonry') {
44 display: block;
45 columns: auto fn.dim(--masonry --col-width);
46 column-gap: fn.dim(--masonry --col-gap);
47
48 @include iro.bem-elem('card') {
49 margin-bottom: fn.dim(--masonry --row-gap);
50 }
51 }
52
53 @include iro.bem-modifier('masonry-h') {
54 flex-flow: row wrap;
55 gap: fn.dim(--masonry-h --row-gap) fn.dim(--masonry-h --col-gap);
56
57 @include iro.bem-elem('card') {
58 flex: 1 0 auto;
59 max-width: 100%;
60 }
61
62 @include iro.bem-elem('card-content') {
63 height: fn.dim(--masonry-h --row-height);
64 }
65
66 @include iro.bem-elem('dummy') {
67 flex: 1 0 auto;
68 width: fn.dim(--masonry-h --row-height);
69 }
70 }
71
72 @include iro.bem-modifier('aspect-5\\/4') {
73 @include iro.bem-elem('card') {
74 aspect-ratio: 5 / 4;
75 }
76 }
77 }
78}