summaryrefslogtreecommitdiffstats
path: root/src/scopes/_lists.scss
blob: 1322f2d5c5b109fcce8a3e7ed4ddab3200a4adfe (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
67
@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-top: fn.global-dim(--paragraph --margin-top),

            --compact: (
                --indent: fn.global-dim(--list --compact-indent),
            ),
        )
    ), 'dims');

    @include iro.props-store((
        --colors: (
            --border: fn.global-color(--obj-hi),
        )
    ), 'colors');

    @include iro.bem-scope(iro.props-namespace()) {
        ul,
        ol {
            margin-top:   fn.dim(--margin-top);
            padding-left: fn.dim(--indent);

            ul,
            ol {
                margin-top: 0;
            }
        }

        ul {
            list-style: disc;
        }

        ol {
            list-style: decimal;
        }

        dl {
            margin:  fn.dim(--margin-top) 0 0;
            padding: 0;
        }

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

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

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

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