]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/sass/include/_mixins.scss
Fix preview generation for imports
[github/Chocobozzz/PeerTube.git] / client / src / sass / include / _mixins.scss
CommitLineData
8cbc40b2
C
1@use 'sass:math';
2@use '_variables' as *;
63c4db6d 3
26c6ee80 4@mixin disable-default-a-behaviour {
931d3430
C
5 &:hover,
6 &:focus,
7 &:active {
26c6ee80
C
8 text-decoration: none !important;
9 outline: none !important;
10 }
11}
c30745f3 12
3ec8dc09 13@mixin disable-outline {
e78980eb
RK
14 &:focus:not(.focus-visible) {
15 outline: none;
16 }
3ec8dc09
C
17}
18
ef80c66c
C
19@mixin ellipsis {
20 white-space: nowrap;
21 overflow: hidden;
22 text-overflow: ellipsis;
23}
0c9945d9
C
24
25@mixin ellipsis-multiline($font-size: 16px, $number-of-lines: 2) {
769ac6c1
RK
26 display: block;
27 /* Fallback for non-webkit */
931d3430 28 display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */
33253c1a 29 -webkit-line-clamp: $number-of-lines;
9fb75b16 30 -webkit-box-orient: vertical;
769ac6c1
RK
31 /* Fallback for non-webkit */
32 font-size: $font-size;
8fc02e47 33 line-height: $font-size;
769ac6c1
RK
34 overflow: hidden;
35 text-overflow: ellipsis;
33253c1a 36 max-height: $font-size * $number-of-lines;
769ac6c1
RK
37}
38
60c35932
C
39@mixin fade-text ($fade-after, $background-color) {
40 position: relative;
41 overflow: hidden;
42
931d3430 43 &::after {
60c35932
C
44 content: '';
45 pointer-events: none;
46 width: 100%;
47 height: 100%;
48 position: absolute;
49 left: 0;
50 top: 0;
51 background: linear-gradient(transparent $fade-after, $background-color);
769ac6c1
RK
52 }
53}
54
06ec4bdd 55@mixin peertube-word-wrap ($with-hyphen: true) {
fc641ded 56 word-break: break-word;
7a14004b
C
57 word-wrap: break-word;
58 overflow-wrap: break-word;
06ec4bdd
C
59
60 @if $with-hyphen {
61 hyphens: auto;
62 }
7a14004b
C
63}
64
457bb213 65@mixin apply-svg-color ($color) {
c41c0e28 66 ::ng-deep .feather,
5351a058
C
67 ::ng-deep .material,
68 ::ng-deep .misc {
c41c0e28
RK
69 color: $color;
70 }
457bb213
C
71}
72
d3217560
RK
73@mixin fill-svg-color ($color) {
74 ::ng-deep svg {
75 path {
76 fill: $color;
77 }
78 }
79}
80
a6d5ff76
RK
81@mixin button-focus($color) {
82 &:focus,
e40afb5b 83 &.focus-visible {
6a4c30de 84 box-shadow: #{$focus-box-shadow-form} $color;
e40afb5b
RK
85 }
86}
87
c30745f3 88@mixin peertube-input-text($width) {
27bc9586 89 padding: 0 15px;
c30745f3
C
90 display: inline-block;
91 height: $button-height;
92 width: $width;
4c8749cb 93 max-width: $width;
e66883b3
RK
94 color: pvar(--inputForegroundColor);
95 background-color: pvar(--inputBackgroundColor);
a3345972 96 border: 1px solid pvar(--inputBorderColor);
c30745f3 97 border-radius: 3px;
5b0ec7cd
C
98 font-size: $form-input-font-size;
99 line-height: $form-input-line-height;
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
153 border: 2px solid pvar(--mainColor);
733dbc53 154 font-weight: $font-semibold;
60c35932 155
931d3430
C
156 &,
157 &:active,
158 &:focus {
60c35932
C
159 color: pvar(--mainColor);
160 background-color: pvar(--mainBackgroundColor);
161 }
162
163 &:hover {
164 color: pvar(--mainColor);
165 background-color: pvar(--mainColorLightest);
166 }
167
931d3430
C
168 &[disabled],
169 &.disabled {
60c35932
C
170 cursor: default;
171 color: pvar(--mainColor);
a3345972 172 background-color: pvar(--inputBorderColor);
60c35932
C
173 }
174
175 my-global-icon {
931d3430 176 @include apply-svg-color(pvar(--mainColor));
60c35932
C
177 }
178}
179
54e78847 180@mixin tertiary-button {
a6d5ff76
RK
181 @include button-focus($grey-button-outline-color);
182
e66883b3 183 color: pvar(--greyForegroundColor);
54e78847
RK
184 background-color: transparent;
185
931d3430
C
186 &[disabled],
187 .disabled {
54e78847
RK
188 cursor: default;
189 }
190
191 my-global-icon {
931d3430 192 @include apply-svg-color(transparent);
54e78847
RK
193 }
194}
195
7b272fd7 196@mixin grey-button {
a6d5ff76 197 @include button-focus($grey-button-outline-color);
26171379 198
b788e691 199 background-color: pvar(--greyBackgroundColor);
1fe1e14c 200 color: pvar(--greyForegroundColor);
7b272fd7 201
931d3430
C
202 &:hover,
203 &:active,
204 &:focus,
205 &[disabled],
206 &.disabled {
e66883b3 207 color: pvar(--greyForegroundColor);
b788e691 208 background-color: pvar(--greySecondaryBackgroundColor);
7b272fd7 209 }
4cc66133 210
931d3430
C
211 &[disabled],
212 &.disabled {
4cc66133
C
213 cursor: default;
214 }
457bb213
C
215
216 my-global-icon {
931d3430 217 @include apply-svg-color(pvar(--greyForegroundColor));
457bb213 218 }
7b272fd7
C
219}
220
1fe1e14c
RK
221@mixin danger-button {
222 $color: lighten($color: #c54130, $amount: 10);
223 $text: #fff6f5;
224
225 @include button-focus(scale-color($color, $alpha: -95%));
931d3430 226
1fe1e14c
RK
227 background-color: $color;
228 color: $text;
229
931d3430
C
230 &:hover,
231 &:active,
232 &:focus,
233 &[disabled],
234 &.disabled {
1fe1e14c
RK
235 background-color: lighten($color: $color, $amount: 10);
236 }
237
931d3430
C
238 &[disabled],
239 &.disabled {
1fe1e14c
RK
240 cursor: default;
241 }
242
243 my-global-icon {
931d3430 244 @include apply-svg-color($text);
1fe1e14c
RK
245 }
246}
247
c30745f3 248@mixin peertube-button {
419b520c 249 padding: 0 13px;
27bc9586 250
931d3430 251 border: 0;
c30745f3 252 font-weight: $font-semibold;
c30745f3
C
253 height: $button-height;
254 line-height: $button-height;
02b2e482
C
255
256 // Because of primeng that redefines border-radius of all input[type="..."]
266947e5 257 border-radius: 3px !important;
02b2e482 258
c30745f3 259 text-align: center;
c30745f3 260 cursor: pointer;
419b520c 261
5b0ec7cd
C
262 font-size: $button-font-size;
263
419b520c
C
264 my-global-icon + * {
265 @include margin-right(4px);
266 }
c30745f3
C
267}
268
6f03f944
C
269@mixin peertube-button-big {
270 height: auto;
271 padding: 10px 25px;
272 font-size: 18px;
273 line-height: 1.2;
274 border: 0;
275 font-weight: $font-semibold;
276
277 // Because of primeng that redefines border-radius of all input[type="..."]
278 border-radius: 3px !important;
279}
280
c30745f3 281@mixin peertube-button-link {
c30745f3 282 @include disable-default-a-behaviour;
ce0e281d 283 @include peertube-button;
2295ce6c 284
aa0f1963 285 display: inline-block;
931d3430 286}
aa0f1963 287
c0e3d9ff
C
288@mixin peertube-button-big-link {
289 @include disable-default-a-behaviour;
290 @include peertube-button-big;
291
292 display: inline-block;
293}
294
931d3430 295@mixin peertube-button-outline {
aa0f1963
RK
296 @include disable-default-a-behaviour;
297 @include peertube-button;
298
931d3430 299 display: inline-block;
aa0f1963
RK
300 border: 1px solid;
301}
302
457bb213
C
303@mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
304 my-global-icon {
27bc9586
C
305 @include margin-right($margin-right);
306
457bb213
C
307 position: relative;
308 width: $width;
457bb213
C
309 top: $top;
310 }
311}
312
1ea7da81 313@mixin peertube-file {
c5911fd3
C
314 position: relative;
315 overflow: hidden;
316 display: inline-block;
e61151b0 317 min-height: 30px;
c5911fd3 318
c5911fd3
C
319 input[type=file] {
320 position: absolute;
321 top: 0;
322 right: 0;
e61151b0
RK
323 width: 100%;
324 height: 100%;
c5911fd3 325 font-size: 100px;
27bc9586 326 text-align: end;
c5911fd3
C
327 filter: alpha(opacity=0);
328 opacity: 0;
329 outline: none;
931d3430 330 background: #fff;
c5911fd3
C
331 cursor: inherit;
332 display: block;
333 }
334}
335
1ea7da81 336@mixin peertube-button-file ($width) {
1ea7da81
RK
337 @include peertube-file;
338 @include peertube-button;
931d3430
C
339
340 width: $width;
1ea7da81
RK
341}
342
0727cab0
C
343@mixin icon ($size) {
344 display: inline-block;
345 background-repeat: no-repeat;
346 background-size: contain;
347 width: $size;
348 height: $size;
349 vertical-align: middle;
350 cursor: pointer;
351}
4cc66133 352
d89fcd1e
C
353@mixin responsive-width ($width) {
354 width: $width;
355
356 @media screen and (max-width: $width) {
357 width: 100%;
358 }
359}
52c4976f 360
15a7387d
C
361@mixin peertube-select-container ($width) {
362 padding: 0;
363 margin: 0;
4cc66133
C
364 width: $width;
365 border-radius: 3px;
e66883b3
RK
366 color: pvar(--inputForegroundColor);
367 background: pvar(--inputBackgroundColor);
15a7387d 368 position: relative;
ebe9b6b3 369 height: min-content;
15a7387d 370
2f4c784a
C
371 &.disabled {
372 background-color: #E5E5E5;
373
374 select {
375 cursor: default;
376 }
377 }
4c8749cb 378
8d8a037e
JB
379 select[disabled] {
380 background-color: #f9f9f9;
381 }
2f4c784a 382
2c3abc4f
C
383 @media screen and (max-width: $width) {
384 width: 100%;
385 }
386
931d3430 387 &::after {
bc4c9cc1
C
388 top: 50%;
389 right: calc(0% + 15px);
390 content: ' ';
391 height: 0;
392 width: 0;
393 position: absolute;
394 pointer-events: none;
395 border: 5px solid rgba(0, 0, 0, 0);
396 border-top-color: #000;
397 margin-top: -2px;
398 z-index: 100;
15a7387d
C
399 }
400
401 select {
108af661 402 padding: 0 35px 0 12px;
15a7387d 403 position: relative;
a3345972 404 border: 1px solid pvar(--inputBorderColor);
15a7387d
C
405 background: transparent none;
406 appearance: none;
15a7387d 407 height: $button-height;
108af661 408 text-overflow: ellipsis;
e66883b3 409 color: pvar(--mainForegroundColor);
5b0ec7cd
C
410 font-size: $form-input-font-size;
411 line-height: $form-input-line-height;
15a7387d
C
412
413 &:focus {
414 outline: none;
415 }
416
417 &:-moz-focusring {
418 color: transparent;
419 text-shadow: 0 0 0 #000;
420 }
aa879092
C
421
422 option {
423 color: #000;
4c0b4a08
C
424
425 &[value=undefined] {
426 font-weight: $font-semibold;
427 }
aa879092 428 }
15a7387d 429 }
654a188f
RK
430
431 &.peertube-select-button {
432 @include grey-button;
433
4c0b4a08 434 select {
654a188f
RK
435 font-weight: $font-semibold;
436 color: pvar(--greyForegroundColor);
931d3430 437 border: 0;
654a188f
RK
438 }
439 }
15a7387d
C
440}
441
dd24f1bb 442// Thanks: https://codepen.io/manabox/pen/raQmpL
5f0805d3 443@mixin peertube-radio-container {
5b0ec7cd
C
444 label {
445 font-size: $form-input-font-size;
446 }
447
dd24f1bb
C
448 [type=radio]:checked,
449 [type=radio]:not(:checked) {
450 position: absolute;
451 left: -9999px;
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);
18c97728
C
533 border-right: 2px solid $bg-color;
534 border-bottom: 2px solid $bg-color;
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) {
e61151b0
RK
642 background-color: $grey-background-color;
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;
4f5d0459 652 color: $grey-foreground-color;
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 {
1ebddadd
RK
791 --chip-radius: 5rem;
792 --chip-padding: .2rem .4rem;
d6af8146
RK
793 $avatar-height: 1.2rem;
794
795 align-items: center;
1ebddadd 796 border-radius: var(--chip-radius);
d6af8146
RK
797 display: inline-flex;
798 font-size: 90%;
e66883b3 799 color: pvar(--mainForegroundColor);
d6af8146 800 height: $avatar-height;
06827932 801 line-height: 1rem;
d6af8146
RK
802 margin: .1rem;
803 max-width: 320px;
804 overflow: hidden;
1ebddadd 805 padding: var(--chip-padding);
d6af8146
RK
806 text-decoration: none;
807 text-overflow: ellipsis;
808 vertical-align: middle;
809 white-space: nowrap;
810
1ebddadd
RK
811 &.rectangular {
812 --chip-radius: .2rem;
813 --chip-padding: .2rem .3rem;
814 }
815
f6e98f0a 816 my-actor-avatar {
27bc9586
C
817 @include margin-left(-.4rem);
818 @include margin-right(.2rem);
d6af8146
RK
819 }
820
821 &.two-lines {
36f772fd 822 $avatar-height: 2rem;
d6af8146
RK
823
824 height: $avatar-height;
825
f6e98f0a 826 my-actor-avatar {
d0800f76 827 display: inline-block;
d6af8146
RK
828 }
829
830 div {
27bc9586
C
831 margin: 0 .1rem;
832
d6af8146
RK
833 display: flex;
834 flex-direction: column;
d6af8146 835 height: $avatar-height;
d6af8146
RK
836 justify-content: center;
837 }
838 }
839}
7a03209d 840
cdeddff1
C
841// applies ratio (default to 16:9) to a child element (using $selector) only using
842// an immediate's parent size. This allows to set a ratio without explicit
e66883b3 843// dimensions, as width/height cannot be computed from each other.
8cbc40b2 844@mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
cdeddff1
C
845 $padding-percent: percentage($inverted-ratio);
846
e66883b3
RK
847 position: relative;
848 height: 0;
849 width: 100%;
cdeddff1 850 padding-top: $padding-percent;
e66883b3
RK
851
852 #{$selector} {
853 position: absolute;
854 width: 100%;
855 height: 100%;
856 top: 0;
37a44fc9 857
e66883b3
RK
858 @content;
859 }
860}
ed5bb517
K
861
862@mixin sub-menu-h1 {
863 ::ng-deep h1 {
864 font-size: 1.3rem;
865 border-bottom: 2px solid $grey-background-color;
866 padding-bottom: 15px;
867 margin-bottom: $sub-menu-margin-bottom;
868
cd262619 869 > span > my-global-icon,
205e4f56 870 > my-global-icon {
27bc9586 871 @include margin-right(10px);
ed5bb517
K
872 width: 24px;
873 height: 24px;
cd262619 874 vertical-align: top;
ed5bb517
K
875 }
876
4c8749cb 877 .pt-badge {
27bc9586 878 @include margin-left(7px);
4c8749cb 879
cd262619 880 vertical-align: top;
ed5bb517
K
881 }
882 }
883}
4572c3d0
C
884
885@mixin play-icon ($width, $height) {
886 width: 0;
887 height: 0;
888
889 position: absolute;
890 left: 50%;
891 top: 50%;
892 transform: translate(-50%, -50%) scale(0.5);
893
8cbc40b2
C
894 border-top: #{math.div($height, 2)} solid transparent;
895 border-bottom: #{math.div($height, 2)} solid transparent;
4572c3d0
C
896
897 border-left: $width solid rgba(255, 255, 255, 0.95);
898}
0f7407d9
C
899
900@mixin on-small-main-col () {
901 :host-context(.main-col:not(.expanded)) {
902 @media screen and (max-width: $small-view + $menu-width) {
903 @content;
904 }
905 }
906
907 :host-context(.main-col.expanded) {
908 @media screen and (max-width: $small-view) {
909 @content;
910 }
911 }
912}
913
914@mixin on-mobile-main-col () {
915 :host-context(.main-col:not(.expanded)) {
916 @media screen and (max-width: $mobile-view + $menu-width) {
917 @content;
918 }
919 }
920
921 :host-context(.main-col.expanded) {
922 @media screen and (max-width: $mobile-view) {
923 @content;
924 }
925 }
926}
27bc9586
C
927
928@mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
929 @include margin-left($inline-start);
930 @include margin-right($inline-end);
931
932 margin-top: $block-start;
933 margin-bottom: $block-end;
934}
935
936@mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
937 @include padding-left($inline-start);
938 @include padding-right($inline-end);
939
940 padding-top: $block-start;
941 padding-bottom: $block-end;
942}
943
944@mixin margin-left ($value) {
945 @supports (margin-inline-start: $value) {
946 margin-inline-start: $value;
947 }
948
949 @supports not (margin-inline-start: $value) {
950 margin-left: $value;
951 }
952}
953
954@mixin margin-right ($value) {
955 @supports (margin-inline-end: $value) {
956 margin-inline-end: $value;
957 }
958
959 @supports not (margin-inline-end: $value) {
960 margin-right: $value;
961 }
962}
963
964@mixin padding-left ($value) {
965 @supports (padding-inline-start: $value) {
966 padding-inline-start: $value;
967 }
968
969 @supports not (padding-inline-start: $value) {
970 padding-left: $value;
971 }
972}
973
974@mixin padding-right ($value) {
975 @supports (padding-inline-end: $value) {
976 padding-inline-end: $value;
977 }
978
979 @supports not (padding-inline-end: $value) {
980 padding-right: $value;
981 }
982}