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

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

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

    @include bem.scope('code') {
        code {
            padding-block:    props.get(vars.$inline--pad-b);
            padding-inline:   props.get(vars.$inline--pad-i);
            color:            props.get(vars.$inline--fg);
            background-color: props.get(vars.$inline--bg);
            border-radius:    props.get(vars.$inline--rounding);
        }

        pre {
            padding-block:    props.get(vars.$block--pad-b);
            padding-inline:   props.get(vars.$block--pad-i);
            margin-block:     props.get(vars.$block--margin-bs) 0;
            margin-inline:    0;
            color:            props.get(vars.$block--fg);
            background-color: props.get(vars.$block--bg);
            border-radius:    props.get(vars.$block--rounding);

            code {
                display:           inline-block;
                padding:           0;
                margin-inline-end: props.get(vars.$block--pad-i);
                color:             currentColor;
                background-color:  transparent;
                border-radius:     0;
            }
        }
    }
}