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