summaryrefslogtreecommitdiffstats
path: root/assets/css/components/_card-list.scss
blob: aa6eef94201c45c0d02919af4cf61fefebf27daf (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
58
@include namespace('card-list') {
    @include store((
        --colors: (
            --title: prop(--colors --fg-lo, $global: true),
            --text:  prop(--colors --fg-hi, $global: true),
        ),
        --dims: (
            --col-width: 17em
        )
    ));

    @include component(namespace()) {
        margin-top: $line-height * 2rem;
        font-size:  1rem;

        @include element('title') {
            color: prop(--colors --title);
        }

        @include element('text') {
            color:       prop(--colors --text);
            line-height: 1.4;

            p {
                margin-top: $line-height * .25rem;
            }
        }

        @include element('cards') {
            margin-top: $line-height * .625rem;
            filter:     drop-shadow(#{prop(--dims --obj-shadow, $global: true)} #{prop(--colors --obj-shadow, $global: true)});

            @include modifier('grid') {
                display:               grid;
                grid-template-columns: repeat(auto-fill, minmax(#{prop(--dims --col-width)}, 1fr));
                gap:                   6px;
    
                @include element('card') {
                    @include next-twin-element {
                        margin-top: 0;
                    }
                }
            }

            @media print {
                filter: none;
            }
        }

        @include element('card') {
            box-shadow: none;

            @include next-twin-element {
                margin-top: 2px;
            }
        }
    }
}