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