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

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

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

    @include bem.layout('media') {
        display:     flex;
        gap:         props.get(vars.$gap);
        align-items: center;
        line-height: 1.4;

        @each $mod, $size in vars.$sizes {
            @include bem.modifier($mod) {
                gap: props.get($size);
            }
        }

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

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

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

            @include bem.modifier('main') {
                inline-size: 100%;
            }
        }
    }
}