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