summaryrefslogtreecommitdiffstats
path: root/app/common/styles/elements/modals.scss
blob: 8481e227afd557eb67db19bb43a21ff586ec6875 (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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
.modal-overlay {
  width: 100%;
  height: 100%;
  z-index: -1;
  background-color: $primary-dark;
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  opacity: 0;
}

.modal-overlay.active {
  z-index: 100;
  opacity: 0.5;
  display: block;
  @include fastTransition-all;
}

.modal:not(.uib-modal) {
  width: auto;
  min-width: 450px;
  max-width: 960px;
  height: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 850px;
  min-width: 450px;
  padding: 0.8em 1.5em;
  border: thin $primary-dark solid;
  background-color: $background-01;
  z-index: 101;
  position: fixed;
  overflow: hidden;
  @include fastTransition-all;
  @include mediaQuery(medium) {
    padding: 2.5em;
  }
}

.modal.active {
  @include fastTransition-all;
  display: block;
}

.modal .page-header {
  padding-bottom: 0.7em;
}

.screen-reader-offscreen {
  position: absolute;
  left: -999px;
  width: 1px;
  height: 1px;
  top: auto;
}
.modal__content {
  border-bottom: 1px solid $border-color-02;
  padding-bottom: 1em;
  margin-bottom: 2em;
}
.modal__link {
  display: block;
  margin: 0.8em 0 1em;
  @include mediaQuery(medium) {
    display: inline-block;
    margin: 0.6em 0;
  }
}
// TODO: Use the form__actions pattern / selector
.modal__button-wrapper {
  float: right;
  button {
    margin-bottom: 0.8em;
    margin-right: 0.8em;
    display: inline-block;
    @include mediaQuery(medium) {
      margin-left: 0.8em;
      margin-right: 0;
    }
  }
}

/**
  * Markup  for bootstrap modal
  <div class="uib-modal__content">
    <div class="modal-header">
      <h2 class="modal-title" id="modal_label">
        Title here
      </h2>
      <button
        type="button"
        class="btn  btn--close"
        ng-click="$dismiss()"
        aria-label="close">
        <icon file="icon-close.svg" aria-hidden="true"></icon>
      </button>
    </div>
    <div class="modal-body">
      Body content
    </div>
    <div class="modal-footer">
      <button
        type="button"
        class="btn btn-secondary"
        ng-click="$dismiss()">
        Cancel
      </button>
      <button
        type="submit"
        class="btn btn-primary"
        ng-click="function()">
        Save
      </button>
    </div>
  </div>
*/

.uib-modal.fade.in {
  opacity: 1;
}

.uib-modal.in .modal-dialog {
  transform: translate(0, 10vh);
  margin-top: 50px;
  .modal-content {
    border-radius: 0;
    border-color: $primary-dark;
  }
}

.modal-backdrop.in {
  opacity: 0.5;
}

.uib-modal__content {
  padding: 1em;
  .modal-header {
    display: block;
  }
}

.uib-modal {
  .btn--close {
    position: absolute;
    right: 0;
    top: 0;
    svg {
      height: 2em;
    }
  }
}
OpenPOWER on IntegriCloud