summaryrefslogtreecommitdiffstats
path: root/src/scopes/_lists.scss
blob: bad9731dd9b31a410de940a37e2281e87763f929 (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
59
60
61
62
63
64
65
66
@use 'iro-sass/src/index' as iro;
@use '../functions' as fn;

@include iro.props-namespace('lists') {
    @include iro.props-store((
        --dims: (
            --indent:    calc(fn.global-dim(--list --indent) + 1em),
            --margin-bs: fn.global-dim(--paragraph --margin-bs),

            --compact: (
                --indent: fn.global-dim(--list --compact-indent),
            ),
        ),
        --colors: (
            --border: fn.global-color(--border-mute),
        )
    ));

    @include iro.bem-scope(iro.props-namespace()) {
        ul,
        ol {
            margin-block-start:   fn.dim(--margin-bs);
            padding-inline-start: fn.dim(--indent);

            ul,
            ol {
                margin-block-start: 0;
            }
        }

        ul {
            list-style: disc;
        }

        ol {
            list-style: decimal;
        }

        dl {
            margin-block:  fn.dim(--margin-bs) 0;
            margin-inline: 0;
            padding:       0;
        }

        dt {
            color:       fn.global-color(--heading);
            font-weight: bold;
        }

        dd {
            margin-block:  0;
            margin-inline: fn.dim(--indent) 0;
        }

        @include iro.bem-modifier('compact') {
            ul,
            ol {
                padding-inline-start: calc(fn.dim(--compact --indent) - 3px);
            }

            dd {
                margin-inline-start: calc(fn.dim(--compact --indent) - 3px);
            }
        }
    }
}