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