]>
Commit | Line | Data |
---|---|---|
8cbc40b2 C |
1 | @use 'sass:math'; |
2 | @use '_variables' as *; | |
63c4db6d | 3 | |
27f84cc3 W |
4 | @import '_bootstrap-mixins'; |
5 | ||
26c6ee80 | 6 | @mixin disable-default-a-behaviour { |
931d3430 C |
7 | &:hover, |
8 | &:focus, | |
9 | &:active { | |
26c6ee80 | 10 | text-decoration: none !important; |
dc9c9500 C |
11 | } |
12 | ||
13 | &:focus:not(.focus-visible) { | |
26c6ee80 C |
14 | outline: none !important; |
15 | } | |
16 | } | |
c30745f3 | 17 | |
3ec8dc09 | 18 | @mixin disable-outline { |
e78980eb | 19 | &:focus:not(.focus-visible) { |
dc9c9500 | 20 | outline: none !important; |
e78980eb | 21 | } |
3ec8dc09 C |
22 | } |
23 | ||
ef80c66c C |
24 | @mixin ellipsis { |
25 | white-space: nowrap; | |
26 | overflow: hidden; | |
27 | text-overflow: ellipsis; | |
28 | } | |
0c9945d9 | 29 | |
9589907c C |
30 | @mixin muted { |
31 | color: pvar(--greyForegroundColor) !important; | |
32 | } | |
33 | ||
60c35932 C |
34 | @mixin fade-text ($fade-after, $background-color) { |
35 | position: relative; | |
36 | overflow: hidden; | |
37 | ||
931d3430 | 38 | &::after { |
60c35932 C |
39 | content: ''; |
40 | pointer-events: none; | |
41 | width: 100%; | |
42 | height: 100%; | |
43 | position: absolute; | |
44 | left: 0; | |
45 | top: 0; | |
46 | background: linear-gradient(transparent $fade-after, $background-color); | |
769ac6c1 RK |
47 | } |
48 | } | |
49 | ||
06ec4bdd | 50 | @mixin peertube-word-wrap ($with-hyphen: true) { |
fc641ded | 51 | word-break: break-word; |
7a14004b C |
52 | word-wrap: break-word; |
53 | overflow-wrap: break-word; | |
06ec4bdd C |
54 | |
55 | @if $with-hyphen { | |
56 | hyphens: auto; | |
57 | } | |
7a14004b C |
58 | } |
59 | ||
457bb213 | 60 | @mixin apply-svg-color ($color) { |
c41c0e28 | 61 | ::ng-deep .feather, |
5351a058 C |
62 | ::ng-deep .material, |
63 | ::ng-deep .misc { | |
c41c0e28 RK |
64 | color: $color; |
65 | } | |
457bb213 C |
66 | } |
67 | ||
d3217560 RK |
68 | @mixin fill-svg-color ($color) { |
69 | ::ng-deep svg { | |
70 | path { | |
71 | fill: $color; | |
72 | } | |
73 | } | |
74 | } | |
75 | ||
a6d5ff76 RK |
76 | @mixin button-focus($color) { |
77 | &:focus, | |
e40afb5b | 78 | &.focus-visible { |
6a4c30de | 79 | box-shadow: #{$focus-box-shadow-form} $color; |
e40afb5b RK |
80 | } |
81 | } | |
82 | ||
30f939c4 C |
83 | @mixin rounded-line-height-1-5 ($font-size) { |
84 | line-height: $font-size + math.round(math.div($font-size, 2)); | |
85 | } | |
86 | ||
87 | @mixin peertube-input-text($width, $font-size: $form-input-font-size) { | |
88 | @include rounded-line-height-1-5($font-size); | |
89 | ||
90 | font-size: $font-size; | |
91 | ||
92 | padding: 3px 15px; | |
c30745f3 | 93 | display: inline-block; |
c30745f3 | 94 | width: $width; |
4c8749cb | 95 | max-width: $width; |
e66883b3 RK |
96 | color: pvar(--inputForegroundColor); |
97 | background-color: pvar(--inputBackgroundColor); | |
a3345972 | 98 | border: 1px solid pvar(--inputBorderColor); |
c30745f3 | 99 | border-radius: 3px; |
9a0fc840 RK |
100 | |
101 | &::placeholder { | |
e66883b3 | 102 | color: pvar(--inputPlaceholderColor); |
9a0fc840 | 103 | } |
2860e62e | 104 | |
767bb14a C |
105 | &[readonly] { |
106 | opacity: 0.7; | |
107 | } | |
108 | ||
5c16e6bc | 109 | @media screen and (max-width: calc(#{$width} + 40px)) { |
2860e62e C |
110 | width: 100%; |
111 | } | |
8a19bee1 | 112 | } |
c30745f3 | 113 | |
5f0805d3 C |
114 | @mixin peertube-textarea ($width, $height) { |
115 | @include peertube-input-text($width); | |
116 | ||
b788e691 C |
117 | color: pvar(--textareaForegroundColor) !important; |
118 | background-color: pvar(--textareaBackgroundColor) !important; | |
5f0805d3 C |
119 | height: $height; |
120 | padding: 5px 15px; | |
5f0805d3 C |
121 | } |
122 | ||
7b272fd7 | 123 | @mixin orange-button { |
e66883b3 | 124 | @include button-focus(pvar(--mainColorLightest)); |
e40afb5b | 125 | |
931d3430 C |
126 | &, |
127 | &:active, | |
128 | &:focus { | |
15a7387d | 129 | color: #fff; |
e66883b3 | 130 | background-color: pvar(--mainColor); |
15a7387d | 131 | } |
7b272fd7 | 132 | |
15a7387d | 133 | &:hover { |
0727cab0 | 134 | color: #fff; |
e66883b3 | 135 | background-color: pvar(--mainHoverColor); |
7b272fd7 | 136 | } |
4cc66133 | 137 | |
931d3430 C |
138 | &[disabled], |
139 | &.disabled { | |
4cc66133 | 140 | cursor: default; |
cadb46d8 | 141 | color: #fff; |
a3345972 | 142 | background-color: pvar(--inputBorderColor); |
4cc66133 | 143 | } |
457bb213 C |
144 | |
145 | my-global-icon { | |
931d3430 | 146 | @include apply-svg-color(#fff); |
457bb213 | 147 | } |
7b272fd7 C |
148 | } |
149 | ||
60c35932 C |
150 | @mixin orange-button-inverted { |
151 | @include button-focus(pvar(--mainColorLightest)); | |
152 | ||
464e4ed9 | 153 | padding: 2px 13px; |
60c35932 | 154 | border: 2px solid pvar(--mainColor); |
733dbc53 | 155 | font-weight: $font-semibold; |
60c35932 | 156 | |
931d3430 C |
157 | &, |
158 | &:active, | |
159 | &:focus { | |
60c35932 C |
160 | color: pvar(--mainColor); |
161 | background-color: pvar(--mainBackgroundColor); | |
162 | } | |
163 | ||
164 | &:hover { | |
165 | color: pvar(--mainColor); | |
166 | background-color: pvar(--mainColorLightest); | |
167 | } | |
168 | ||
931d3430 C |
169 | &[disabled], |
170 | &.disabled { | |
60c35932 C |
171 | cursor: default; |
172 | color: pvar(--mainColor); | |
a3345972 | 173 | background-color: pvar(--inputBorderColor); |
60c35932 C |
174 | } |
175 | ||
176 | my-global-icon { | |
931d3430 | 177 | @include apply-svg-color(pvar(--mainColor)); |
60c35932 C |
178 | } |
179 | } | |
180 | ||
54e78847 | 181 | @mixin tertiary-button { |
a6d5ff76 RK |
182 | @include button-focus($grey-button-outline-color); |
183 | ||
e66883b3 | 184 | color: pvar(--greyForegroundColor); |
54e78847 RK |
185 | background-color: transparent; |
186 | ||
931d3430 C |
187 | &[disabled], |
188 | .disabled { | |
54e78847 RK |
189 | cursor: default; |
190 | } | |
191 | ||
192 | my-global-icon { | |
931d3430 | 193 | @include apply-svg-color(transparent); |
54e78847 RK |
194 | } |
195 | } | |
196 | ||
7b272fd7 | 197 | @mixin grey-button { |
a6d5ff76 | 198 | @include button-focus($grey-button-outline-color); |
26171379 | 199 | |
b788e691 | 200 | background-color: pvar(--greyBackgroundColor); |
1fe1e14c | 201 | color: pvar(--greyForegroundColor); |
7b272fd7 | 202 | |
931d3430 C |
203 | &:hover, |
204 | &:active, | |
205 | &:focus, | |
206 | &[disabled], | |
207 | &.disabled { | |
e66883b3 | 208 | color: pvar(--greyForegroundColor); |
b788e691 | 209 | background-color: pvar(--greySecondaryBackgroundColor); |
7b272fd7 | 210 | } |
4cc66133 | 211 | |
931d3430 C |
212 | &[disabled], |
213 | &.disabled { | |
4cc66133 C |
214 | cursor: default; |
215 | } | |
457bb213 C |
216 | |
217 | my-global-icon { | |
931d3430 | 218 | @include apply-svg-color(pvar(--greyForegroundColor)); |
457bb213 | 219 | } |
7b272fd7 C |
220 | } |
221 | ||
1fe1e14c RK |
222 | @mixin danger-button { |
223 | $color: lighten($color: #c54130, $amount: 10); | |
224 | $text: #fff6f5; | |
225 | ||
226 | @include button-focus(scale-color($color, $alpha: -95%)); | |
931d3430 | 227 | |
1fe1e14c RK |
228 | background-color: $color; |
229 | color: $text; | |
230 | ||
931d3430 C |
231 | &:hover, |
232 | &:active, | |
233 | &:focus, | |
234 | &[disabled], | |
235 | &.disabled { | |
1fe1e14c RK |
236 | background-color: lighten($color: $color, $amount: 10); |
237 | } | |
238 | ||
931d3430 C |
239 | &[disabled], |
240 | &.disabled { | |
1fe1e14c RK |
241 | cursor: default; |
242 | } | |
243 | ||
244 | my-global-icon { | |
931d3430 | 245 | @include apply-svg-color($text); |
1fe1e14c RK |
246 | } |
247 | } | |
248 | ||
c30745f3 | 249 | @mixin peertube-button { |
30f939c4 C |
250 | @include rounded-line-height-1-5($button-font-size); |
251 | ||
420a6043 | 252 | padding: 4px 13px; |
27bc9586 | 253 | |
931d3430 | 254 | border: 0; |
c30745f3 | 255 | font-weight: $font-semibold; |
02b2e482 C |
256 | |
257 | // Because of primeng that redefines border-radius of all input[type="..."] | |
266947e5 | 258 | border-radius: 3px !important; |
02b2e482 | 259 | |
c30745f3 | 260 | text-align: center; |
c30745f3 | 261 | cursor: pointer; |
419b520c | 262 | |
5b0ec7cd C |
263 | font-size: $button-font-size; |
264 | ||
419b520c C |
265 | my-global-icon + * { |
266 | @include margin-right(4px); | |
420a6043 | 267 | @include margin-left(4px); |
419b520c | 268 | } |
c30745f3 C |
269 | } |
270 | ||
6f03f944 C |
271 | @mixin peertube-button-big { |
272 | height: auto; | |
273 | padding: 10px 25px; | |
274 | font-size: 18px; | |
275 | line-height: 1.2; | |
276 | border: 0; | |
277 | font-weight: $font-semibold; | |
278 | ||
279 | // Because of primeng that redefines border-radius of all input[type="..."] | |
280 | border-radius: 3px !important; | |
281 | } | |
282 | ||
c30745f3 | 283 | @mixin peertube-button-link { |
c30745f3 | 284 | @include disable-default-a-behaviour; |
ce0e281d | 285 | @include peertube-button; |
2295ce6c | 286 | |
aa0f1963 | 287 | display: inline-block; |
931d3430 | 288 | } |
aa0f1963 | 289 | |
c0e3d9ff C |
290 | @mixin peertube-button-big-link { |
291 | @include disable-default-a-behaviour; | |
292 | @include peertube-button-big; | |
293 | ||
294 | display: inline-block; | |
295 | } | |
296 | ||
931d3430 | 297 | @mixin peertube-button-outline { |
aa0f1963 RK |
298 | @include disable-default-a-behaviour; |
299 | @include peertube-button; | |
300 | ||
931d3430 | 301 | display: inline-block; |
aa0f1963 RK |
302 | border: 1px solid; |
303 | } | |
304 | ||
457bb213 C |
305 | @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) { |
306 | my-global-icon { | |
27bc9586 C |
307 | @include margin-right($margin-right); |
308 | ||
457bb213 C |
309 | position: relative; |
310 | width: $width; | |
457bb213 C |
311 | top: $top; |
312 | } | |
313 | } | |
314 | ||
1ea7da81 | 315 | @mixin peertube-file { |
c5911fd3 C |
316 | position: relative; |
317 | overflow: hidden; | |
318 | display: inline-block; | |
c5911fd3 | 319 | |
c5911fd3 C |
320 | input[type=file] { |
321 | position: absolute; | |
322 | top: 0; | |
323 | right: 0; | |
e61151b0 RK |
324 | width: 100%; |
325 | height: 100%; | |
c5911fd3 | 326 | font-size: 100px; |
27bc9586 | 327 | text-align: end; |
c5911fd3 C |
328 | filter: alpha(opacity=0); |
329 | opacity: 0; | |
330 | outline: none; | |
420a6043 | 331 | background: pvar(--mainBackgroundColor); |
c5911fd3 C |
332 | cursor: inherit; |
333 | display: block; | |
334 | } | |
335 | } | |
336 | ||
1ea7da81 | 337 | @mixin peertube-button-file ($width) { |
1ea7da81 RK |
338 | @include peertube-file; |
339 | @include peertube-button; | |
931d3430 C |
340 | |
341 | width: $width; | |
1ea7da81 RK |
342 | } |
343 | ||
0727cab0 C |
344 | @mixin icon ($size) { |
345 | display: inline-block; | |
346 | background-repeat: no-repeat; | |
347 | background-size: contain; | |
348 | width: $size; | |
349 | height: $size; | |
350 | vertical-align: middle; | |
351 | cursor: pointer; | |
352 | } | |
4cc66133 | 353 | |
d89fcd1e C |
354 | @mixin responsive-width ($width) { |
355 | width: $width; | |
356 | ||
357 | @media screen and (max-width: $width) { | |
358 | width: 100%; | |
359 | } | |
360 | } | |
52c4976f | 361 | |
15a7387d C |
362 | @mixin peertube-select-container ($width) { |
363 | padding: 0; | |
364 | margin: 0; | |
4cc66133 C |
365 | width: $width; |
366 | border-radius: 3px; | |
e66883b3 RK |
367 | color: pvar(--inputForegroundColor); |
368 | background: pvar(--inputBackgroundColor); | |
15a7387d | 369 | position: relative; |
ebe9b6b3 | 370 | height: min-content; |
15a7387d | 371 | |
2f4c784a C |
372 | &.disabled { |
373 | background-color: #E5E5E5; | |
374 | ||
375 | select { | |
376 | cursor: default; | |
377 | } | |
378 | } | |
4c8749cb | 379 | |
8d8a037e JB |
380 | select[disabled] { |
381 | background-color: #f9f9f9; | |
382 | } | |
2f4c784a | 383 | |
2c3abc4f C |
384 | @media screen and (max-width: $width) { |
385 | width: 100%; | |
386 | } | |
387 | ||
931d3430 | 388 | &::after { |
bc4c9cc1 C |
389 | top: 50%; |
390 | right: calc(0% + 15px); | |
391 | content: ' '; | |
392 | height: 0; | |
393 | width: 0; | |
394 | position: absolute; | |
395 | pointer-events: none; | |
396 | border: 5px solid rgba(0, 0, 0, 0); | |
dec437aa | 397 | border-top-color: pvar(--mainForegroundColor); |
bc4c9cc1 C |
398 | margin-top: -2px; |
399 | z-index: 100; | |
15a7387d C |
400 | } |
401 | ||
402 | select { | |
30f939c4 C |
403 | @include rounded-line-height-1-5($form-input-font-size); |
404 | ||
405 | font-size: $form-input-font-size; | |
406 | ||
407 | padding: 3px 35px 3px 12px; | |
15a7387d | 408 | position: relative; |
a3345972 | 409 | border: 1px solid pvar(--inputBorderColor); |
15a7387d C |
410 | background: transparent none; |
411 | appearance: none; | |
108af661 | 412 | text-overflow: ellipsis; |
e66883b3 | 413 | color: pvar(--mainForegroundColor); |
15a7387d C |
414 | |
415 | &:focus { | |
416 | outline: none; | |
417 | } | |
418 | ||
419 | &:-moz-focusring { | |
420 | color: transparent; | |
421 | text-shadow: 0 0 0 #000; | |
422 | } | |
aa879092 C |
423 | |
424 | option { | |
425 | color: #000; | |
4c0b4a08 C |
426 | |
427 | &[value=undefined] { | |
428 | font-weight: $font-semibold; | |
429 | } | |
aa879092 | 430 | } |
15a7387d | 431 | } |
654a188f RK |
432 | |
433 | &.peertube-select-button { | |
434 | @include grey-button; | |
435 | ||
4c0b4a08 | 436 | select { |
654a188f RK |
437 | font-weight: $font-semibold; |
438 | color: pvar(--greyForegroundColor); | |
931d3430 | 439 | border: 0; |
30f939c4 C |
440 | |
441 | // No border, add +1 to vertical padding | |
442 | padding: 4px 35px 4px 12px; | |
654a188f RK |
443 | } |
444 | } | |
15a7387d C |
445 | } |
446 | ||
dd24f1bb | 447 | // Thanks: https://codepen.io/manabox/pen/raQmpL |
5f0805d3 | 448 | @mixin peertube-radio-container { |
5b0ec7cd C |
449 | label { |
450 | font-size: $form-input-font-size; | |
451 | } | |
452 | ||
dd24f1bb C |
453 | [type=radio]:checked, |
454 | [type=radio]:not(:checked) { | |
455 | position: absolute; | |
e4d9696a C |
456 | opacity: 0; |
457 | cursor: pointer; | |
458 | height: 0; | |
459 | width: 0; | |
dd24f1bb | 460 | } |
5f0805d3 | 461 | |
dd24f1bb C |
462 | [type=radio]:checked + label, |
463 | [type=radio]:not(:checked) + label { | |
464 | position: relative; | |
465 | padding-left: 28px; | |
466 | cursor: pointer; | |
467 | line-height: 20px; | |
468 | display: inline-block; | |
3eb7ee65 | 469 | font-weight: $font-regular; |
dd24f1bb | 470 | } |
5f0805d3 | 471 | |
dd24f1bb C |
472 | [type=radio]:checked + label::before, |
473 | [type=radio]:not(:checked) + label::before { | |
474 | content: ''; | |
475 | position: absolute; | |
476 | left: 0; | |
477 | top: 0; | |
478 | width: 18px; | |
479 | height: 18px; | |
a3345972 | 480 | border: 1px solid pvar(--inputBorderColor); |
dd24f1bb C |
481 | border-radius: 100%; |
482 | background: #fff; | |
483 | } | |
484 | ||
485 | [type=radio]:checked + label::after, | |
486 | [type=radio]:not(:checked) + label::after { | |
487 | content: ''; | |
488 | width: 10px; | |
489 | height: 10px; | |
490 | background: pvar(--mainColor); | |
491 | position: absolute; | |
492 | top: 4px; | |
493 | left: 4px; | |
494 | border-radius: 100%; | |
495 | transition: all 0.2s ease; | |
496 | } | |
497 | [type=radio]:not(:checked) + label::after { | |
498 | opacity: 0; | |
499 | transform: scale(0); | |
500 | } | |
501 | [type=radio]:checked + label::after { | |
502 | opacity: 1; | |
503 | transform: scale(1); | |
5f0805d3 | 504 | } |
3eb7ee65 C |
505 | |
506 | .form-group-description { | |
507 | display: block; | |
1e2fe802 | 508 | margin-top: -7px; |
3eb7ee65 C |
509 | margin-bottom: 10px; |
510 | margin-left: 29px; | |
511 | } | |
5f0805d3 C |
512 | } |
513 | ||
a0d69908 | 514 | @mixin peertube-checkbox ($border-width) { |
1d5342ab | 515 | opacity: 0; |
776ca9b1 | 516 | position: absolute; |
1d5342ab C |
517 | |
518 | &:focus + span { | |
e66883b3 | 519 | box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest); |
1d5342ab | 520 | } |
a0d69908 | 521 | |
931d3430 | 522 | + span { |
a0d69908 C |
523 | position: relative; |
524 | width: 18px; | |
bc20aaed | 525 | min-width: 18px; |
a0d69908 | 526 | height: 18px; |
a3345972 | 527 | border: $border-width solid pvar(--inputBorderColor); |
a0d69908 C |
528 | border-radius: 3px; |
529 | vertical-align: middle; | |
530 | cursor: pointer; | |
531 | ||
931d3430 | 532 | &::after { |
a0d69908 C |
533 | content: ''; |
534 | position: absolute; | |
535 | top: calc(2px - #{$border-width}); | |
536 | left: 5px; | |
537 | width: 5px; | |
538 | height: 12px; | |
539 | opacity: 0; | |
540 | transform: rotate(45deg) scale(0); | |
b4e55614 B |
541 | border-right: 2px solid pvar(--mainBackgroundColor); |
542 | border-bottom: 2px solid pvar(--mainBackgroundColor); | |
a0d69908 C |
543 | } |
544 | } | |
545 | ||
0f7fedc3 | 546 | &:checked + span { |
a0d69908 | 547 | border-color: transparent; |
e66883b3 | 548 | background: pvar(--mainColor); |
a0d69908 C |
549 | animation: jelly 0.6s ease; |
550 | ||
931d3430 | 551 | &::after { |
a0d69908 C |
552 | opacity: 1; |
553 | transform: rotate(45deg) scale(1); | |
554 | } | |
555 | } | |
556 | ||
931d3430 | 557 | + span + span { |
27bc9586 C |
558 | @include margin-left(5px); |
559 | ||
a0d69908 | 560 | font-weight: $font-regular; |
a0d69908 | 561 | cursor: pointer; |
6693df9d | 562 | display: inline; |
a0d69908 | 563 | } |
bbe0f064 | 564 | |
0f7fedc3 | 565 | &[disabled] + span, |
931d3430 | 566 | &[disabled] + span + span { |
bbe0f064 C |
567 | opacity: 0.5; |
568 | cursor: default; | |
569 | } | |
a0d69908 C |
570 | } |
571 | ||
746018f6 C |
572 | @mixin actor-avatar-size ($size) { |
573 | display: inline-block; | |
60c35932 C |
574 | width: $size; |
575 | height: $size; | |
576 | min-width: $size; | |
577 | min-height: $size; | |
578 | } | |
579 | ||
61cbafc1 C |
580 | @mixin actor-counters ($separator-margin: 10px) { |
581 | color: pvar(--greyForegroundColor); | |
61cbafc1 C |
582 | display: flex; |
583 | align-items: center; | |
584 | ||
585 | > *:not(:last-child)::after { | |
586 | content: '•'; | |
587 | margin: 0 $separator-margin; | |
588 | color: pvar(--mainColor); | |
589 | } | |
590 | } | |
591 | ||
0626e7af C |
592 | @mixin in-content-small-title { |
593 | text-transform: uppercase; | |
e66883b3 | 594 | color: pvar(--mainColor); |
0626e7af C |
595 | font-weight: $font-bold; |
596 | font-size: 13px; | |
170726f5 C |
597 | } |
598 | ||
482fa503 RK |
599 | @mixin settings-big-title { |
600 | text-transform: uppercase; | |
e66883b3 | 601 | color: pvar(--mainColor); |
482fa503 | 602 | font-weight: $font-bold; |
5b0ec7cd | 603 | font-size: 1rem; |
482fa503 RK |
604 | margin-bottom: 10px; |
605 | } | |
606 | ||
4beda9e1 | 607 | @mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) { |
22a16e36 | 608 | display: flex; |
4beda9e1 | 609 | min-height: $min-height; |
22a16e36 C |
610 | padding-bottom: 20px; |
611 | margin-bottom: 20px; | |
4beda9e1 C |
612 | |
613 | @if $separator { | |
a3345972 | 614 | border-bottom: 1px solid pvar(--inputBorderColor); |
4beda9e1 | 615 | } |
22a16e36 | 616 | |
0f7407d9 C |
617 | @media screen and (max-width: $small-view) { |
618 | @if $column-responsive { | |
619 | flex-direction: column; | |
620 | height: auto; | |
621 | align-items: center; | |
622 | } @else { | |
623 | min-height: initial; | |
624 | padding-bottom: 10px; | |
625 | margin-bottom: 10px; | |
626 | } | |
22a16e36 | 627 | } |
6aff854c | 628 | } |
c5a1ae50 C |
629 | |
630 | @mixin dropdown-with-icon-item { | |
bc584963 | 631 | padding: 6px 15px; |
c5a1ae50 C |
632 | |
633 | my-global-icon { | |
27bc9586 C |
634 | @include margin-right(10px); |
635 | ||
bc584963 RK |
636 | width: 22px; |
637 | opacity: .7; | |
c5a1ae50 C |
638 | position: relative; |
639 | top: -2px; | |
640 | } | |
641 | } | |
e61151b0 | 642 | |
66927c05 | 643 | @mixin progressbar($small: false) { |
dec437aa | 644 | background-color: pvar(--greyBackgroundColor); |
e61151b0 RK |
645 | display: flex; |
646 | height: 1rem; | |
647 | overflow: hidden; | |
648 | font-size: 0.75rem; | |
649 | border-radius: 0.25rem; | |
bc99dfe5 RK |
650 | position: relative; |
651 | ||
652 | span { | |
653 | position: absolute; | |
dec437aa | 654 | color: pvar(--greyForegroundColor); |
d94b8ecf | 655 | |
66927c05 RK |
656 | @if $small { |
657 | top: -1px; | |
658 | } | |
bc99dfe5 RK |
659 | |
660 | &:nth-of-type(1) { | |
661 | left: .2rem; | |
662 | } | |
663 | &:nth-of-type(2) { | |
664 | right: .2rem; | |
665 | } | |
666 | } | |
e61151b0 RK |
667 | |
668 | .progress-bar { | |
e66883b3 RK |
669 | color: pvar(--mainBackgroundColor); |
670 | background-color: pvar(--mainColor); | |
e61151b0 RK |
671 | display: flex; |
672 | flex-direction: column; | |
673 | justify-content: center; | |
674 | text-align: center; | |
675 | white-space: nowrap; | |
676 | transition: width 0.6s ease; | |
677 | ||
d4132d3f RK |
678 | &.red { |
679 | background-color: lighten($color: #c54130, $amount: 10); | |
680 | } | |
e61151b0 RK |
681 | } |
682 | } | |
76314386 RK |
683 | |
684 | @mixin breadcrumb { | |
685 | display: flex; | |
686 | flex-wrap: wrap; | |
5b0ec7cd | 687 | padding: 0; |
76314386 RK |
688 | margin-bottom: 1rem; |
689 | list-style: none; | |
5b0ec7cd | 690 | font-weight: $font-semibold; |
76314386 RK |
691 | |
692 | .breadcrumb-item { | |
693 | display: flex; | |
694 | ||
695 | a { | |
e66883b3 | 696 | color: pvar(--mainColor); |
76314386 RK |
697 | } |
698 | ||
931d3430 | 699 | + .breadcrumb-item { |
27bc9586 C |
700 | @include padding-left(0.5rem); |
701 | ||
76314386 | 702 | &::before { |
27bc9586 C |
703 | @include padding-right(0.5rem); |
704 | ||
76314386 | 705 | display: inline-block; |
76314386 | 706 | color: #6c757d; |
931d3430 | 707 | content: '/'; |
76314386 RK |
708 | } |
709 | } | |
710 | ||
711 | &.active { | |
712 | color: #6c757d; | |
713 | } | |
714 | } | |
715 | } | |
716 | ||
717 | @mixin dashboard { | |
718 | display: flex; | |
719 | flex-wrap: wrap; | |
720 | margin: 0 -5px; | |
721 | ||
931d3430 | 722 | > div { |
76314386 | 723 | box-sizing: border-box; |
8cbc40b2 | 724 | flex: 0 0 percentage(math.div(1, 3)); |
76314386 RK |
725 | padding: 0 5px; |
726 | margin-bottom: 10px; | |
727 | ||
931d3430 | 728 | > a { |
d1261d9a RK |
729 | @include disable-default-a-behaviour; |
730 | ||
76314386 RK |
731 | text-decoration: none; |
732 | color: inherit; | |
733 | display: block; | |
734 | font-size: 18px; | |
735 | ||
736 | &:active, | |
737 | &:focus, | |
738 | &:hover { | |
739 | opacity: .8; | |
740 | } | |
741 | } | |
742 | ||
931d3430 C |
743 | > a, |
744 | > div { | |
76314386 | 745 | padding: 20px; |
218f730c | 746 | background: pvar(--submenuBackgroundColor); |
76314386 RK |
747 | border-radius: 4px; |
748 | box-sizing: border-box; | |
749 | height: 100%; | |
750 | } | |
751 | } | |
752 | ||
931d3430 C |
753 | .dashboard-num, |
754 | .dashboard-text { | |
76314386 RK |
755 | text-align: center; |
756 | font-size: 130%; | |
e66883b3 | 757 | color: pvar(--mainForegroundColor); |
76314386 RK |
758 | line-height: 30px; |
759 | margin-bottom: 20px; | |
760 | } | |
761 | ||
762 | .dashboard-label { | |
763 | font-size: 90%; | |
e66883b3 | 764 | color: pvar(--inputPlaceholderColor); |
76314386 RK |
765 | text-align: center; |
766 | } | |
767 | } | |
a6d5ff76 | 768 | |
218f730c | 769 | @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) { |
b515c98c RK |
770 | width: 95%; |
771 | border-top: .05rem solid $color; | |
772 | height: .05rem; | |
773 | text-align: center; | |
774 | display: block; | |
775 | position: relative; | |
776 | ||
777 | &[data-content] { | |
778 | margin: .8rem 0; | |
779 | ||
780 | &::after { | |
781 | background: $background; | |
782 | color: $color; | |
783 | content: attr(data-content); | |
784 | display: inline-block; | |
785 | font-size: .7rem; | |
786 | padding: 0 .4rem; | |
787 | transform: translateY(-.65rem); | |
788 | } | |
789 | } | |
790 | } | |
d6af8146 RK |
791 | |
792 | @mixin chip { | |
9589907c | 793 | --avatar-size: 1.2rem; |
d6af8146 | 794 | |
d6af8146 | 795 | display: inline-flex; |
e66883b3 | 796 | color: pvar(--mainForegroundColor); |
9589907c | 797 | height: var(--avatar-size); |
d6af8146 RK |
798 | max-width: 320px; |
799 | overflow: hidden; | |
d6af8146 RK |
800 | text-decoration: none; |
801 | text-overflow: ellipsis; | |
802 | vertical-align: middle; | |
803 | white-space: nowrap; | |
804 | ||
f6e98f0a | 805 | my-actor-avatar { |
27bc9586 | 806 | @include margin-right(.2rem); |
9589907c C |
807 | |
808 | border-radius: 5rem; | |
809 | width: var(--avatar-size); | |
810 | height: var(--avatar-size); | |
d6af8146 RK |
811 | } |
812 | ||
813 | &.two-lines { | |
9589907c | 814 | --avatar-size: 2rem; |
d6af8146 | 815 | |
9589907c C |
816 | font-size: 14px; |
817 | line-height: 1rem; | |
d6af8146 | 818 | |
f6e98f0a | 819 | my-actor-avatar { |
d0800f76 | 820 | display: inline-block; |
d6af8146 RK |
821 | } |
822 | ||
9589907c | 823 | > div { |
d6af8146 RK |
824 | display: flex; |
825 | flex-direction: column; | |
d6af8146 RK |
826 | justify-content: center; |
827 | } | |
828 | } | |
829 | } | |
7a03209d | 830 | |
cdeddff1 C |
831 | // applies ratio (default to 16:9) to a child element (using $selector) only using |
832 | // an immediate's parent size. This allows to set a ratio without explicit | |
e66883b3 | 833 | // dimensions, as width/height cannot be computed from each other. |
8cbc40b2 | 834 | @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) { |
cdeddff1 C |
835 | $padding-percent: percentage($inverted-ratio); |
836 | ||
e66883b3 RK |
837 | position: relative; |
838 | height: 0; | |
839 | width: 100%; | |
cdeddff1 | 840 | padding-top: $padding-percent; |
e66883b3 RK |
841 | |
842 | #{$selector} { | |
843 | position: absolute; | |
844 | width: 100%; | |
845 | height: 100%; | |
846 | top: 0; | |
37a44fc9 | 847 | |
e66883b3 RK |
848 | @content; |
849 | } | |
850 | } | |
ed5bb517 K |
851 | |
852 | @mixin sub-menu-h1 { | |
853 | ::ng-deep h1 { | |
854 | font-size: 1.3rem; | |
855 | border-bottom: 2px solid $grey-background-color; | |
856 | padding-bottom: 15px; | |
857 | margin-bottom: $sub-menu-margin-bottom; | |
858 | ||
cd262619 | 859 | > span > my-global-icon, |
205e4f56 | 860 | > my-global-icon { |
27bc9586 | 861 | @include margin-right(10px); |
ed5bb517 K |
862 | width: 24px; |
863 | height: 24px; | |
cd262619 | 864 | vertical-align: top; |
ed5bb517 K |
865 | } |
866 | ||
4c8749cb | 867 | .pt-badge { |
27bc9586 | 868 | @include margin-left(7px); |
4c8749cb | 869 | |
cd262619 | 870 | vertical-align: top; |
ed5bb517 K |
871 | } |
872 | } | |
873 | } | |
4572c3d0 C |
874 | |
875 | @mixin play-icon ($width, $height) { | |
876 | width: 0; | |
877 | height: 0; | |
878 | ||
879 | position: absolute; | |
880 | left: 50%; | |
881 | top: 50%; | |
882 | transform: translate(-50%, -50%) scale(0.5); | |
883 | ||
8cbc40b2 C |
884 | border-top: #{math.div($height, 2)} solid transparent; |
885 | border-bottom: #{math.div($height, 2)} solid transparent; | |
4572c3d0 C |
886 | |
887 | border-left: $width solid rgba(255, 255, 255, 0.95); | |
888 | } | |
0f7407d9 C |
889 | |
890 | @mixin on-small-main-col () { | |
891 | :host-context(.main-col:not(.expanded)) { | |
892 | @media screen and (max-width: $small-view + $menu-width) { | |
893 | @content; | |
894 | } | |
895 | } | |
896 | ||
897 | :host-context(.main-col.expanded) { | |
898 | @media screen and (max-width: $small-view) { | |
899 | @content; | |
900 | } | |
901 | } | |
902 | } | |
903 | ||
904 | @mixin on-mobile-main-col () { | |
905 | :host-context(.main-col:not(.expanded)) { | |
906 | @media screen and (max-width: $mobile-view + $menu-width) { | |
907 | @content; | |
908 | } | |
909 | } | |
910 | ||
911 | :host-context(.main-col.expanded) { | |
912 | @media screen and (max-width: $mobile-view) { | |
913 | @content; | |
914 | } | |
915 | } | |
916 | } | |
27bc9586 | 917 | |
4158e67c | 918 | @mixin margin ($arg1: null, $arg2: null, $arg3: null, $arg4: null) { |
7bbc062d | 919 | @if $arg2 == null and $arg3 == null and $arg4 == null { |
4158e67c | 920 | @include margin-original($arg1, $arg1, $arg1, $arg1); |
7bbc062d | 921 | } @else if $arg3 == null and $arg4 == null { |
4158e67c | 922 | @include margin-original($arg1, $arg2, $arg1, $arg2); |
7bbc062d | 923 | } @else if $arg4 == null { |
4158e67c W |
924 | @include margin-original($arg1, $arg2, $arg3, $arg2); |
925 | } @else { | |
926 | @include margin-original($arg1, $arg2, $arg3, $arg4); | |
927 | } | |
928 | } | |
929 | ||
930 | @mixin margin-original ($block-start, $inline-end, $block-end, $inline-start) { | |
27bc9586 C |
931 | @include margin-left($inline-start); |
932 | @include margin-right($inline-end); | |
27f84cc3 W |
933 | @include margin-top($block-start); |
934 | @include margin-bottom($block-end); | |
27bc9586 C |
935 | } |
936 | ||
27bc9586 C |
937 | @mixin margin-left ($value) { |
938 | @supports (margin-inline-start: $value) { | |
27f84cc3 | 939 | @include rfs($value, margin-inline-start); |
27bc9586 C |
940 | } |
941 | ||
942 | @supports not (margin-inline-start: $value) { | |
27f84cc3 | 943 | @include rfs($value, margin-left); |
27bc9586 C |
944 | } |
945 | } | |
946 | ||
947 | @mixin margin-right ($value) { | |
948 | @supports (margin-inline-end: $value) { | |
27f84cc3 | 949 | @include rfs($value, margin-inline-end); |
27bc9586 C |
950 | } |
951 | ||
952 | @supports not (margin-inline-end: $value) { | |
27f84cc3 | 953 | @include rfs($value, margin-right); |
27bc9586 C |
954 | } |
955 | } | |
956 | ||
4158e67c W |
957 | @mixin padding-original ($block-start, $inline-end, $block-end, $inline-start) { |
958 | @include padding-left($inline-start); | |
959 | @include padding-right($inline-end); | |
960 | @include padding-top($block-start); | |
961 | @include padding-bottom($block-end); | |
962 | } | |
963 | ||
964 | ||
965 | @mixin padding ($arg1: null, $arg2: null, $arg3: null, $arg4: null) { | |
7bbc062d | 966 | @if $arg2 == null and $arg3 == null and $arg4 == null { |
4158e67c | 967 | @include padding-original($arg1, $arg1, $arg1, $arg1); |
7bbc062d | 968 | } @else if $arg3 == null and $arg4 == null { |
4158e67c | 969 | @include padding-original($arg1, $arg2, $arg1, $arg2); |
7bbc062d | 970 | } @else if $arg4 == null { |
4158e67c W |
971 | @include padding-original($arg1, $arg2, $arg3, $arg2); |
972 | } @else { | |
973 | @include padding-original($arg1, $arg2, $arg3, $arg4); | |
974 | } | |
975 | } | |
976 | ||
27bc9586 C |
977 | @mixin padding-left ($value) { |
978 | @supports (padding-inline-start: $value) { | |
27f84cc3 | 979 | @include rfs($value, padding-inline-start); |
27bc9586 C |
980 | } |
981 | ||
982 | @supports not (padding-inline-start: $value) { | |
27f84cc3 | 983 | @include rfs($value, padding-left); |
27bc9586 C |
984 | } |
985 | } | |
986 | ||
987 | @mixin padding-right ($value) { | |
988 | @supports (padding-inline-end: $value) { | |
27f84cc3 | 989 | @include rfs($value, padding-inline-end); |
27bc9586 C |
990 | } |
991 | ||
992 | @supports not (padding-inline-end: $value) { | |
27f84cc3 | 993 | @include rfs($value, padding-right); |
27bc9586 C |
994 | } |
995 | } |