aboutsummaryrefslogtreecommitdiffstats
path: root/packages/excalidraw/components/Modal.scss
blob: 1a355e2e11689e23a24e363b9e0ce47efcca7ee6 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
@import "../css/variables.module.scss";

.excalidraw {
  &.excalidraw-modal-container {
    position: absolute;
    z-index: var(--zIndex-modal);
  }

  .Modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: calc(var(--space-factor) * 10);

    display: flex;
    flex-direction: column;

    .Island {
      padding: 2.5rem;
      border: 0;
      box-shadow: none;
      border-radius: 0;
    }

    &.animations-disabled {
      .Modal__background {
        animation: none;
      }

      .Modal__content {
        animation: none;
        opacity: 1;
      }
    }
  }

  .Modal__background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    background-color: rgba(#121212, 0.2);

    animation: Modal__background__fade-in 0.1s linear forwards;
  }

  .Modal__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--max-width);
    max-height: 100%;

    opacity: 0;
    transform: translateY(10px);
    animation: Modal__content_fade-in 0.025s ease-out 0s forwards;

    position: relative;
    overflow-y: auto;

    // for modals, reset blurry bg
    background: var(--island-bg-color);

    border: 1px solid var(--dialog-border-color);
    box-shadow: var(--modal-shadow);
    border-radius: 0.75rem;
    box-sizing: border-box;

    &:focus {
      outline: none;
    }
  }

  @keyframes Modal__background__fade-in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }

  @keyframes Modal__content_fade-in {
    from {
      opacity: 0;
      transform: scale(0.9);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  .Modal__close {
    color: var(--icon-fill-color);
    margin: 0;
    padding: 0.375rem;
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: 0;
    background-color: transparent;
    line-height: 0;
    cursor: pointer;

    svg {
      width: 1.5rem;
      height: 1.5rem;
    }
  }

  .Dialog--fullscreen {
    .Modal {
      padding: 0;
    }

    .Modal__content {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      max-width: 100%;
      border: 0;
      border-radius: 0;
    }
  }
}