summaryrefslogtreecommitdiff
path: root/web/css/_src/_mixins.scss
blob: 450bf76908c2f30846e1b210e9c595bb4fa9cef2 (plain)
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
@mixin debug($color: red) {
    border: 1px solid $color;
}

@mixin clearfix {
    zoom:1;
    &:before, &:after {
        content: "\0020";
        display: block;
        height: 0;
        overflow: hidden;
    }
    &:after {
        clear: both;
    }
}

@function map-get-deep($map, $keys...) {
    @if length($keys) == 1 {
        $keys: nth($keys, 1);
    }
    $warn: "#{nth($keys, 1)}";
    $length: length($keys);
    $get: map-get($map, nth($keys, 1));

    @if $length > 1 {
        @for $i from 2 through $length {
            @if $get != null and type-of($get) == 'map' {
                $warn: $warn + "->#{nth($keys, $i)}";
                $get: map-get($get, nth($keys, $i));

                @if $get == null {
                    @return map-get-deep-warning($warn, $get);
                }
            }
            @else {
                @return map-get-deep-warning($warn, $get);
            }
        }
    }

    @return $get;
}