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