aboutsummaryrefslogtreecommitdiff
path: root/src/components/settings_modal/settings_modal.scss
blob: 49ef83e0141f126338c73699a854e6736c7f0dbe (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
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
@import "src/variables";

.settings-modal {
  overflow: hidden;

  .setting-list,
  .option-list {
    list-style-type: none;
    padding-left: 2em;

    li {
      margin-bottom: 0.5em;
    }

    .suboptions {
      margin-top: 0.3em;
    }
  }

  .setting-description {
    margin-top: 0.2em;
    margin-bottom: 2em;
    font-size: 70%;
  }

  .settings-modal-panel {
    overflow: hidden;
    transition: transform;
    transition-timing-function: ease-in-out;
    transition-duration: 300ms;
    width: 1000px;
    max-width: 90vw;
    height: 90vh;

    @media all and (max-width: 800px) {
      max-width: 100vw;
      height: 100%;
    }

    >.panel-body {
      height: 100%;
      overflow-y: hidden;

      .btn {
        min-height: 2em;
      }

      .btn:not(.dropdown-button) {
        padding: 0 2em;
      }
    }
  }

  .settings-footer {
    display: flex;
    flex-wrap: wrap;
    line-height: 2;

    >* {
      margin-right: 0.5em;
    }

    .extra-content {
      display: flex;
      flex-grow: 1;
    }
  }

  &.peek {
    .settings-modal-panel {
      /* Explanation:
       * Modal is positioned vertically centered.
       * 100vh - 100% = Distance between modal's top+bottom boundaries and screen
       * (100vh - 100%) / 2 = Distance between bottom (or top) boundary and screen
       * + 100% - we move modal completely off-screen, it's top boundary touches
       *   bottom of the screen
       * - 50px - leaving tiny amount of space so that titlebar + tiny amount of modal is visible
       */
      transform: translateY(calc(((100vh - 100%) / 2 + 100%) - 50px));

      @media all and (max-width: 800px) {
        /* For mobile, the modal takes 100% of the available screen.
           This ensures the minimized modal is always 50px above the browser bottom
           bar regardless of whether or not it is visible.
        */
        transform: translateY(calc(100% - 50px));
      }
    }
  }
}