summaryrefslogtreecommitdiffstats
path: root/src/objects/_emoji.scss
blob: 114c867a6a1d07bf6f465cdae1dd4277c976a07d (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
@use 'sass:meta';
@use 'iro-sass/src/iro-sass' as iro;
@use 'iro-sass/src/props';
@use '../props' as *;
@use 'icon.vars' as icon;

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

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

    @include iro.bem-object('emoji') {
        position:       relative;
        display:        inline-block;
        inline-size:    calc(props.get(vars.$size));
        block-size:     calc(props.get(vars.$size));
        padding:        calc(props.get(vars.$pad));
        margin:         calc(-1 * props.get(vars.$pad));
        vertical-align: props.get(vars.$valign);
        object-fit:     contain;

        @include iro.bem-modifier('icon') {
            margin:         calc(-1 * props.get(vars.$pad) - .5 * (props.get(vars.$size) - props.get(icon.$size)));
            vertical-align: props.get(icon.$valign);
        }

        @each $mod, $size, $valign in vars.$sizes {
            @include iro.bem-modifier($mod) {
                inline-size:    props.get($size);
                block-size:     props.get($size);
                vertical-align: props.get($valign);

                @include iro.bem-modifier('icon') {
                    margin: calc(-1 * props.get(vars.$pad) - .5 * (props.get($size) - props.get(icon.$size)));
                }
            }
        }

        @include iro.bem-modifier('zoomable') {
            border-radius: calc(props.get(vars.$rounding) / props.get(vars.$zoom));
            transition:    transform .2s ease, background-color .2s ease;

            &:hover {
                background-color: props.get(vars.$bg-color);
                transform:        scale(props.get(vars.$zoom));
            }
        }
    }
}