]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - client/src/sass/include/_mixins.scss
Migrate to bootstrap 5
[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;
769ac6c1
RK
30 /* Fallback for non-webkit */
31 font-size: $font-size;
8fc02e47 32 line-height: $font-size;
769ac6c1
RK
33 overflow: hidden;
34 text-overflow: ellipsis;
33253c1a 35 max-height: $font-size * $number-of-lines;
769ac6c1
RK
36}
37
60c35932
C
38@mixin fade-text ($fade-after, $background-color) {
39 position: relative;
40 overflow: hidden;
41
931d3430 42 &::after {
60c35932
C
43 content: '';
44 pointer-events: none;
45 width: 100%;
46 height: 100%;
47 position: absolute;
48 left: 0;
49 top: 0;
50 background: linear-gradient(transparent $fade-after, $background-color);
769ac6c1
RK
51 }
52}
53
06ec4bdd 54@mixin peertube-word-wrap ($with-hyphen: true) {
fc641ded 55 word-break: break-word;
7a14004b
C
56 word-wrap: break-word;
57 overflow-wrap: break-word;
06ec4bdd
C
58
59 @if $with-hyphen {
60 hyphens: auto;
61 }
7a14004b
C
62}
63
457bb213 64@mixin apply-svg-color ($color) {
c41c0e28 65 ::ng-deep .feather,
5351a058
C
66 ::ng-deep .material,
67 ::ng-deep .misc {
c41c0e28
RK
68 color: $color;
69 }
457bb213
C
70}
71
d3217560
RK
72@mixin fill-svg-color ($color) {
73 ::ng-deep svg {
74 path {
75 fill: $color;
76 }
77 }
78}
79
a6d5ff76
RK
80@mixin button-focus($color) {
81 &:focus,
e40afb5b 82 &.focus-visible {
6a4c30de 83 box-shadow: #{$focus-box-shadow-form} $color;
e40afb5b
RK
84 }
85}
86
c30745f3 87@mixin peertube-input-text($width) {
27bc9586 88 padding: 0 15px;
c30745f3
C
89 display: inline-block;
90 height: $button-height;
91 width: $width;
4c8749cb 92 max-width: $width;
e66883b3
RK
93 color: pvar(--inputForegroundColor);
94 background-color: pvar(--inputBackgroundColor);
c30745f3
C
95 border: 1px solid #C6C6C6;
96 border-radius: 3px;
17bb716b 97 font-size: 15px;
9a0fc840
RK
98
99 &::placeholder {
e66883b3 100 color: pvar(--inputPlaceholderColor);
9a0fc840 101 }
2860e62e 102
767bb14a
C
103 &[readonly] {
104 opacity: 0.7;
105 }
106
5c16e6bc 107 @media screen and (max-width: calc(#{$width} + 40px)) {
2860e62e
C
108 width: 100%;
109 }
8a19bee1 110}
c30745f3 111
5f0805d3
C
112@mixin peertube-textarea ($width, $height) {
113 @include peertube-input-text($width);
114
b788e691
C
115 color: pvar(--textareaForegroundColor) !important;
116 background-color: pvar(--textareaBackgroundColor) !important;
5f0805d3
C
117 height: $height;
118 padding: 5px 15px;
119 font-size: 15px;
120}
121
7b272fd7 122@mixin orange-button {
e66883b3 123 @include button-focus(pvar(--mainColorLightest));
e40afb5b 124
931d3430
C
125 &,
126 &:active,
127 &:focus {
15a7387d 128 color: #fff;
e66883b3 129 background-color: pvar(--mainColor);
15a7387d 130 }
7b272fd7 131
15a7387d 132 &:hover {
0727cab0 133 color: #fff;
e66883b3 134 background-color: pvar(--mainHoverColor);
7b272fd7 135 }
4cc66133 136
931d3430
C
137 &[disabled],
138 &.disabled {
4cc66133 139 cursor: default;
cadb46d8
C
140 color: #fff;
141 background-color: #C6C6C6;
4cc66133 142 }
457bb213
C
143
144 my-global-icon {
931d3430 145 @include apply-svg-color(#fff);
457bb213 146 }
7b272fd7
C
147}
148
60c35932
C
149@mixin orange-button-inverted {
150 @include button-focus(pvar(--mainColorLightest));
151
152 border: 2px solid pvar(--mainColor);
733dbc53 153 font-weight: $font-semibold;
60c35932 154
931d3430
C
155 &,
156 &:active,
157 &:focus {
60c35932
C
158 color: pvar(--mainColor);
159 background-color: pvar(--mainBackgroundColor);
160 }
161
162 &:hover {
163 color: pvar(--mainColor);
164 background-color: pvar(--mainColorLightest);
165 }
166
931d3430
C
167 &[disabled],
168 &.disabled {
60c35932
C
169 cursor: default;
170 color: pvar(--mainColor);
171 background-color: #C6C6C6;
172 }
173
174 my-global-icon {
931d3430 175 @include apply-svg-color(pvar(--mainColor));
60c35932
C
176 }
177}
178
54e78847 179@mixin tertiary-button {
a6d5ff76
RK
180 @include button-focus($grey-button-outline-color);
181
e66883b3 182 color: pvar(--greyForegroundColor);
54e78847
RK
183 background-color: transparent;
184
931d3430
C
185 &[disabled],
186 .disabled {
54e78847
RK
187 cursor: default;
188 }
189
190 my-global-icon {
931d3430 191 @include apply-svg-color(transparent);
54e78847
RK
192 }
193}
194
7b272fd7 195@mixin grey-button {
a6d5ff76 196 @include button-focus($grey-button-outline-color);
26171379 197
b788e691 198 background-color: pvar(--greyBackgroundColor);
1fe1e14c 199 color: pvar(--greyForegroundColor);
7b272fd7 200
931d3430
C
201 &:hover,
202 &:active,
203 &:focus,
204 &[disabled],
205 &.disabled {
e66883b3 206 color: pvar(--greyForegroundColor);
b788e691 207 background-color: pvar(--greySecondaryBackgroundColor);
7b272fd7 208 }
4cc66133 209
931d3430
C
210 &[disabled],
211 &.disabled {
4cc66133
C
212 cursor: default;
213 }
457bb213
C
214
215 my-global-icon {
931d3430 216 @include apply-svg-color(pvar(--greyForegroundColor));
457bb213 217 }
7b272fd7
C
218}
219
1fe1e14c
RK
220@mixin danger-button {
221 $color: lighten($color: #c54130, $amount: 10);
222 $text: #fff6f5;
223
224 @include button-focus(scale-color($color, $alpha: -95%));
931d3430 225
1fe1e14c
RK
226 background-color: $color;
227 color: $text;
228
931d3430
C
229 &:hover,
230 &:active,
231 &:focus,
232 &[disabled],
233 &.disabled {
1fe1e14c
RK
234 background-color: lighten($color: $color, $amount: 10);
235 }
236
931d3430
C
237 &[disabled],
238 &.disabled {
1fe1e14c
RK
239 cursor: default;
240 }
241
242 my-global-icon {
931d3430 243 @include apply-svg-color($text);
1fe1e14c
RK
244 }
245}
246
c30745f3 247@mixin peertube-button {
419b520c 248 padding: 0 13px;
27bc9586 249
931d3430 250 border: 0;
c30745f3
C
251 font-weight: $font-semibold;
252 font-size: 15px;
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
C
261
262 my-global-icon + * {
263 @include margin-right(4px);
264 }
c30745f3
C
265}
266
267@mixin peertube-button-link {
c30745f3 268 @include disable-default-a-behaviour;
ce0e281d 269 @include peertube-button;
2295ce6c 270
aa0f1963 271 display: inline-block;
931d3430 272}
aa0f1963 273
931d3430 274@mixin peertube-button-outline {
aa0f1963
RK
275 @include disable-default-a-behaviour;
276 @include peertube-button;
277
931d3430 278 display: inline-block;
aa0f1963
RK
279 border: 1px solid;
280}
281
457bb213 282@mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
26171379
C
283 display: inline-flex;
284 align-items: center;
285 line-height: normal !important;
286
457bb213 287 my-global-icon {
27bc9586
C
288 @include margin-right($margin-right);
289
457bb213
C
290 position: relative;
291 width: $width;
457bb213
C
292 top: $top;
293 }
294}
295
1ea7da81 296@mixin peertube-file {
c5911fd3
C
297 position: relative;
298 overflow: hidden;
299 display: inline-block;
e61151b0 300 min-height: 30px;
c5911fd3 301
c5911fd3
C
302 input[type=file] {
303 position: absolute;
304 top: 0;
305 right: 0;
e61151b0
RK
306 width: 100%;
307 height: 100%;
c5911fd3 308 font-size: 100px;
27bc9586 309 text-align: end;
c5911fd3
C
310 filter: alpha(opacity=0);
311 opacity: 0;
312 outline: none;
931d3430 313 background: #fff;
c5911fd3
C
314 cursor: inherit;
315 display: block;
316 }
317}
318
1ea7da81 319@mixin peertube-button-file ($width) {
1ea7da81
RK
320 @include peertube-file;
321 @include peertube-button;
931d3430
C
322
323 width: $width;
1ea7da81
RK
324}
325
0727cab0
C
326@mixin icon ($size) {
327 display: inline-block;
328 background-repeat: no-repeat;
329 background-size: contain;
330 width: $size;
331 height: $size;
332 vertical-align: middle;
333 cursor: pointer;
334}
4cc66133 335
d89fcd1e
C
336@mixin responsive-width ($width) {
337 width: $width;
338
339 @media screen and (max-width: $width) {
340 width: 100%;
341 }
342}
52c4976f 343
15a7387d
C
344@mixin peertube-select-container ($width) {
345 padding: 0;
346 margin: 0;
4cc66133
C
347 width: $width;
348 border-radius: 3px;
e66883b3
RK
349 color: pvar(--inputForegroundColor);
350 background: pvar(--inputBackgroundColor);
15a7387d 351 position: relative;
5f0805d3 352 font-size: 15px;
ebe9b6b3 353 height: min-content;
15a7387d 354
2f4c784a
C
355 &.disabled {
356 background-color: #E5E5E5;
357
358 select {
359 cursor: default;
360 }
361 }
4c8749cb 362
8d8a037e
JB
363 select[disabled] {
364 background-color: #f9f9f9;
365 }
2f4c784a 366
2c3abc4f
C
367 @media screen and (max-width: $width) {
368 width: 100%;
369 }
370
931d3430 371 &::after {
bc4c9cc1
C
372 top: 50%;
373 right: calc(0% + 15px);
374 content: ' ';
375 height: 0;
376 width: 0;
377 position: absolute;
378 pointer-events: none;
379 border: 5px solid rgba(0, 0, 0, 0);
380 border-top-color: #000;
381 margin-top: -2px;
382 z-index: 100;
15a7387d
C
383 }
384
385 select {
108af661 386 padding: 0 35px 0 12px;
15a7387d 387 position: relative;
a6d5ff76 388 border: 1px solid #C6C6C6;
15a7387d
C
389 background: transparent none;
390 appearance: none;
391 cursor: pointer;
392 height: $button-height;
108af661 393 text-overflow: ellipsis;
e66883b3 394 color: pvar(--mainForegroundColor);
15a7387d
C
395
396 &:focus {
397 outline: none;
398 }
399
400 &:-moz-focusring {
401 color: transparent;
402 text-shadow: 0 0 0 #000;
403 }
aa879092
C
404
405 option {
406 color: #000;
407 }
15a7387d 408 }
654a188f
RK
409
410 &.peertube-select-button {
411 @include grey-button;
412
413 select,
414 option {
415 font-weight: $font-semibold;
416 color: pvar(--greyForegroundColor);
931d3430 417 border: 0;
654a188f
RK
418 }
419 }
15a7387d
C
420}
421
dd24f1bb 422// Thanks: https://codepen.io/manabox/pen/raQmpL
5f0805d3 423@mixin peertube-radio-container {
dd24f1bb
C
424 [type=radio]:checked,
425 [type=radio]:not(:checked) {
426 position: absolute;
427 left: -9999px;
428 }
5f0805d3 429
dd24f1bb
C
430 [type=radio]:checked + label,
431 [type=radio]:not(:checked) + label {
432 position: relative;
433 padding-left: 28px;
434 cursor: pointer;
435 line-height: 20px;
436 display: inline-block;
3eb7ee65
C
437 font-size: 15px;
438 font-weight: $font-regular;
dd24f1bb 439 }
5f0805d3 440
dd24f1bb
C
441 [type=radio]:checked + label::before,
442 [type=radio]:not(:checked) + label::before {
443 content: '';
444 position: absolute;
445 left: 0;
446 top: 0;
447 width: 18px;
448 height: 18px;
449 border: 1px solid #C6C6C6;
450 border-radius: 100%;
451 background: #fff;
452 }
453
454 [type=radio]:checked + label::after,
455 [type=radio]:not(:checked) + label::after {
456 content: '';
457 width: 10px;
458 height: 10px;
459 background: pvar(--mainColor);
460 position: absolute;
461 top: 4px;
462 left: 4px;
463 border-radius: 100%;
464 transition: all 0.2s ease;
465 }
466 [type=radio]:not(:checked) + label::after {
467 opacity: 0;
468 transform: scale(0);
469 }
470 [type=radio]:checked + label::after {
471 opacity: 1;
472 transform: scale(1);
5f0805d3 473 }
3eb7ee65
C
474
475 .form-group-description {
476 display: block;
1e2fe802 477 margin-top: -7px;
3eb7ee65
C
478 margin-bottom: 10px;
479 margin-left: 29px;
480 }
5f0805d3
C
481}
482
a0d69908 483@mixin peertube-checkbox ($border-width) {
1d5342ab 484 opacity: 0;
776ca9b1 485 position: absolute;
1d5342ab
C
486
487 &:focus + span {
e66883b3 488 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
1d5342ab 489 }
a0d69908 490
931d3430 491 + span {
a0d69908
C
492 position: relative;
493 width: 18px;
bc20aaed 494 min-width: 18px;
a0d69908 495 height: 18px;
5fd3e00a 496 border: $border-width solid #C6C6C6;
a0d69908
C
497 border-radius: 3px;
498 vertical-align: middle;
499 cursor: pointer;
500
931d3430 501 &::after {
a0d69908
C
502 content: '';
503 position: absolute;
504 top: calc(2px - #{$border-width});
505 left: 5px;
506 width: 5px;
507 height: 12px;
508 opacity: 0;
509 transform: rotate(45deg) scale(0);
18c97728
C
510 border-right: 2px solid $bg-color;
511 border-bottom: 2px solid $bg-color;
a0d69908
C
512 }
513 }
514
0f7fedc3 515 &:checked + span {
a0d69908 516 border-color: transparent;
e66883b3 517 background: pvar(--mainColor);
a0d69908
C
518 animation: jelly 0.6s ease;
519
931d3430 520 &::after {
a0d69908
C
521 opacity: 1;
522 transform: rotate(45deg) scale(1);
523 }
524 }
525
931d3430 526 + span + span {
27bc9586
C
527 @include margin-left(5px);
528
a0d69908
C
529 font-size: 15px;
530 font-weight: $font-regular;
a0d69908 531 cursor: pointer;
6693df9d 532 display: inline;
a0d69908 533 }
bbe0f064 534
0f7fedc3 535 &[disabled] + span,
931d3430 536 &[disabled] + span + span {
bbe0f064
C
537 opacity: 0.5;
538 cursor: default;
539 }
a0d69908
C
540}
541
746018f6
C
542@mixin actor-avatar-size ($size) {
543 display: inline-block;
60c35932
C
544 width: $size;
545 height: $size;
546 min-width: $size;
547 min-height: $size;
548}
549
61cbafc1
C
550@mixin actor-counters ($separator-margin: 10px) {
551 color: pvar(--greyForegroundColor);
552 font-size: 16px;
553 display: flex;
554 align-items: center;
555
556 > *:not(:last-child)::after {
557 content: '•';
558 margin: 0 $separator-margin;
559 color: pvar(--mainColor);
560 }
561}
562
c6352f2c
C
563@mixin chevron ($size, $border-width) {
564 border-style: solid;
565 border-width: $border-width $border-width 0 0;
566 content: '';
567 display: inline-block;
568 transform: rotate(-45deg);
569 height: $size;
570 width: $size;
571}
572
573@mixin chevron-right ($size, $border-width) {
574 @include chevron($size, $border-width);
575
576 left: 0;
577 transform: rotate(45deg);
578}
579
580@mixin chevron-left ($size, $border-width) {
581 @include chevron($size, $border-width);
582
583 left: 0.25em;
584 transform: rotate(-135deg);
585}
0626e7af
C
586
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
RK
597 font-weight: $font-bold;
598 font-size: 110%;
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 {
615 border-bottom: 1px solid #C6C6C6;
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
679 &.secondary {
e66883b3 680 background-color: pvar(--secondaryColor);
e61151b0 681 }
d4132d3f
RK
682
683 &.red {
684 background-color: lighten($color: #c54130, $amount: 10);
685 }
e61151b0
RK
686 }
687}
76314386
RK
688
689@mixin breadcrumb {
690 display: flex;
691 flex-wrap: wrap;
692 padding: 0.75rem 1rem;
693 margin-bottom: 1rem;
694 list-style: none;
218f730c 695 background-color: pvar(--submenuBackgroundColor);
76314386
RK
696 border-radius: 0.25rem;
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 {
1ebddadd
RK
799 --chip-radius: 5rem;
800 --chip-padding: .2rem .4rem;
d6af8146
RK
801 $avatar-height: 1.2rem;
802
803 align-items: center;
1ebddadd 804 border-radius: var(--chip-radius);
d6af8146
RK
805 display: inline-flex;
806 font-size: 90%;
e66883b3 807 color: pvar(--mainForegroundColor);
d6af8146 808 height: $avatar-height;
06827932 809 line-height: 1rem;
d6af8146
RK
810 margin: .1rem;
811 max-width: 320px;
812 overflow: hidden;
1ebddadd 813 padding: var(--chip-padding);
d6af8146
RK
814 text-decoration: none;
815 text-overflow: ellipsis;
816 vertical-align: middle;
817 white-space: nowrap;
818
1ebddadd
RK
819 &.rectangular {
820 --chip-radius: .2rem;
821 --chip-padding: .2rem .3rem;
822 }
823
f6e98f0a 824 my-actor-avatar {
27bc9586
C
825 @include margin-left(-.4rem);
826 @include margin-right(.2rem);
d6af8146
RK
827 }
828
829 &.two-lines {
36f772fd 830 $avatar-height: 2rem;
d6af8146
RK
831
832 height: $avatar-height;
833
f6e98f0a 834 my-actor-avatar {
d0800f76 835 display: inline-block;
d6af8146
RK
836 }
837
838 div {
27bc9586
C
839 margin: 0 .1rem;
840
d6af8146
RK
841 display: flex;
842 flex-direction: column;
d6af8146 843 height: $avatar-height;
d6af8146
RK
844 justify-content: center;
845 }
846 }
847}
7a03209d 848
cdeddff1
C
849// applies ratio (default to 16:9) to a child element (using $selector) only using
850// an immediate's parent size. This allows to set a ratio without explicit
e66883b3 851// dimensions, as width/height cannot be computed from each other.
8cbc40b2 852@mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
cdeddff1
C
853 $padding-percent: percentage($inverted-ratio);
854
e66883b3
RK
855 position: relative;
856 height: 0;
857 width: 100%;
cdeddff1 858 padding-top: $padding-percent;
e66883b3
RK
859
860 #{$selector} {
861 position: absolute;
862 width: 100%;
863 height: 100%;
864 top: 0;
37a44fc9 865
e66883b3
RK
866 @content;
867 }
868}
ed5bb517
K
869
870@mixin sub-menu-h1 {
871 ::ng-deep h1 {
872 font-size: 1.3rem;
873 border-bottom: 2px solid $grey-background-color;
874 padding-bottom: 15px;
875 margin-bottom: $sub-menu-margin-bottom;
876
cd262619 877 > span > my-global-icon,
205e4f56 878 > my-global-icon {
27bc9586 879 @include margin-right(10px);
ed5bb517
K
880 width: 24px;
881 height: 24px;
cd262619 882 vertical-align: top;
ed5bb517
K
883 }
884
4c8749cb 885 .pt-badge {
27bc9586 886 @include margin-left(7px);
4c8749cb 887
cd262619 888 vertical-align: top;
ed5bb517
K
889 }
890 }
891}
4572c3d0
C
892
893@mixin play-icon ($width, $height) {
894 width: 0;
895 height: 0;
896
897 position: absolute;
898 left: 50%;
899 top: 50%;
900 transform: translate(-50%, -50%) scale(0.5);
901
8cbc40b2
C
902 border-top: #{math.div($height, 2)} solid transparent;
903 border-bottom: #{math.div($height, 2)} solid transparent;
4572c3d0
C
904
905 border-left: $width solid rgba(255, 255, 255, 0.95);
906}
0f7407d9
C
907
908@mixin on-small-main-col () {
909 :host-context(.main-col:not(.expanded)) {
910 @media screen and (max-width: $small-view + $menu-width) {
911 @content;
912 }
913 }
914
915 :host-context(.main-col.expanded) {
916 @media screen and (max-width: $small-view) {
917 @content;
918 }
919 }
920}
921
922@mixin on-mobile-main-col () {
923 :host-context(.main-col:not(.expanded)) {
924 @media screen and (max-width: $mobile-view + $menu-width) {
925 @content;
926 }
927 }
928
929 :host-context(.main-col.expanded) {
930 @media screen and (max-width: $mobile-view) {
931 @content;
932 }
933 }
934}
27bc9586
C
935
936@mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
937 @include margin-left($inline-start);
938 @include margin-right($inline-end);
939
940 margin-top: $block-start;
941 margin-bottom: $block-end;
942}
943
944@mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
945 @include padding-left($inline-start);
946 @include padding-right($inline-end);
947
948 padding-top: $block-start;
949 padding-bottom: $block-end;
950}
951
952@mixin margin-left ($value) {
953 @supports (margin-inline-start: $value) {
954 margin-inline-start: $value;
955 }
956
957 @supports not (margin-inline-start: $value) {
958 margin-left: $value;
959 }
960}
961
962@mixin margin-right ($value) {
963 @supports (margin-inline-end: $value) {
964 margin-inline-end: $value;
965 }
966
967 @supports not (margin-inline-end: $value) {
968 margin-right: $value;
969 }
970}
971
972@mixin padding-left ($value) {
973 @supports (padding-inline-start: $value) {
974 padding-inline-start: $value;
975 }
976
977 @supports not (padding-inline-start: $value) {
978 padding-left: $value;
979 }
980}
981
982@mixin padding-right ($value) {
983 @supports (padding-inline-end: $value) {
984 padding-inline-end: $value;
985 }
986
987 @supports not (padding-inline-end: $value) {
988 padding-right: $value;
989 }
990}