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

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

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

    @include bem.object('popover') {
        position:           absolute;
        inset-block-start:  0;
        inset-inline-start: 0;
        z-index:            props.get(vars.$z-index);
        padding-block:      props.get(vars.$pad-b);
        padding-inline:     props.get(vars.$pad-i);
        background-color:   props.get(vars.$bg-color);
        filter:             props.get(vars.$filter);
        border:             props.get(vars.$border-width) solid props.get(vars.$border-color);
        border-radius:      props.get(vars.$rounding);
        transform:          translate(var(--x), var(--y));

        @include bem.modifier('up-left') {
            transform: translate(var(--x), calc(var(--y) - 100%));
        }

        @include bem.modifier('up-right') {
            transform: translate(calc(var(--x) - 100%), calc(var(--y) - 100%));
        }

        @include bem.modifier('down-right') {
            transform: translate(calc(var(--x) - 100%), var(--y));
        }
    }
}