summaryrefslogtreecommitdiffstats
path: root/assets/css/layouts/_card-list.scss
blob: 92c89b73295f9833701a2860db9ed43687b69028 (plain) (blame)
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
56
57
@use 'iro-sass/src/index' as iro;
@use 'iro-design/src/functions' as fn;

@include iro.props-namespace('card-list') {
    @include iro.props-store((
        --dims: (
            --margin-top: fn.global-dim(--size --700),
            --spacing:    fn.global-dim(--size --200),
            --gap:        fn.global-dim(--size --25),
            --grid-2: (
                --gap:       fn.global-dim(--size --75),
                --col-width: fn.global-dim(--size --3200),
            ),
            --grid-3: (
                --gap:       fn.global-dim(--size --75),
                --col-width: fn.global-dim(--size --2400),
            ),
            --gallery-2: (
                --gap:       fn.global-dim(--size --200),
                --col-width: fn.global-dim(--size --3200),
            ),
            --gallery-3: (
                --gap:       fn.global-dim(--size --200),
                --col-width: fn.global-dim(--size --2400),
            ),
        )
    ), 'dims');

    @include iro.bem-layout(iro.props-namespace()) {
        margin-top: fn.dim(--margin-top);
        font-size:  fn.global-dim(--font-size --100);

        @include iro.bem-elem('header') {
            margin-top: fn.dim(--margin-top);
        }

        @include iro.bem-elem('footer') {
            margin-top: fn.dim(--spacing);
        }

        @include iro.bem-elem('cards') {
            display:        flex;
            flex-direction: column;
            gap:            fn.dim(--gap);
            margin-top:     fn.dim(--spacing);

            @each $mode in 'grid-2' 'grid-3' 'gallery-2' 'gallery-3' {
                @include iro.bem-modifier($mode) {
                    display:               grid;
                    align-items:           start;
                    grid-template-columns: repeat(auto-fill, minmax(fn.dim('--#{$mode}' --col-width), 1fr));
                    gap:                   fn.dim('--#{$mode}' --gap);
                }
            }
        }
    }
}