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