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