4 @use '_variables' as *;
6 @import '_bootstrap-mixins';
8 @mixin disable-default-a-behaviour {
12 text-decoration: none !important;
15 &:focus:not(.focus-visible) {
16 outline: none !important;
20 @mixin disable-outline {
21 &:focus:not(.focus-visible) {
22 outline: none !important;
29 text-overflow: ellipsis;
33 color: pvar(--greyForegroundColor) !important;
36 @mixin fade-text ($fade-after, $background-color) {
48 background: linear-gradient(transparent $fade-after, $background-color);
52 @mixin peertube-word-wrap ($with-hyphen: true) {
53 word-break: break-word;
54 word-wrap: break-word;
55 overflow-wrap: break-word;
62 @mixin apply-svg-color ($color) {
70 @mixin fill-svg-color ($color) {
78 @mixin button-focus($color) {
81 box-shadow: #{$focus-box-shadow-form} $color;
85 @mixin rounded-line-height-1-5 ($font-size) {
86 line-height: $font-size + math.round(math.div($font-size, 2));
89 @mixin peertube-input-text($width, $font-size: $form-input-font-size) {
90 @include rounded-line-height-1-5($font-size);
92 font-size: $font-size;
95 display: inline-block;
98 color: pvar(--inputForegroundColor);
99 background-color: pvar(--inputBackgroundColor);
100 border: 1px solid pvar(--inputBorderColor);
104 color: pvar(--inputPlaceholderColor);
111 @media screen and (max-width: calc(#{$width} + 40px)) {
116 @mixin peertube-textarea ($width, $height) {
117 @include peertube-input-text($width);
119 color: pvar(--textareaForegroundColor) !important;
120 background-color: pvar(--textareaBackgroundColor) !important;
125 @mixin orange-button {
126 @include button-focus(pvar(--mainColorLightest));
132 background-color: pvar(--mainColor);
137 background-color: pvar(--mainHoverColor);
144 background-color: pvar(--inputBorderColor);
148 @include apply-svg-color(#fff);
152 @mixin orange-button-inverted {
153 @include button-focus(pvar(--mainColorLightest));
156 border: 2px solid pvar(--mainColor);
157 font-weight: $font-semibold;
162 color: pvar(--mainColor);
163 background-color: pvar(--mainBackgroundColor);
167 color: pvar(--mainColor);
168 background-color: pvar(--mainColorLightest);
174 color: pvar(--mainColor);
175 background-color: pvar(--inputBorderColor);
179 @include apply-svg-color(pvar(--mainColor));
183 @mixin tertiary-button {
184 @include button-focus($grey-button-outline-color);
186 color: pvar(--greyForegroundColor);
187 background-color: transparent;
195 @include apply-svg-color(transparent);
200 @include button-focus($grey-button-outline-color);
202 background-color: pvar(--greyBackgroundColor);
203 color: pvar(--greyForegroundColor);
210 color: pvar(--greyForegroundColor);
211 background-color: pvar(--greySecondaryBackgroundColor);
220 @include apply-svg-color(pvar(--greyForegroundColor));
224 @mixin danger-button {
225 $color: color.adjust($color: #c54130, $lightness: 10%);
228 @include button-focus(scale-color($color, $alpha: -95%));
230 background-color: $color;
238 background-color: color.adjust($color: $color, $lightness: 10%);
247 @include apply-svg-color($text);
251 @mixin peertube-button {
252 @include rounded-line-height-1-5($button-font-size);
257 font-weight: $font-semibold;
259 // Because of primeng that redefines border-radius of all input[type="..."]
260 border-radius: 3px !important;
265 font-size: $button-font-size;
268 @include margin-right(4px);
269 @include margin-left(4px);
273 @mixin peertube-button-big {
279 font-weight: $font-semibold;
281 // Because of primeng that redefines border-radius of all input[type="..."]
282 border-radius: 3px !important;
285 @mixin peertube-button-link {
286 @include disable-default-a-behaviour;
287 @include peertube-button;
289 display: inline-block;
292 @mixin peertube-button-big-link {
293 @include disable-default-a-behaviour;
294 @include peertube-button-big;
296 display: inline-block;
299 @mixin peertube-button-outline {
300 @include disable-default-a-behaviour;
301 @include peertube-button;
303 display: inline-block;
307 @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
309 @include margin-right($margin-right);
317 @mixin peertube-file {
320 display: inline-block;
330 filter: alpha(opacity=0);
333 background: pvar(--mainBackgroundColor);
339 @mixin peertube-button-file ($width) {
340 @include peertube-file;
341 @include peertube-button;
346 @mixin icon ($size) {
347 display: inline-block;
348 background-repeat: no-repeat;
349 background-size: contain;
352 vertical-align: middle;
356 @mixin responsive-width ($width) {
359 @media screen and (max-width: $width) {
364 @mixin peertube-select-container ($width) {
369 color: pvar(--inputForegroundColor);
370 background: pvar(--inputBackgroundColor);
375 background-color: #E5E5E5;
383 background-color: #f9f9f9;
386 @media screen and (max-width: $width) {
392 right: calc(0% + 15px);
397 pointer-events: none;
398 border: 5px solid rgba(0, 0, 0, 0);
399 border-top-color: pvar(--mainForegroundColor);
405 @include rounded-line-height-1-5($form-input-font-size);
407 font-size: $form-input-font-size;
409 padding: 3px 35px 3px 12px;
411 border: 1px solid pvar(--inputBorderColor);
412 background: transparent none;
414 text-overflow: ellipsis;
415 color: pvar(--mainForegroundColor);
423 text-shadow: 0 0 0 #000;
430 font-weight: $font-semibold;
435 &.peertube-select-button {
436 @include grey-button;
439 font-weight: $font-semibold;
440 color: pvar(--greyForegroundColor);
443 // No border, add +1 to vertical padding
444 padding: 4px 35px 4px 12px;
449 // Thanks: https://codepen.io/manabox/pen/raQmpL
450 @mixin peertube-radio-container {
452 font-size: $form-input-font-size;
455 [type=radio]:checked,
456 [type=radio]:not(:checked) {
464 [type=radio]:checked + label,
465 [type=radio]:not(:checked) + label {
470 display: inline-block;
471 font-weight: $font-regular;
474 [type=radio]:checked + label::before,
475 [type=radio]:not(:checked) + label::before {
482 border: 1px solid pvar(--inputBorderColor);
487 [type=radio]:checked + label::after,
488 [type=radio]:not(:checked) + label::after {
492 background: pvar(--mainColor);
497 transition: all 0.2s ease;
499 [type=radio]:not(:checked) + label::after {
503 [type=radio]:checked + label::after {
508 .form-group-description {
516 @mixin peertube-checkbox ($border-width) {
521 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
529 border: $border-width solid pvar(--inputBorderColor);
531 vertical-align: middle;
537 top: calc(2px - #{$border-width});
542 transform: rotate(45deg) scale(0);
543 border-right: 2px solid pvar(--mainBackgroundColor);
544 border-bottom: 2px solid pvar(--mainBackgroundColor);
549 border-color: transparent;
550 background: pvar(--mainColor);
551 animation: jelly 0.6s ease;
555 transform: rotate(45deg) scale(1);
560 @include margin-left(5px);
562 font-weight: $font-regular;
568 &[disabled] + span + span {
574 @mixin actor-avatar-size ($size) {
575 display: inline-block;
582 @mixin actor-counters ($separator-margin: 10px) {
583 color: pvar(--greyForegroundColor);
587 > *:not(:last-child)::after {
589 margin: 0 $separator-margin;
590 color: pvar(--mainColor);
594 @mixin in-content-small-title {
595 text-transform: uppercase;
596 color: pvar(--mainColor);
597 font-weight: $font-bold;
601 @mixin settings-big-title {
602 text-transform: uppercase;
603 color: pvar(--mainColor);
604 font-weight: $font-bold;
609 @mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
611 min-height: $min-height;
612 padding-bottom: 20px;
616 border-bottom: 1px solid pvar(--inputBorderColor);
619 @media screen and (max-width: $small-view) {
620 @if $column-responsive {
621 flex-direction: column;
626 padding-bottom: 10px;
632 @mixin dropdown-with-icon-item {
636 @include margin-right(10px);
645 @mixin progressbar($small: false) {
646 background-color: pvar(--greyBackgroundColor);
651 border-radius: 0.25rem;
656 color: pvar(--greyForegroundColor);
671 color: pvar(--mainBackgroundColor);
672 background-color: pvar(--mainColor);
674 flex-direction: column;
675 justify-content: center;
678 transition: width 0.6s ease;
681 background-color: color.adjust($color: #c54130, $lightness: 10%);
692 font-weight: $font-semibold;
698 color: pvar(--mainColor);
702 @include padding-left(0.5rem);
705 @include padding-right(0.5rem);
707 display: inline-block;
725 box-sizing: border-box;
726 flex: 0 0 math.percentage(math.div(1, 3));
731 @include disable-default-a-behaviour;
733 text-decoration: none;
748 background: pvar(--submenuBackgroundColor);
750 box-sizing: border-box;
759 color: pvar(--mainForegroundColor);
766 color: pvar(--inputPlaceholderColor);
771 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
773 border-top: .05rem solid $color;
783 background: $background;
785 content: attr(data-content);
786 display: inline-block;
789 transform: translateY(-.65rem);
795 --avatar-size: 1.2rem;
797 display: inline-flex;
798 color: pvar(--mainForegroundColor);
799 height: var(--avatar-size);
802 text-decoration: none;
803 text-overflow: ellipsis;
804 vertical-align: middle;
808 @include margin-right(.2rem);
811 width: var(--avatar-size);
812 height: var(--avatar-size);
822 display: inline-block;
827 flex-direction: column;
828 justify-content: center;
833 // applies ratio (default to 16:9) to a child element (using $selector) only using
834 // an immediate's parent size. This allows to set a ratio without explicit
835 // dimensions, as width/height cannot be computed from each other.
836 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
837 $padding-percent: math.percentage($inverted-ratio);
842 padding-top: $padding-percent;
857 border-bottom: 2px solid $grey-background-color;
858 padding-bottom: 15px;
859 margin-bottom: $sub-menu-margin-bottom;
861 > span > my-global-icon,
863 @include margin-right(10px);
870 @include margin-left(7px);
877 @mixin play-icon ($width, $height) {
884 transform: translate(-50%, -50%) scale(0.5);
886 border-top: #{math.div($height, 2)} solid transparent;
887 border-bottom: #{math.div($height, 2)} solid transparent;
889 border-left: $width solid rgba(255, 255, 255, 0.95);
892 @mixin on-small-main-col () {
893 :host-context(.main-col:not(.expanded)) {
894 @media screen and (max-width: #{$small-view + $menu-width}) {
899 :host-context(.main-col.expanded) {
900 @media screen and (max-width: $small-view) {
906 @mixin on-mobile-main-col () {
907 :host-context(.main-col:not(.expanded)) {
908 @media screen and (max-width: #{$mobile-view + $menu-width}) {
913 :host-context(.main-col.expanded) {
914 @media screen and (max-width: $mobile-view) {
920 @mixin margin ($arg1: null, $arg2: null, $arg3: null, $arg4: null) {
921 @if $arg2 == null and $arg3 == null and $arg4 == null {
922 @include margin-original($arg1, $arg1, $arg1, $arg1);
923 } @else if $arg3 == null and $arg4 == null {
924 @include margin-original($arg1, $arg2, $arg1, $arg2);
925 } @else if $arg4 == null {
926 @include margin-original($arg1, $arg2, $arg3, $arg2);
928 @include margin-original($arg1, $arg2, $arg3, $arg4);
932 @mixin margin-original ($block-start, $inline-end, $block-end, $inline-start) {
933 @include margin-left($inline-start);
934 @include margin-right($inline-end);
935 @include margin-top($block-start);
936 @include margin-bottom($block-end);
939 @mixin margin-left ($value) {
940 @supports (margin-inline-start: $value) {
941 @include rfs($value, margin-inline-start);
944 @supports not (margin-inline-start: $value) {
945 @include rfs($value, margin-left);
949 @mixin margin-right ($value) {
950 @supports (margin-inline-end: $value) {
951 @include rfs($value, margin-inline-end);
954 @supports not (margin-inline-end: $value) {
955 @include rfs($value, margin-right);
959 @mixin padding-original ($block-start, $inline-end, $block-end, $inline-start) {
960 @include padding-left($inline-start);
961 @include padding-right($inline-end);
962 @include padding-top($block-start);
963 @include padding-bottom($block-end);
967 @mixin padding ($arg1: null, $arg2: null, $arg3: null, $arg4: null) {
968 @if $arg2 == null and $arg3 == null and $arg4 == null {
969 @include padding-original($arg1, $arg1, $arg1, $arg1);
970 } @else if $arg3 == null and $arg4 == null {
971 @include padding-original($arg1, $arg2, $arg1, $arg2);
972 } @else if $arg4 == null {
973 @include padding-original($arg1, $arg2, $arg3, $arg2);
975 @include padding-original($arg1, $arg2, $arg3, $arg4);
979 @mixin padding-left ($value) {
980 @supports (padding-inline-start: $value) {
981 @include rfs($value, padding-inline-start);
984 @supports not (padding-inline-start: $value) {
985 @include rfs($value, padding-left);
989 @mixin padding-right ($value) {
990 @supports (padding-inline-end: $value) {
991 @include rfs($value, padding-inline-end);
994 @supports not (padding-inline-end: $value) {
995 @include rfs($value, padding-right);