summaryrefslogtreecommitdiff
path: root/_sass/common/components/_modal.scss
blob: cd716281fd92e553346acc217e6e2a60f7e76a51 (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
@mixin modal($z-index: default, $color: default, $background-color: default) {
  @if $z-index == default {
    $z-index: map-get($z-indexes, modal);
  }
  @if $color == default {
    $color: $text-color-theme-dark;
  }
  @if $background-color == default {
    $background-color: $mask-color;
  }
  position: fixed;
  top: 0;
  left: 0;
  z-index: $z-index;
  width: 100%;
  height: 100%;
  color: $color;
  touch-action: none;
  background-color: $background-color;
  opacity: 0;
  @include transform(translate(100%, 0));
  @include transition(#{opacity map-get($animation, duration) map-get($animation, timing-function),
  transform 0s map-get($animation, duration) map-get($animation, timing-function)});
}
@mixin modal--show() {
  opacity: 1;
  @include transform(translate(0, 0));
  @include transition(#{opacity map-get($animation, duration) map-get($animation, timing-function)});
}

.modal {
  @include modal();
}
.modal--show {
  @include modal--show();
}
.modal--overflow {
  @include overflow(auto);
}