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