summaryrefslogtreecommitdiffstats
path: root/src/layouts/_bubble-group.scss
blob: 9336b4475ca6efba0d981dc26a50780edf8b680d (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
@use 'iro-sass/src/index' as iro;
@use '../functions' as fn;

@include iro.props-namespace('bubble-group') {
    @include iro.props-store((
        --dims: (
            --spacing-x: fn.global-dim(--size --225),
            --spacing-y: fn.global-dim(--size --150),

            --compact: (
                --spacing-x: fn.global-dim(--size --225),
                --spacing-y: fn.global-dim(--size --50),
            )
        )
    ), 'dims');

    @include iro.bem-layout(iro.props-namespace()) {
        display:               grid;
        grid-template-columns: auto 1fr;
        grid-auto-rows:        auto;
        grid-template-areas:   'avatar bubble';
        align-items:           flex-start;
        gap:                   fn.dim(--spacing-y) fn.dim(--spacing-x);
        
        @include iro.bem-elem('avatar') {
            grid-area: avatar;
        }
        
        @include iro.bem-elem('bubble') {
            grid-column: bubble;
            min-width:   0;
        }
        
        @include iro.bem-modifier('compact') {
            justify-items: start;
            gap:           fn.dim(--compact --spacing-y) fn.dim(--compact --spacing-x);
        }
        
        @include iro.bem-modifier('arrow') {
            @include iro.bem-elem('avatar') {
                @include iro.bem-next-elem('bubble') {
                    &::before {
                        display: block;
                    }
                }
            }
        }
    }
}