summaryrefslogtreecommitdiffstats
path: root/src/objects/_heading.scss
blob: 8ed3b17c1020709bf8c8bbd15f011c4350f7cbd6 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
@use 'iro-sass/src/iro-sass' as iro;
@use '../functions' as fn;
@use '../mixins' as mx;
@use '../config';
@use 'include-media/dist/include-media' as media;

$sizes: 'xxl' 'xl' 'lg' 'md' 'sm' 'xs';

@include iro.props-namespace('heading') {
    @include iro.props-store((
        --dims: (
            --offset: -.02em,
        ),
        --colors: (
            --bg: fn.global-color(--base --50),
        ),
    ));

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

        display:            block;
        margin-block-start: fn.global-dim(--heading --margin-bs);
        text-transform:     none;
        letter-spacing:     normal;
        transform:          translateX(fn.dim(--offset));

        & + & {
            margin-block-start: fn.global-dim(--heading --margin-bs-sibling);
        }

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

        @include iro.bem-modifier('xxl') {
            @include mx.heading-strong(--xxl);
        }

        @include iro.bem-modifier('xl') {
            @include mx.heading-strong(--xl);
        }

        @include iro.bem-modifier('lg') {
            @include mx.heading-medium(--lg);
        }

        @include iro.bem-modifier('md') {
            @include mx.heading-medium(--md);
        }

        @include iro.bem-modifier('sm') {
            @include mx.heading-faint(--sm);
        }

        @include iro.bem-modifier('xs') {
            @include mx.heading-faint(--xs);
        }

        @include iro.bem-modifier('display') {
            @include mx.set-font(--headline);

            @include iro.bem-modifier('xxl') {
                @include mx.heading-strong(--display --xxl);

                @include media.media('<=md') {
                    @include mx.heading-strong(--display-sm --xxl);
                }
            }
    
            @include iro.bem-modifier('xl') {
                @include mx.heading-strong(--display --xl);

                @include media.media('<=md') {
                    @include mx.heading-strong(--display-sm --xl);
                }
            }
    
            @include iro.bem-modifier('lg') {
                @include mx.heading-strong(--display --lg);

                @include media.media('<=md') {
                    @include mx.heading-strong(--display-sm --lg);
                }
            }
    
            @include iro.bem-modifier('md') {
                @include mx.heading-strong(--display --md);

                @include media.media('<=md') {
                    @include mx.heading-strong(--display-sm --md);
                }
            }
    
            @include iro.bem-modifier('sm') {
                @include mx.heading-medium(--display --sm);

                @include media.media('<=md') {
                    @include mx.heading-medium(--display-sm --sm);
                }
            }
    
            @include iro.bem-modifier('xs') {
                @include mx.heading-faint(--display --xs);

                @include media.media('<=md') {
                    @include mx.heading-faint(--display-sm --xs);
                }
            }
        }
    }
}