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