summaryrefslogtreecommitdiffstats
path: root/src/_utils.scss
blob: 99c751c3fa118114cde1aa97e2fdde12d00617e0 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
@use 'iro-sass/src/index' as iro;
@use 'functions' as fn;

$dirs: (
    '': '',
    't': '-top',
    'r': '-right',
    'b': '-bottom',
    'l': '-left',
);

@include iro.bem-utility('d-block') {
    display: block;
}

@include iro.bem-utility('d-contents') {
    display: contents;
}

@include iro.bem-utility('o-auto') {
    overflow: auto;
}

@include iro.bem-utility('elp') {
    overflow:      hidden;
    text-overflow: ellipsis;
}

@include iro.bem-utility('p-static') {
    position: static;
}

@include iro.bem-utility('p-relative') {
    position: relative;
}

@each $dir, $suffix in $dirs {
    @include iro.bem-utility('m#{$dir}-auto') {
        margin#{$suffix}: auto;
    }

    @include iro.bem-utility('m#{$dir}-0') {
        margin#{$suffix}: 0;
    }

    @each $size in ('xxs' 'xs' 'sm' 'md' 'lg' 'xl') {
        @include iro.bem-utility('m#{$dir}-#{$size}') {
            margin#{$suffix}: fn.global-dim(--spacing --#{$size});
        }
    }
}

@each $dir, $suffix in $dirs {
    @include iro.bem-utility('p#{$dir}-auto') {
        padding#{$suffix}: auto;
    }

    @include iro.bem-utility('p#{$dir}-0') {
        padding#{$suffix}: 0;
    }

    @each $size in ('xxs' 'xs' 'sm' 'md' 'lg' 'xl') {
        @include iro.bem-utility('p#{$dir}-#{$size}') {
            padding#{$suffix}: fn.global-dim(--spacing --#{$size});
        }
    }
}