summaryrefslogtreecommitdiffstats
path: root/src/objects/_popover.scss
blob: 5ad58ece10e42dc03bb6f8f1217e7d49883e5e83 (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
@use 'iro-sass/src/index' as iro;
@use '../functions' as fn;

@include iro.props-namespace('popover') {
    @include iro.props-store((
        --dims: (
            --z-index:   10000,
            --pad-i:     0,
            --pad-b:     fn.global-dim(--size --85),
            --separator: fn.global-dim(--size --85),
            --rounding:  fn.global-dim(--rounding),
            --border:    fn.global-dim(--border --thin),
        ),
        --colors: (
            --bg:        fn.global-color(--bg-l2),
            --border:    fn.global-color(--border),
            --filter:    drop-shadow(
                fn.global-dim(--shadow --x)
                fn.global-dim(--shadow --y)
                fn.global-dim(--shadow --blur)
                fn.global-color(--shadow)
            ),
        ),
    ));

    @include iro.bem-object(iro.props-namespace()) {
        position:           absolute;
        z-index:            fn.dim(--z-index);
        inset-block-start:  0;
        inset-inline-start: 0;
        padding-block:      fn.dim(--pad-b);
        padding-inline:     fn.dim(--pad-i);
        transform:          translate(var(--x), var(--y));
        border:             fn.dim(--border) solid fn.color(--border);
        border-radius:      fn.dim(--rounding);
        background-color:   fn.color(--bg);
        filter:             fn.color(--filter);

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

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

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