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