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

$sizes: 'gapless' 'sm' 'lg' 'xl' !default;

@include iro.props-namespace('media') {
    @include iro.props-store((
        --dims: (
            --gap: fn.global-dim(--size --150),

            --gapless: 0,
            --sm: fn.global-dim(--size --100),
            --lg: fn.global-dim(--size --300),
            --xl: fn.global-dim(--size --450),
        )
    ));

    @include iro.bem-layout(iro.props-namespace()) {
        display:     flex;
        align-items: center;
        gap:         fn.dim(--gap);
        line-height: 1.4;

        @each $size in $sizes {
            @include iro.bem-modifier($size) {
                gap: fn.dim(--#{$size});
            }
        }

        @include iro.bem-modifier('wrap') {
            flex-wrap: wrap;
        }

        @include iro.bem-elem('block') {
            flex: 0 0 auto;

            @include iro.bem-modifier('main') {
                flex-shrink:     1;
                inline-size:     100%;
                min-inline-size: 0;
            }
        }
    }
}