summaryrefslogtreecommitdiffstats
path: root/src/objects/_heading.scss
blob: bdc70271c3c0cef3d046dfef2324b06c7df5fe91 (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
@use 'sass:meta';
@use 'iro-sass/src/bem';
@use 'iro-sass/src/props';
@use '../props' as *;

@forward 'heading.vars';
@use 'heading.vars' as vars;

@mixin styles {
    @include materialize-at-root(meta.module-variables('vars'));

    @include bem.object('heading') {
        display:               block;
        margin-block-start:    props.get(vars.$margin-bs);
        font-family:           props.get(vars.$font-family);
        font-weight:           props.get(vars.$font-weight);
        font-feature-settings: props.get(vars.$feature-settings);
        line-height:           props.get(vars.$line-height);
        color:                 props.get(vars.$text-color);
        text-transform:        none;
        letter-spacing:        normal;

        & + & {
            margin-block-start: props.get(vars.$margin-bs-sibling);
        }

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

        @each $mod, $font-family, $line-height, $font-size, $font-weight, $letter-spacing, $feature-settings in vars.$sizes {
            @include bem.modifier($mod) {
                font-family:           props.get($font-family);
                font-size:             props.get($font-size);
                font-weight:           props.get($font-weight);
                font-feature-settings: props.get($feature-settings);
                line-height:           props.get($line-height);
                letter-spacing:        props.get($letter-spacing);
            }
        }

        @include bem.modifier('display') {
            @each $mod, $font-family, $line-height, $font-size, $font-weight, $letter-spacing, $feature-settings in vars.$display--sizes {
                @include bem.modifier($mod) {
                    font-family:           props.get($font-family);
                    font-size:             props.get($font-size);
                    font-weight:           props.get($font-weight);
                    font-feature-settings: props.get($feature-settings);
                    line-height:           props.get($line-height);
                    letter-spacing:        props.get($letter-spacing);
                    transform:             translateX(props.get(vars.$offset));
                }
            }
        }
    }
}