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