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