summaryrefslogtreecommitdiffstats
path: root/src/objects/_heading.scss
blob: 77e24b4fa425d4d4f7085665dcc23d09400492cb (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
@use 'iro-sass/src/index' as iro;
@use '../functions' as fn;
@use '../mixins' as mx;
@use '../config';

@include iro.props-namespace('heading') {
    @include iro.props-store((
        --dims: (
            --spacing: (
                --top:         fn.global-dim(--size --500),
                --top-sibling: fn.global-dim(--size --325),
            ),
        ),
    ), 'dims');

    @include iro.props-store((
        --colors: (
            --light:  fn.global-color(--fg-hi),
            --strong: fn.global-color(--fg-lo),
            --bg:     fn.global-color(--bg-hi),
        ),
    ), 'colors');

    @include iro.bem-object(iro.props-namespace()) {
        @include mx.set-font(--headline);

        display:        block;
        letter-spacing: normal;
        text-transform: none;

        @include iro.bem-at-theme('typography') {
            margin-top:    fn.dim(--spacing --top);
            margin-bottom: 0;
    
            & + & {
                margin-top: fn.dim(--spacing --top-sibling);
            }
        }

        @include iro.bem-modifier('xxl') {
            color:     fn.color(--strong);
            font-size: fn.global-dim(--font-size --1000);
        }

        @include iro.bem-modifier('xl') {
            color:     fn.color(--strong);
            font-size: fn.global-dim(--font-size --700);
        }

        @include iro.bem-modifier('lg') {
            color:     fn.color(--strong);
            font-size: fn.global-dim(--font-size --400);
        }

        @include iro.bem-modifier('md') {
            color:     fn.color(--strong);
            font-size: fn.global-dim(--font-size --200);
        }

        @include iro.bem-modifier('sm') {
            @include mx.set-font(--standard, (
                --line-height: null,
                --size:        fn.global-dim(--font-size --100),
                --weight:      bold,
                --transform:   uppercase,
                --spacing:     1px
            ));

            color: fn.color(--strong);
        }

        @include iro.bem-modifier('xs') {
            @include mx.set-font(--standard, (
                --line-height: null,
                --size:        fn.global-dim(--font-size --50),
                --weight:      500,
                --transform:   uppercase,
                --spacing:     1px
            ));

            color: fn.color(--light);
        }

        @include iro.bem-elem('inner') {
            background-image: linear-gradient(
                to top,
                transparent .15em,
                fn.color(--bg) .15em,
                fn.color(--bg) .6em,
                transparent .6em
            );
        }
    }
}