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