]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - client/src/sass/bootstrap.scss
Fix menu content overlay on tablet
[github/Chocobozzz/PeerTube.git] / client / src / sass / bootstrap.scss
1 @use '_variables' as *;
2 @use '_mixins' as *;
3
4 @import './_bootstrap-variables';
5
6 @import 'bootstrap/scss/functions';
7 @import 'bootstrap/scss/variables';
8 @import 'bootstrap/scss/maps';
9 @import 'bootstrap/scss/mixins';
10 @import 'bootstrap/scss/utilities';
11
12 @import 'bootstrap/scss/root';
13 @import 'bootstrap/scss/reboot';
14 @import 'bootstrap/scss/type';
15 @import 'bootstrap/scss/grid';
16 @import 'bootstrap/scss/forms';
17 @import 'bootstrap/scss/buttons';
18 @import 'bootstrap/scss/dropdown';
19 @import 'bootstrap/scss/button-group';
20 @import 'bootstrap/scss/nav';
21 @import 'bootstrap/scss/card';
22 @import 'bootstrap/scss/accordion';
23 @import 'bootstrap/scss/alert';
24 @import 'bootstrap/scss/close';
25 @import 'bootstrap/scss/modal';
26 @import 'bootstrap/scss/tooltip';
27 @import 'bootstrap/scss/popover';
28 @import 'bootstrap/scss/spinners';
29
30 @import 'bootstrap/scss/helpers';
31 @import 'bootstrap/scss/utilities/api';
32
33 .accordion {
34 --bs-accordion-color: #{pvar(--mainForegroundColor)};
35 --bs-accordion-bg: #{pvar(--mainBackgroundColor)};
36 }
37
38 .flex-auto {
39 flex: auto;
40 }
41
42 .c-hand {
43 cursor: pointer !important;
44 }
45
46 // ---------------------------------------------------------------------------
47 // Dropdown
48 // ---------------------------------------------------------------------------
49
50 .dropdown-menu {
51 .dropdown-header {
52 @include padding-left(1rem);
53 }
54
55 .dropdown-item {
56 color: pvar(--mainForegroundColor);
57 padding: 3px 15px;
58
59 &.active {
60 color: pvar(--mainBackgroundColor) !important;
61 background-color: pvar(--mainHoverColor);
62 opacity: 0.9;
63 }
64
65 &::after {
66 display: none;
67 }
68 }
69
70 a {
71 @include disable-default-a-behaviour;
72 }
73 }
74
75 .dropdown-divider {
76 margin: 0.3rem 0;
77 }
78
79 // ---------------------------------------------------------------------------
80 // Alert
81 // ---------------------------------------------------------------------------
82
83 .alert {
84 p:last-child {
85 margin-bottom: 0;
86 }
87 }
88
89 // ---------------------------------------------------------------------------
90 // Modal
91 // ---------------------------------------------------------------------------
92
93 @media screen and (min-width: #{breakpoint(md)}) {
94 .modal::before {
95 vertical-align: middle;
96 content: ' ';
97 height: 100%;
98 }
99
100 .modal-dialog {
101 text-align: start;
102
103 &:not(.modal-lg):not(.modal-xl) {
104 min-width: 500px;
105 width: 40vw;
106 max-width: 900px;
107 }
108 }
109 }
110
111 .modal {
112 text-align: center;
113
114 .modal-content {
115 background-color: pvar(--mainBackgroundColor);
116 word-break: break-word;
117 }
118
119 .modal-header {
120 border-bottom: 0;
121 margin-bottom: 5px;
122
123 .modal-title {
124 font-size: 20px;
125 font-weight: $font-semibold;
126 }
127
128 my-global-icon {
129 @include icon(22px);
130
131 opacity: 0.5;
132
133 &:hover {
134 opacity: 0.8;
135 }
136 }
137 }
138
139 .inputs {
140 margin-bottom: 0;
141 text-align: end;
142
143 > *:not(:first-child) {
144 @include margin-left(10px);
145 }
146 }
147 }
148
149
150 // On desktop browsers, make the content and header horizontally sticked to right not move when modal open and close
151 .modal-open {
152 overflow-y: scroll !important; // Make sure vertical scroll bar is always visible on desktop browsers to get disabled scrollbar effect
153 width: 100vw; // Make sure the content fits all the available width
154 }
155
156 // On touchscreen devices, simply overflow: hidden to avoid detached overlay on scroll
157 @media (hover: none) and (pointer: coarse) {
158 .modal-open,
159 .menu-open {
160 overflow: hidden !important;
161 }
162
163 // On touchscreen devices display content overlay when opened menu
164 .menu-open {
165 .main-col {
166 &::before {
167 background-color: #000;
168 width: 100vw;
169 height: 100vh;
170 opacity: 0.75;
171 content: '';
172 display: block;
173 position: fixed;
174 z-index: z(overlay);
175 }
176 }
177 }
178 }
179
180 // ---------------------------------------------------------------------------
181 // Nav
182 // ---------------------------------------------------------------------------
183
184 .nav .nav-link {
185 display: flex !important;
186 align-items: center;
187 height: 30px !important;
188 padding: 10px 15px !important;
189 }
190
191 .nav.nav-pills {
192 font-size: 16px !important;
193 font-weight: $font-semibold !important;
194
195 .nav-link {
196 opacity: 0.7 !important;
197
198 &.active,
199 &:hover,
200 &:active,
201 &:focus {
202 opacity: 1 !important;
203 }
204 }
205
206 a {
207 @include disable-default-a-behaviour;
208
209 color: pvar(--mainForegroundColor);
210 }
211 }
212
213 .nav-tabs .nav-link {
214 @include disable-default-a-behaviour;
215
216 color: pvar(--mainForegroundColor);
217 font-weight: $font-semibold;
218 border: 0;
219 border-bottom: 2px solid transparent;
220 opacity: 0.7;
221
222 &.active {
223 color: pvar(--mainForegroundColor);
224 background-color: pvar(--mainBackgroundColor) !important;
225 border-bottom-color: pvar(--mainColor);
226 }
227
228 &.active,
229 &:hover,
230 &:active,
231 &:focus {
232 opacity: 1;
233 }
234 }
235
236 // ---------------------------------------------------------------------------
237 // Card, collapse and accordion
238 // ---------------------------------------------------------------------------
239
240 .card {
241 background-color: pvar(--mainBackgroundColor);
242 border-color: #dee2e6;
243 }
244
245 .collapse-transition {
246 // Animation when we show/hide the filters
247 transition: max-height 0.3s;
248 display: block !important;
249 overflow: hidden !important;
250 max-height: 0;
251
252 &.show {
253 max-height: 1500px;
254 overflow: inherit !important;
255 }
256 }
257
258 .accordion-button {
259 font-size: 18px;
260
261 &:not(.collapsed) {
262 font-weight: $font-bold;
263
264 my-global-icon {
265 color: pvar(--mainColorLighter);
266 }
267 }
268 }
269
270 // ---------------------------------------------------------------------------
271 // Buttons & form controls
272 // ---------------------------------------------------------------------------
273
274 .btn:not(.btn-sm) {
275 font-size: $button-font-size;
276 line-height: 1.2;
277 }
278
279 .btn-outline-secondary {
280 border-color: pvar(--inputBorderColor);
281
282 &:focus-within,
283 &:focus,
284 &:hover {
285 color: #fff;
286 background-color: #6c757d;
287 }
288 }
289
290 .btn-group.select-button {
291 font-weight: $font-semibold;
292
293 .active {
294 @include orange-button;
295 }
296
297 :not(.active) {
298 @include grey-button;
299 }
300
301 > * {
302 @include peertube-button-link;
303
304 box-shadow: none !important;
305
306 &:not(:first-child) {
307 border-top-left-radius: 0 !important;
308 border-bottom-left-radius: 0 !important;
309 }
310
311 &:not(:last-child) {
312 border-top-right-radius: 0 !important;
313 border-bottom-right-radius: 0 !important;
314 }
315 }
316 }
317
318 .form-control {
319 color: pvar(--mainForegroundColor);
320 background-color: pvar(--inputBackgroundColor);
321 outline: none;
322 }
323
324 .input-group {
325 > .btn,
326 > .input-group-text {
327 height: $button-height;
328 }
329
330 > .input-group-text {
331 line-height: normal;
332 opacity: 0.9;
333 }
334
335 .input-group-text > .dropdown-toggle {
336 display: flex;
337 }
338 }
339
340 .input-group,
341 .btn-group {
342 .last-in-group {
343 border-top-right-radius: 3px !important;
344 border-bottom-right-radius: 3px !important;
345 }
346 }
347
348 .has-clear {
349 input {
350 @include padding-right(1.5rem !important);
351 }
352
353 .form-control-clear {
354 display: flex;
355 justify-content: center;
356 align-items: center;
357 height: 95%;
358 font-size: 14px;
359 position: absolute;
360 right: .5rem;
361 opacity: 0.4;
362
363 &:hover {
364 opacity: 0.7;
365 cursor: pointer;
366 }
367 }
368
369 input:placeholder-shown + .form-control-clear {
370 display: none;
371 }
372 }