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