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