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