]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/sass/include/_mixins.scss
Merge branch 'release/4.3.0' into develop
[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;
e4d9696a
C
451 opacity: 0;
452 cursor: pointer;
453 height: 0;
454 width: 0;
dd24f1bb 455 }
5f0805d3 456
dd24f1bb
C
457 [type=radio]:checked + label,
458 [type=radio]:not(:checked) + label {
459 position: relative;
460 padding-left: 28px;
461 cursor: pointer;
462 line-height: 20px;
463 display: inline-block;
3eb7ee65 464 font-weight: $font-regular;
dd24f1bb 465 }
5f0805d3 466
dd24f1bb
C
467 [type=radio]:checked + label::before,
468 [type=radio]:not(:checked) + label::before {
469 content: '';
470 position: absolute;
471 left: 0;
472 top: 0;
473 width: 18px;
474 height: 18px;
a3345972 475 border: 1px solid pvar(--inputBorderColor);
dd24f1bb
C
476 border-radius: 100%;
477 background: #fff;
478 }
479
480 [type=radio]:checked + label::after,
481 [type=radio]:not(:checked) + label::after {
482 content: '';
483 width: 10px;
484 height: 10px;
485 background: pvar(--mainColor);
486 position: absolute;
487 top: 4px;
488 left: 4px;
489 border-radius: 100%;
490 transition: all 0.2s ease;
491 }
492 [type=radio]:not(:checked) + label::after {
493 opacity: 0;
494 transform: scale(0);
495 }
496 [type=radio]:checked + label::after {
497 opacity: 1;
498 transform: scale(1);
5f0805d3 499 }
3eb7ee65
C
500
501 .form-group-description {
502 display: block;
1e2fe802 503 margin-top: -7px;
3eb7ee65
C
504 margin-bottom: 10px;
505 margin-left: 29px;
506 }
5f0805d3
C
507}
508
a0d69908 509@mixin peertube-checkbox ($border-width) {
1d5342ab 510 opacity: 0;
776ca9b1 511 position: absolute;
1d5342ab
C
512
513 &:focus + span {
e66883b3 514 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
1d5342ab 515 }
a0d69908 516
931d3430 517 + span {
a0d69908
C
518 position: relative;
519 width: 18px;
bc20aaed 520 min-width: 18px;
a0d69908 521 height: 18px;
a3345972 522 border: $border-width solid pvar(--inputBorderColor);
a0d69908
C
523 border-radius: 3px;
524 vertical-align: middle;
525 cursor: pointer;
526
931d3430 527 &::after {
a0d69908
C
528 content: '';
529 position: absolute;
530 top: calc(2px - #{$border-width});
531 left: 5px;
532 width: 5px;
533 height: 12px;
534 opacity: 0;
535 transform: rotate(45deg) scale(0);
18c97728
C
536 border-right: 2px solid $bg-color;
537 border-bottom: 2px solid $bg-color;
a0d69908
C
538 }
539 }
540
0f7fedc3 541 &:checked + span {
a0d69908 542 border-color: transparent;
e66883b3 543 background: pvar(--mainColor);
a0d69908
C
544 animation: jelly 0.6s ease;
545
931d3430 546 &::after {
a0d69908
C
547 opacity: 1;
548 transform: rotate(45deg) scale(1);
549 }
550 }
551
931d3430 552 + span + span {
27bc9586
C
553 @include margin-left(5px);
554
a0d69908 555 font-weight: $font-regular;
a0d69908 556 cursor: pointer;
6693df9d 557 display: inline;
a0d69908 558 }
bbe0f064 559
0f7fedc3 560 &[disabled] + span,
931d3430 561 &[disabled] + span + span {
bbe0f064
C
562 opacity: 0.5;
563 cursor: default;
564 }
a0d69908
C
565}
566
746018f6
C
567@mixin actor-avatar-size ($size) {
568 display: inline-block;
60c35932
C
569 width: $size;
570 height: $size;
571 min-width: $size;
572 min-height: $size;
573}
574
61cbafc1
C
575@mixin actor-counters ($separator-margin: 10px) {
576 color: pvar(--greyForegroundColor);
61cbafc1
C
577 display: flex;
578 align-items: center;
579
580 > *:not(:last-child)::after {
581 content: '•';
582 margin: 0 $separator-margin;
583 color: pvar(--mainColor);
584 }
585}
586
0626e7af
C
587@mixin in-content-small-title {
588 text-transform: uppercase;
e66883b3 589 color: pvar(--mainColor);
0626e7af
C
590 font-weight: $font-bold;
591 font-size: 13px;
170726f5
C
592}
593
482fa503
RK
594@mixin settings-big-title {
595 text-transform: uppercase;
e66883b3 596 color: pvar(--mainColor);
482fa503 597 font-weight: $font-bold;
5b0ec7cd 598 font-size: 1rem;
482fa503
RK
599 margin-bottom: 10px;
600}
601
457bb213 602@mixin create-button {
08c1efbe
C
603 @include peertube-button-link;
604 @include orange-button;
457bb213 605 @include button-with-icon(20px, 5px, -1px);
a4f99a76 606}
22a16e36 607
4beda9e1 608@mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
22a16e36 609 display: flex;
4beda9e1 610 min-height: $min-height;
22a16e36
C
611 padding-bottom: 20px;
612 margin-bottom: 20px;
4beda9e1
C
613
614 @if $separator {
a3345972 615 border-bottom: 1px solid pvar(--inputBorderColor);
4beda9e1 616 }
22a16e36 617
0f7407d9
C
618 @media screen and (max-width: $small-view) {
619 @if $column-responsive {
620 flex-direction: column;
621 height: auto;
622 align-items: center;
623 } @else {
624 min-height: initial;
625 padding-bottom: 10px;
626 margin-bottom: 10px;
627 }
22a16e36 628 }
6aff854c 629}
c5a1ae50
C
630
631@mixin dropdown-with-icon-item {
bc584963 632 padding: 6px 15px;
c5a1ae50
C
633
634 my-global-icon {
27bc9586
C
635 @include margin-right(10px);
636
bc584963
RK
637 width: 22px;
638 opacity: .7;
c5a1ae50
C
639 position: relative;
640 top: -2px;
641 }
642}
e61151b0 643
66927c05 644@mixin progressbar($small: false) {
e61151b0
RK
645 background-color: $grey-background-color;
646 display: flex;
647 height: 1rem;
648 overflow: hidden;
649 font-size: 0.75rem;
650 border-radius: 0.25rem;
bc99dfe5
RK
651 position: relative;
652
653 span {
654 position: absolute;
4f5d0459 655 color: $grey-foreground-color;
d94b8ecf 656
66927c05
RK
657 @if $small {
658 top: -1px;
659 }
bc99dfe5
RK
660
661 &:nth-of-type(1) {
662 left: .2rem;
663 }
664 &:nth-of-type(2) {
665 right: .2rem;
666 }
667 }
e61151b0
RK
668
669 .progress-bar {
e66883b3
RK
670 color: pvar(--mainBackgroundColor);
671 background-color: pvar(--mainColor);
e61151b0
RK
672 display: flex;
673 flex-direction: column;
674 justify-content: center;
675 text-align: center;
676 white-space: nowrap;
677 transition: width 0.6s ease;
678
d4132d3f
RK
679 &.red {
680 background-color: lighten($color: #c54130, $amount: 10);
681 }
e61151b0
RK
682 }
683}
76314386
RK
684
685@mixin breadcrumb {
686 display: flex;
687 flex-wrap: wrap;
5b0ec7cd 688 padding: 0;
76314386
RK
689 margin-bottom: 1rem;
690 list-style: none;
5b0ec7cd 691 font-weight: $font-semibold;
76314386
RK
692
693 .breadcrumb-item {
694 display: flex;
695
696 a {
e66883b3 697 color: pvar(--mainColor);
76314386
RK
698 }
699
931d3430 700 + .breadcrumb-item {
27bc9586
C
701 @include padding-left(0.5rem);
702
76314386 703 &::before {
27bc9586
C
704 @include padding-right(0.5rem);
705
76314386 706 display: inline-block;
76314386 707 color: #6c757d;
931d3430 708 content: '/';
76314386
RK
709 }
710 }
711
712 &.active {
713 color: #6c757d;
714 }
715 }
716}
717
718@mixin dashboard {
719 display: flex;
720 flex-wrap: wrap;
721 margin: 0 -5px;
722
931d3430 723 > div {
76314386 724 box-sizing: border-box;
8cbc40b2 725 flex: 0 0 percentage(math.div(1, 3));
76314386
RK
726 padding: 0 5px;
727 margin-bottom: 10px;
728
931d3430 729 > a {
d1261d9a
RK
730 @include disable-default-a-behaviour;
731
76314386
RK
732 text-decoration: none;
733 color: inherit;
734 display: block;
735 font-size: 18px;
736
737 &:active,
738 &:focus,
739 &:hover {
740 opacity: .8;
741 }
742 }
743
931d3430
C
744 > a,
745 > div {
76314386 746 padding: 20px;
218f730c 747 background: pvar(--submenuBackgroundColor);
76314386
RK
748 border-radius: 4px;
749 box-sizing: border-box;
750 height: 100%;
751 }
752 }
753
931d3430
C
754 .dashboard-num,
755 .dashboard-text {
76314386
RK
756 text-align: center;
757 font-size: 130%;
e66883b3 758 color: pvar(--mainForegroundColor);
76314386
RK
759 line-height: 30px;
760 margin-bottom: 20px;
761 }
762
763 .dashboard-label {
764 font-size: 90%;
e66883b3 765 color: pvar(--inputPlaceholderColor);
76314386
RK
766 text-align: center;
767 }
768}
a6d5ff76 769
218f730c 770@mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
b515c98c
RK
771 width: 95%;
772 border-top: .05rem solid $color;
773 height: .05rem;
774 text-align: center;
775 display: block;
776 position: relative;
777
778 &[data-content] {
779 margin: .8rem 0;
780
781 &::after {
782 background: $background;
783 color: $color;
784 content: attr(data-content);
785 display: inline-block;
786 font-size: .7rem;
787 padding: 0 .4rem;
788 transform: translateY(-.65rem);
789 }
790 }
791}
d6af8146
RK
792
793@mixin chip {
1ebddadd
RK
794 --chip-radius: 5rem;
795 --chip-padding: .2rem .4rem;
d6af8146
RK
796 $avatar-height: 1.2rem;
797
798 align-items: center;
1ebddadd 799 border-radius: var(--chip-radius);
d6af8146
RK
800 display: inline-flex;
801 font-size: 90%;
e66883b3 802 color: pvar(--mainForegroundColor);
d6af8146 803 height: $avatar-height;
06827932 804 line-height: 1rem;
d6af8146
RK
805 margin: .1rem;
806 max-width: 320px;
807 overflow: hidden;
1ebddadd 808 padding: var(--chip-padding);
d6af8146
RK
809 text-decoration: none;
810 text-overflow: ellipsis;
811 vertical-align: middle;
812 white-space: nowrap;
813
1ebddadd
RK
814 &.rectangular {
815 --chip-radius: .2rem;
816 --chip-padding: .2rem .3rem;
817 }
818
f6e98f0a 819 my-actor-avatar {
27bc9586
C
820 @include margin-left(-.4rem);
821 @include margin-right(.2rem);
d6af8146
RK
822 }
823
824 &.two-lines {
36f772fd 825 $avatar-height: 2rem;
d6af8146
RK
826
827 height: $avatar-height;
828
f6e98f0a 829 my-actor-avatar {
d0800f76 830 display: inline-block;
d6af8146
RK
831 }
832
833 div {
27bc9586
C
834 margin: 0 .1rem;
835
d6af8146
RK
836 display: flex;
837 flex-direction: column;
d6af8146 838 height: $avatar-height;
d6af8146
RK
839 justify-content: center;
840 }
841 }
842}
7a03209d 843
cdeddff1
C
844// applies ratio (default to 16:9) to a child element (using $selector) only using
845// an immediate's parent size. This allows to set a ratio without explicit
e66883b3 846// dimensions, as width/height cannot be computed from each other.
8cbc40b2 847@mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
cdeddff1
C
848 $padding-percent: percentage($inverted-ratio);
849
e66883b3
RK
850 position: relative;
851 height: 0;
852 width: 100%;
cdeddff1 853 padding-top: $padding-percent;
e66883b3
RK
854
855 #{$selector} {
856 position: absolute;
857 width: 100%;
858 height: 100%;
859 top: 0;
37a44fc9 860
e66883b3
RK
861 @content;
862 }
863}
ed5bb517
K
864
865@mixin sub-menu-h1 {
866 ::ng-deep h1 {
867 font-size: 1.3rem;
868 border-bottom: 2px solid $grey-background-color;
869 padding-bottom: 15px;
870 margin-bottom: $sub-menu-margin-bottom;
871
cd262619 872 > span > my-global-icon,
205e4f56 873 > my-global-icon {
27bc9586 874 @include margin-right(10px);
ed5bb517
K
875 width: 24px;
876 height: 24px;
cd262619 877 vertical-align: top;
ed5bb517
K
878 }
879
4c8749cb 880 .pt-badge {
27bc9586 881 @include margin-left(7px);
4c8749cb 882
cd262619 883 vertical-align: top;
ed5bb517
K
884 }
885 }
886}
4572c3d0
C
887
888@mixin play-icon ($width, $height) {
889 width: 0;
890 height: 0;
891
892 position: absolute;
893 left: 50%;
894 top: 50%;
895 transform: translate(-50%, -50%) scale(0.5);
896
8cbc40b2
C
897 border-top: #{math.div($height, 2)} solid transparent;
898 border-bottom: #{math.div($height, 2)} solid transparent;
4572c3d0
C
899
900 border-left: $width solid rgba(255, 255, 255, 0.95);
901}
0f7407d9
C
902
903@mixin on-small-main-col () {
904 :host-context(.main-col:not(.expanded)) {
905 @media screen and (max-width: $small-view + $menu-width) {
906 @content;
907 }
908 }
909
910 :host-context(.main-col.expanded) {
911 @media screen and (max-width: $small-view) {
912 @content;
913 }
914 }
915}
916
917@mixin on-mobile-main-col () {
918 :host-context(.main-col:not(.expanded)) {
919 @media screen and (max-width: $mobile-view + $menu-width) {
920 @content;
921 }
922 }
923
924 :host-context(.main-col.expanded) {
925 @media screen and (max-width: $mobile-view) {
926 @content;
927 }
928 }
929}
27bc9586
C
930
931@mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
932 @include margin-left($inline-start);
933 @include margin-right($inline-end);
934
935 margin-top: $block-start;
936 margin-bottom: $block-end;
937}
938
939@mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
940 @include padding-left($inline-start);
941 @include padding-right($inline-end);
942
943 padding-top: $block-start;
944 padding-bottom: $block-end;
945}
946
947@mixin margin-left ($value) {
948 @supports (margin-inline-start: $value) {
949 margin-inline-start: $value;
950 }
951
952 @supports not (margin-inline-start: $value) {
953 margin-left: $value;
954 }
955}
956
957@mixin margin-right ($value) {
958 @supports (margin-inline-end: $value) {
959 margin-inline-end: $value;
960 }
961
962 @supports not (margin-inline-end: $value) {
963 margin-right: $value;
964 }
965}
966
967@mixin padding-left ($value) {
968 @supports (padding-inline-start: $value) {
969 padding-inline-start: $value;
970 }
971
972 @supports not (padding-inline-start: $value) {
973 padding-left: $value;
974 }
975}
976
977@mixin padding-right ($value) {
978 @supports (padding-inline-end: $value) {
979 padding-inline-end: $value;
980 }
981
982 @supports not (padding-inline-end: $value) {
983 padding-right: $value;
984 }
985}