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