2 @use '_variables' as *;
4 @import '_bootstrap-mixins';
6 @mixin disable-default-a-behaviour {
10 text-decoration: none !important;
13 &:focus:not(.focus-visible) {
14 outline: none !important;
18 @mixin disable-outline {
19 &:focus:not(.focus-visible) {
20 outline: none !important;
27 text-overflow: ellipsis;
31 color: pvar(--greyForegroundColor) !important;
34 @mixin fade-text ($fade-after, $background-color) {
46 background: linear-gradient(transparent $fade-after, $background-color);
50 @mixin peertube-word-wrap ($with-hyphen: true) {
51 word-break: break-word;
52 word-wrap: break-word;
53 overflow-wrap: break-word;
60 @mixin apply-svg-color ($color) {
68 @mixin fill-svg-color ($color) {
76 @mixin button-focus($color) {
79 box-shadow: #{$focus-box-shadow-form} $color;
83 @mixin peertube-input-text($width) {
85 display: inline-block;
88 color: pvar(--inputForegroundColor);
89 background-color: pvar(--inputBackgroundColor);
90 border: 1px solid pvar(--inputBorderColor);
92 font-size: $form-input-font-size;
93 line-height: $form-input-line-height;
96 color: pvar(--inputPlaceholderColor);
103 @media screen and (max-width: calc(#{$width} + 40px)) {
108 @mixin peertube-textarea ($width, $height) {
109 @include peertube-input-text($width);
111 color: pvar(--textareaForegroundColor) !important;
112 background-color: pvar(--textareaBackgroundColor) !important;
117 @mixin orange-button {
118 @include button-focus(pvar(--mainColorLightest));
124 background-color: pvar(--mainColor);
129 background-color: pvar(--mainHoverColor);
136 background-color: pvar(--inputBorderColor);
140 @include apply-svg-color(#fff);
144 @mixin orange-button-inverted {
145 @include button-focus(pvar(--mainColorLightest));
148 border: 2px solid pvar(--mainColor);
149 font-weight: $font-semibold;
154 color: pvar(--mainColor);
155 background-color: pvar(--mainBackgroundColor);
159 color: pvar(--mainColor);
160 background-color: pvar(--mainColorLightest);
166 color: pvar(--mainColor);
167 background-color: pvar(--inputBorderColor);
171 @include apply-svg-color(pvar(--mainColor));
175 @mixin tertiary-button {
176 @include button-focus($grey-button-outline-color);
178 color: pvar(--greyForegroundColor);
179 background-color: transparent;
187 @include apply-svg-color(transparent);
192 @include button-focus($grey-button-outline-color);
194 background-color: pvar(--greyBackgroundColor);
195 color: pvar(--greyForegroundColor);
202 color: pvar(--greyForegroundColor);
203 background-color: pvar(--greySecondaryBackgroundColor);
212 @include apply-svg-color(pvar(--greyForegroundColor));
216 @mixin danger-button {
217 $color: lighten($color: #c54130, $amount: 10);
220 @include button-focus(scale-color($color, $alpha: -95%));
222 background-color: $color;
230 background-color: lighten($color: $color, $amount: 10);
239 @include apply-svg-color($text);
243 @mixin peertube-button {
247 font-weight: $font-semibold;
249 // Because of primeng that redefines border-radius of all input[type="..."]
250 border-radius: 3px !important;
255 font-size: $button-font-size;
256 line-height: $button-font-size + math.round(math.div($button-font-size, 2));
259 @include margin-right(4px);
260 @include margin-left(4px);
264 @mixin peertube-button-big {
270 font-weight: $font-semibold;
272 // Because of primeng that redefines border-radius of all input[type="..."]
273 border-radius: 3px !important;
276 @mixin peertube-button-link {
277 @include disable-default-a-behaviour;
278 @include peertube-button;
280 display: inline-block;
283 @mixin peertube-button-big-link {
284 @include disable-default-a-behaviour;
285 @include peertube-button-big;
287 display: inline-block;
290 @mixin peertube-button-outline {
291 @include disable-default-a-behaviour;
292 @include peertube-button;
294 display: inline-block;
298 @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
300 @include margin-right($margin-right);
308 vertical-align: middle;
312 @mixin peertube-file {
315 display: inline-block;
325 filter: alpha(opacity=0);
328 background: pvar(--mainBackgroundColor);
334 @mixin peertube-button-file ($width) {
335 @include peertube-file;
336 @include peertube-button;
341 @mixin icon ($size) {
342 display: inline-block;
343 background-repeat: no-repeat;
344 background-size: contain;
347 vertical-align: middle;
351 @mixin responsive-width ($width) {
354 @media screen and (max-width: $width) {
359 @mixin peertube-select-container ($width) {
364 color: pvar(--inputForegroundColor);
365 background: pvar(--inputBackgroundColor);
370 background-color: #E5E5E5;
378 background-color: #f9f9f9;
381 @media screen and (max-width: $width) {
387 right: calc(0% + 15px);
392 pointer-events: none;
393 border: 5px solid rgba(0, 0, 0, 0);
394 border-top-color: pvar(--mainForegroundColor);
400 padding: 4px 35px 4px 12px;
402 border: 1px solid pvar(--inputBorderColor);
403 background: transparent none;
405 text-overflow: ellipsis;
406 color: pvar(--mainForegroundColor);
407 font-size: $form-input-font-size;
408 line-height: $form-input-line-height;
416 text-shadow: 0 0 0 #000;
423 font-weight: $font-semibold;
428 &.peertube-select-button {
429 @include grey-button;
432 font-weight: $font-semibold;
433 color: pvar(--greyForegroundColor);
439 // Thanks: https://codepen.io/manabox/pen/raQmpL
440 @mixin peertube-radio-container {
442 font-size: $form-input-font-size;
445 [type=radio]:checked,
446 [type=radio]:not(:checked) {
454 [type=radio]:checked + label,
455 [type=radio]:not(:checked) + label {
460 display: inline-block;
461 font-weight: $font-regular;
464 [type=radio]:checked + label::before,
465 [type=radio]:not(:checked) + label::before {
472 border: 1px solid pvar(--inputBorderColor);
477 [type=radio]:checked + label::after,
478 [type=radio]:not(:checked) + label::after {
482 background: pvar(--mainColor);
487 transition: all 0.2s ease;
489 [type=radio]:not(:checked) + label::after {
493 [type=radio]:checked + label::after {
498 .form-group-description {
506 @mixin peertube-checkbox ($border-width) {
511 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
519 border: $border-width solid pvar(--inputBorderColor);
521 vertical-align: middle;
527 top: calc(2px - #{$border-width});
532 transform: rotate(45deg) scale(0);
533 border-right: 2px solid pvar(--mainBackgroundColor);
534 border-bottom: 2px solid pvar(--mainBackgroundColor);
539 border-color: transparent;
540 background: pvar(--mainColor);
541 animation: jelly 0.6s ease;
545 transform: rotate(45deg) scale(1);
550 @include margin-left(5px);
552 font-weight: $font-regular;
558 &[disabled] + span + span {
564 @mixin actor-avatar-size ($size) {
565 display: inline-block;
572 @mixin actor-counters ($separator-margin: 10px) {
573 color: pvar(--greyForegroundColor);
577 > *:not(:last-child)::after {
579 margin: 0 $separator-margin;
580 color: pvar(--mainColor);
584 @mixin in-content-small-title {
585 text-transform: uppercase;
586 color: pvar(--mainColor);
587 font-weight: $font-bold;
591 @mixin settings-big-title {
592 text-transform: uppercase;
593 color: pvar(--mainColor);
594 font-weight: $font-bold;
599 @mixin create-button {
600 @include peertube-button-link;
601 @include orange-button;
602 @include button-with-icon(20px, 5px, -1px);
605 @mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
607 min-height: $min-height;
608 padding-bottom: 20px;
612 border-bottom: 1px solid pvar(--inputBorderColor);
615 @media screen and (max-width: $small-view) {
616 @if $column-responsive {
617 flex-direction: column;
622 padding-bottom: 10px;
628 @mixin dropdown-with-icon-item {
632 @include margin-right(10px);
641 @mixin progressbar($small: false) {
642 background-color: pvar(--greyBackgroundColor);
647 border-radius: 0.25rem;
652 color: pvar(--greyForegroundColor);
667 color: pvar(--mainBackgroundColor);
668 background-color: pvar(--mainColor);
670 flex-direction: column;
671 justify-content: center;
674 transition: width 0.6s ease;
677 background-color: lighten($color: #c54130, $amount: 10);
688 font-weight: $font-semibold;
694 color: pvar(--mainColor);
698 @include padding-left(0.5rem);
701 @include padding-right(0.5rem);
703 display: inline-block;
721 box-sizing: border-box;
722 flex: 0 0 percentage(math.div(1, 3));
727 @include disable-default-a-behaviour;
729 text-decoration: none;
744 background: pvar(--submenuBackgroundColor);
746 box-sizing: border-box;
755 color: pvar(--mainForegroundColor);
762 color: pvar(--inputPlaceholderColor);
767 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
769 border-top: .05rem solid $color;
779 background: $background;
781 content: attr(data-content);
782 display: inline-block;
785 transform: translateY(-.65rem);
791 --avatar-size: 1.2rem;
793 display: inline-flex;
794 color: pvar(--mainForegroundColor);
795 height: var(--avatar-size);
798 text-decoration: none;
799 text-overflow: ellipsis;
800 vertical-align: middle;
804 @include margin-right(.2rem);
807 width: var(--avatar-size);
808 height: var(--avatar-size);
818 display: inline-block;
823 flex-direction: column;
824 justify-content: center;
829 // applies ratio (default to 16:9) to a child element (using $selector) only using
830 // an immediate's parent size. This allows to set a ratio without explicit
831 // dimensions, as width/height cannot be computed from each other.
832 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
833 $padding-percent: percentage($inverted-ratio);
838 padding-top: $padding-percent;
853 border-bottom: 2px solid $grey-background-color;
854 padding-bottom: 15px;
855 margin-bottom: $sub-menu-margin-bottom;
857 > span > my-global-icon,
859 @include margin-right(10px);
866 @include margin-left(7px);
873 @mixin play-icon ($width, $height) {
880 transform: translate(-50%, -50%) scale(0.5);
882 border-top: #{math.div($height, 2)} solid transparent;
883 border-bottom: #{math.div($height, 2)} solid transparent;
885 border-left: $width solid rgba(255, 255, 255, 0.95);
888 @mixin on-small-main-col () {
889 :host-context(.main-col:not(.expanded)) {
890 @media screen and (max-width: $small-view + $menu-width) {
895 :host-context(.main-col.expanded) {
896 @media screen and (max-width: $small-view) {
902 @mixin on-mobile-main-col () {
903 :host-context(.main-col:not(.expanded)) {
904 @media screen and (max-width: $mobile-view + $menu-width) {
909 :host-context(.main-col.expanded) {
910 @media screen and (max-width: $mobile-view) {
916 @mixin margin ($arg1: null, $arg2: null, $arg3: null, $arg4: null) {
917 @if $arg2 == null and $arg3 == null and $arg4 == null {
918 @include margin-original($arg1, $arg1, $arg1, $arg1);
919 } @else if $arg3 == null and $arg4 == null {
920 @include margin-original($arg1, $arg2, $arg1, $arg2);
921 } @else if $arg4 == null {
922 @include margin-original($arg1, $arg2, $arg3, $arg2);
924 @include margin-original($arg1, $arg2, $arg3, $arg4);
928 @mixin margin-original ($block-start, $inline-end, $block-end, $inline-start) {
929 @include margin-left($inline-start);
930 @include margin-right($inline-end);
931 @include margin-top($block-start);
932 @include margin-bottom($block-end);
935 @mixin margin-left ($value) {
936 @supports (margin-inline-start: $value) {
937 @include rfs($value, margin-inline-start);
940 @supports not (margin-inline-start: $value) {
941 @include rfs($value, margin-left);
945 @mixin margin-right ($value) {
946 @supports (margin-inline-end: $value) {
947 @include rfs($value, margin-inline-end);
950 @supports not (margin-inline-end: $value) {
951 @include rfs($value, margin-right);
955 @mixin padding-original ($block-start, $inline-end, $block-end, $inline-start) {
956 @include padding-left($inline-start);
957 @include padding-right($inline-end);
958 @include padding-top($block-start);
959 @include padding-bottom($block-end);
963 @mixin padding ($arg1: null, $arg2: null, $arg3: null, $arg4: null) {
964 @if $arg2 == null and $arg3 == null and $arg4 == null {
965 @include padding-original($arg1, $arg1, $arg1, $arg1);
966 } @else if $arg3 == null and $arg4 == null {
967 @include padding-original($arg1, $arg2, $arg1, $arg2);
968 } @else if $arg4 == null {
969 @include padding-original($arg1, $arg2, $arg3, $arg2);
971 @include padding-original($arg1, $arg2, $arg3, $arg4);
975 @mixin padding-left ($value) {
976 @supports (padding-inline-start: $value) {
977 @include rfs($value, padding-inline-start);
980 @supports not (padding-inline-start: $value) {
981 @include rfs($value, padding-left);
985 @mixin padding-right ($value) {
986 @supports (padding-inline-end: $value) {
987 @include rfs($value, padding-inline-end);
990 @supports not (padding-inline-end: $value) {
991 @include rfs($value, padding-right);