]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/sass/include/_mixins.scss
Translated using Weblate (Russian)
[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
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
457bb213 607@mixin create-button {
08c1efbe
C
608 @include peertube-button-link;
609 @include orange-button;
457bb213 610 @include button-with-icon(20px, 5px, -1px);
a4f99a76 611}
22a16e36 612
4beda9e1 613@mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
22a16e36 614 display: flex;
4beda9e1 615 min-height: $min-height;
22a16e36
C
616 padding-bottom: 20px;
617 margin-bottom: 20px;
4beda9e1
C
618
619 @if $separator {
a3345972 620 border-bottom: 1px solid pvar(--inputBorderColor);
4beda9e1 621 }
22a16e36 622
0f7407d9
C
623 @media screen and (max-width: $small-view) {
624 @if $column-responsive {
625 flex-direction: column;
626 height: auto;
627 align-items: center;
628 } @else {
629 min-height: initial;
630 padding-bottom: 10px;
631 margin-bottom: 10px;
632 }
22a16e36 633 }
6aff854c 634}
c5a1ae50
C
635
636@mixin dropdown-with-icon-item {
bc584963 637 padding: 6px 15px;
c5a1ae50
C
638
639 my-global-icon {
27bc9586
C
640 @include margin-right(10px);
641
bc584963
RK
642 width: 22px;
643 opacity: .7;
c5a1ae50
C
644 position: relative;
645 top: -2px;
646 }
647}
e61151b0 648
66927c05 649@mixin progressbar($small: false) {
dec437aa 650 background-color: pvar(--greyBackgroundColor);
e61151b0
RK
651 display: flex;
652 height: 1rem;
653 overflow: hidden;
654 font-size: 0.75rem;
655 border-radius: 0.25rem;
bc99dfe5
RK
656 position: relative;
657
658 span {
659 position: absolute;
dec437aa 660 color: pvar(--greyForegroundColor);
d94b8ecf 661
66927c05
RK
662 @if $small {
663 top: -1px;
664 }
bc99dfe5
RK
665
666 &:nth-of-type(1) {
667 left: .2rem;
668 }
669 &:nth-of-type(2) {
670 right: .2rem;
671 }
672 }
e61151b0
RK
673
674 .progress-bar {
e66883b3
RK
675 color: pvar(--mainBackgroundColor);
676 background-color: pvar(--mainColor);
e61151b0
RK
677 display: flex;
678 flex-direction: column;
679 justify-content: center;
680 text-align: center;
681 white-space: nowrap;
682 transition: width 0.6s ease;
683
d4132d3f
RK
684 &.red {
685 background-color: lighten($color: #c54130, $amount: 10);
686 }
e61151b0
RK
687 }
688}
76314386
RK
689
690@mixin breadcrumb {
691 display: flex;
692 flex-wrap: wrap;
5b0ec7cd 693 padding: 0;
76314386
RK
694 margin-bottom: 1rem;
695 list-style: none;
5b0ec7cd 696 font-weight: $font-semibold;
76314386
RK
697
698 .breadcrumb-item {
699 display: flex;
700
701 a {
e66883b3 702 color: pvar(--mainColor);
76314386
RK
703 }
704
931d3430 705 + .breadcrumb-item {
27bc9586
C
706 @include padding-left(0.5rem);
707
76314386 708 &::before {
27bc9586
C
709 @include padding-right(0.5rem);
710
76314386 711 display: inline-block;
76314386 712 color: #6c757d;
931d3430 713 content: '/';
76314386
RK
714 }
715 }
716
717 &.active {
718 color: #6c757d;
719 }
720 }
721}
722
723@mixin dashboard {
724 display: flex;
725 flex-wrap: wrap;
726 margin: 0 -5px;
727
931d3430 728 > div {
76314386 729 box-sizing: border-box;
8cbc40b2 730 flex: 0 0 percentage(math.div(1, 3));
76314386
RK
731 padding: 0 5px;
732 margin-bottom: 10px;
733
931d3430 734 > a {
d1261d9a
RK
735 @include disable-default-a-behaviour;
736
76314386
RK
737 text-decoration: none;
738 color: inherit;
739 display: block;
740 font-size: 18px;
741
742 &:active,
743 &:focus,
744 &:hover {
745 opacity: .8;
746 }
747 }
748
931d3430
C
749 > a,
750 > div {
76314386 751 padding: 20px;
218f730c 752 background: pvar(--submenuBackgroundColor);
76314386
RK
753 border-radius: 4px;
754 box-sizing: border-box;
755 height: 100%;
756 }
757 }
758
931d3430
C
759 .dashboard-num,
760 .dashboard-text {
76314386
RK
761 text-align: center;
762 font-size: 130%;
e66883b3 763 color: pvar(--mainForegroundColor);
76314386
RK
764 line-height: 30px;
765 margin-bottom: 20px;
766 }
767
768 .dashboard-label {
769 font-size: 90%;
e66883b3 770 color: pvar(--inputPlaceholderColor);
76314386
RK
771 text-align: center;
772 }
773}
a6d5ff76 774
218f730c 775@mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
b515c98c
RK
776 width: 95%;
777 border-top: .05rem solid $color;
778 height: .05rem;
779 text-align: center;
780 display: block;
781 position: relative;
782
783 &[data-content] {
784 margin: .8rem 0;
785
786 &::after {
787 background: $background;
788 color: $color;
789 content: attr(data-content);
790 display: inline-block;
791 font-size: .7rem;
792 padding: 0 .4rem;
793 transform: translateY(-.65rem);
794 }
795 }
796}
d6af8146
RK
797
798@mixin chip {
9589907c 799 --avatar-size: 1.2rem;
d6af8146 800
d6af8146 801 display: inline-flex;
e66883b3 802 color: pvar(--mainForegroundColor);
9589907c 803 height: var(--avatar-size);
d6af8146
RK
804 max-width: 320px;
805 overflow: hidden;
d6af8146
RK
806 text-decoration: none;
807 text-overflow: ellipsis;
808 vertical-align: middle;
809 white-space: nowrap;
810
f6e98f0a 811 my-actor-avatar {
27bc9586 812 @include margin-right(.2rem);
9589907c
C
813
814 border-radius: 5rem;
815 width: var(--avatar-size);
816 height: var(--avatar-size);
d6af8146
RK
817 }
818
819 &.two-lines {
9589907c 820 --avatar-size: 2rem;
d6af8146 821
9589907c
C
822 font-size: 14px;
823 line-height: 1rem;
d6af8146 824
f6e98f0a 825 my-actor-avatar {
d0800f76 826 display: inline-block;
d6af8146
RK
827 }
828
9589907c 829 > div {
d6af8146
RK
830 display: flex;
831 flex-direction: column;
d6af8146
RK
832 justify-content: center;
833 }
834 }
835}
7a03209d 836
cdeddff1
C
837// applies ratio (default to 16:9) to a child element (using $selector) only using
838// an immediate's parent size. This allows to set a ratio without explicit
e66883b3 839// dimensions, as width/height cannot be computed from each other.
8cbc40b2 840@mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
cdeddff1
C
841 $padding-percent: percentage($inverted-ratio);
842
e66883b3
RK
843 position: relative;
844 height: 0;
845 width: 100%;
cdeddff1 846 padding-top: $padding-percent;
e66883b3
RK
847
848 #{$selector} {
849 position: absolute;
850 width: 100%;
851 height: 100%;
852 top: 0;
37a44fc9 853
e66883b3
RK
854 @content;
855 }
856}
ed5bb517
K
857
858@mixin sub-menu-h1 {
859 ::ng-deep h1 {
860 font-size: 1.3rem;
861 border-bottom: 2px solid $grey-background-color;
862 padding-bottom: 15px;
863 margin-bottom: $sub-menu-margin-bottom;
864
cd262619 865 > span > my-global-icon,
205e4f56 866 > my-global-icon {
27bc9586 867 @include margin-right(10px);
ed5bb517
K
868 width: 24px;
869 height: 24px;
cd262619 870 vertical-align: top;
ed5bb517
K
871 }
872
4c8749cb 873 .pt-badge {
27bc9586 874 @include margin-left(7px);
4c8749cb 875
cd262619 876 vertical-align: top;
ed5bb517
K
877 }
878 }
879}
4572c3d0
C
880
881@mixin play-icon ($width, $height) {
882 width: 0;
883 height: 0;
884
885 position: absolute;
886 left: 50%;
887 top: 50%;
888 transform: translate(-50%, -50%) scale(0.5);
889
8cbc40b2
C
890 border-top: #{math.div($height, 2)} solid transparent;
891 border-bottom: #{math.div($height, 2)} solid transparent;
4572c3d0
C
892
893 border-left: $width solid rgba(255, 255, 255, 0.95);
894}
0f7407d9
C
895
896@mixin on-small-main-col () {
897 :host-context(.main-col:not(.expanded)) {
898 @media screen and (max-width: $small-view + $menu-width) {
899 @content;
900 }
901 }
902
903 :host-context(.main-col.expanded) {
904 @media screen and (max-width: $small-view) {
905 @content;
906 }
907 }
908}
909
910@mixin on-mobile-main-col () {
911 :host-context(.main-col:not(.expanded)) {
912 @media screen and (max-width: $mobile-view + $menu-width) {
913 @content;
914 }
915 }
916
917 :host-context(.main-col.expanded) {
918 @media screen and (max-width: $mobile-view) {
919 @content;
920 }
921 }
922}
27bc9586 923
4158e67c 924@mixin margin ($arg1: null, $arg2: null, $arg3: null, $arg4: null) {
7bbc062d 925 @if $arg2 == null and $arg3 == null and $arg4 == null {
4158e67c 926 @include margin-original($arg1, $arg1, $arg1, $arg1);
7bbc062d 927 } @else if $arg3 == null and $arg4 == null {
4158e67c 928 @include margin-original($arg1, $arg2, $arg1, $arg2);
7bbc062d 929 } @else if $arg4 == null {
4158e67c
W
930 @include margin-original($arg1, $arg2, $arg3, $arg2);
931 } @else {
932 @include margin-original($arg1, $arg2, $arg3, $arg4);
933 }
934}
935
936@mixin margin-original ($block-start, $inline-end, $block-end, $inline-start) {
27bc9586
C
937 @include margin-left($inline-start);
938 @include margin-right($inline-end);
27f84cc3
W
939 @include margin-top($block-start);
940 @include margin-bottom($block-end);
27bc9586
C
941}
942
27bc9586
C
943@mixin margin-left ($value) {
944 @supports (margin-inline-start: $value) {
27f84cc3 945 @include rfs($value, margin-inline-start);
27bc9586
C
946 }
947
948 @supports not (margin-inline-start: $value) {
27f84cc3 949 @include rfs($value, margin-left);
27bc9586
C
950 }
951}
952
953@mixin margin-right ($value) {
954 @supports (margin-inline-end: $value) {
27f84cc3 955 @include rfs($value, margin-inline-end);
27bc9586
C
956 }
957
958 @supports not (margin-inline-end: $value) {
27f84cc3 959 @include rfs($value, margin-right);
27bc9586
C
960 }
961}
962
4158e67c
W
963@mixin padding-original ($block-start, $inline-end, $block-end, $inline-start) {
964 @include padding-left($inline-start);
965 @include padding-right($inline-end);
966 @include padding-top($block-start);
967 @include padding-bottom($block-end);
968}
969
970
971@mixin padding ($arg1: null, $arg2: null, $arg3: null, $arg4: null) {
7bbc062d 972 @if $arg2 == null and $arg3 == null and $arg4 == null {
4158e67c 973 @include padding-original($arg1, $arg1, $arg1, $arg1);
7bbc062d 974 } @else if $arg3 == null and $arg4 == null {
4158e67c 975 @include padding-original($arg1, $arg2, $arg1, $arg2);
7bbc062d 976 } @else if $arg4 == null {
4158e67c
W
977 @include padding-original($arg1, $arg2, $arg3, $arg2);
978 } @else {
979 @include padding-original($arg1, $arg2, $arg3, $arg4);
980 }
981}
982
27bc9586
C
983@mixin padding-left ($value) {
984 @supports (padding-inline-start: $value) {
27f84cc3 985 @include rfs($value, padding-inline-start);
27bc9586
C
986 }
987
988 @supports not (padding-inline-start: $value) {
27f84cc3 989 @include rfs($value, padding-left);
27bc9586
C
990 }
991}
992
993@mixin padding-right ($value) {
994 @supports (padding-inline-end: $value) {
27f84cc3 995 @include rfs($value, padding-inline-end);
27bc9586
C
996 }
997
998 @supports not (padding-inline-end: $value) {
27f84cc3 999 @include rfs($value, padding-right);
27bc9586
C
1000 }
1001}