2 @use '_variables' as *;
4 @import '_bootstrap-mixins';
6 @mixin disable-default-a-behaviour {
10 text-decoration: none !important;
11 outline: none !important;
15 @mixin disable-outline {
16 &:focus:not(.focus-visible) {
24 text-overflow: ellipsis;
27 @mixin ellipsis-multiline($font-size: 16px, $number-of-lines: 2, $line-height: $font-size) {
29 /* Fallback for non-webkit */
30 display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */
31 -webkit-line-clamp: $number-of-lines;
32 -webkit-box-orient: vertical;
33 /* Fallback for non-webkit */
34 font-size: $font-size;
35 line-height: $line-height;
37 text-overflow: ellipsis;
38 max-height: $font-size * $number-of-lines;
42 color: pvar(--greyForegroundColor) !important;
45 @mixin fade-text ($fade-after, $background-color) {
57 background: linear-gradient(transparent $fade-after, $background-color);
61 @mixin peertube-word-wrap ($with-hyphen: true) {
62 word-break: break-word;
63 word-wrap: break-word;
64 overflow-wrap: break-word;
71 @mixin apply-svg-color ($color) {
79 @mixin fill-svg-color ($color) {
87 @mixin button-focus($color) {
90 box-shadow: #{$focus-box-shadow-form} $color;
94 @mixin rounded-line-height-1-5 ($font-size) {
95 line-height: $font-size + math.round(math.div($font-size, 2));
98 @mixin peertube-input-text($width, $font-size: $form-input-font-size) {
99 @include rounded-line-height-1-5($font-size);
101 font-size: $font-size;
104 display: inline-block;
107 color: pvar(--inputForegroundColor);
108 background-color: pvar(--inputBackgroundColor);
109 border: 1px solid pvar(--inputBorderColor);
113 color: pvar(--inputPlaceholderColor);
120 @media screen and (max-width: calc(#{$width} + 40px)) {
125 @mixin peertube-textarea ($width, $height) {
126 @include peertube-input-text($width);
128 color: pvar(--textareaForegroundColor) !important;
129 background-color: pvar(--textareaBackgroundColor) !important;
134 @mixin orange-button {
135 @include button-focus(pvar(--mainColorLightest));
141 background-color: pvar(--mainColor);
146 background-color: pvar(--mainHoverColor);
153 background-color: pvar(--inputBorderColor);
157 @include apply-svg-color(#fff);
161 @mixin orange-button-inverted {
162 @include button-focus(pvar(--mainColorLightest));
165 border: 2px solid pvar(--mainColor);
166 font-weight: $font-semibold;
171 color: pvar(--mainColor);
172 background-color: pvar(--mainBackgroundColor);
176 color: pvar(--mainColor);
177 background-color: pvar(--mainColorLightest);
183 color: pvar(--mainColor);
184 background-color: pvar(--inputBorderColor);
188 @include apply-svg-color(pvar(--mainColor));
192 @mixin tertiary-button {
193 @include button-focus($grey-button-outline-color);
195 color: pvar(--greyForegroundColor);
196 background-color: transparent;
204 @include apply-svg-color(transparent);
209 @include button-focus($grey-button-outline-color);
211 background-color: pvar(--greyBackgroundColor);
212 color: pvar(--greyForegroundColor);
219 color: pvar(--greyForegroundColor);
220 background-color: pvar(--greySecondaryBackgroundColor);
229 @include apply-svg-color(pvar(--greyForegroundColor));
233 @mixin danger-button {
234 $color: lighten($color: #c54130, $amount: 10);
237 @include button-focus(scale-color($color, $alpha: -95%));
239 background-color: $color;
247 background-color: lighten($color: $color, $amount: 10);
256 @include apply-svg-color($text);
260 @mixin peertube-button {
261 @include rounded-line-height-1-5($button-font-size);
266 font-weight: $font-semibold;
268 // Because of primeng that redefines border-radius of all input[type="..."]
269 border-radius: 3px !important;
274 font-size: $button-font-size;
277 @include margin-right(4px);
278 @include margin-left(4px);
282 @mixin peertube-button-big {
288 font-weight: $font-semibold;
290 // Because of primeng that redefines border-radius of all input[type="..."]
291 border-radius: 3px !important;
294 @mixin peertube-button-link {
295 @include disable-default-a-behaviour;
296 @include peertube-button;
298 display: inline-block;
301 @mixin peertube-button-big-link {
302 @include disable-default-a-behaviour;
303 @include peertube-button-big;
305 display: inline-block;
308 @mixin peertube-button-outline {
309 @include disable-default-a-behaviour;
310 @include peertube-button;
312 display: inline-block;
316 @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
318 @include margin-right($margin-right);
326 @mixin peertube-file {
329 display: inline-block;
339 filter: alpha(opacity=0);
342 background: pvar(--mainBackgroundColor);
348 @mixin peertube-button-file ($width) {
349 @include peertube-file;
350 @include peertube-button;
355 @mixin icon ($size) {
356 display: inline-block;
357 background-repeat: no-repeat;
358 background-size: contain;
361 vertical-align: middle;
365 @mixin responsive-width ($width) {
368 @media screen and (max-width: $width) {
373 @mixin peertube-select-container ($width) {
378 color: pvar(--inputForegroundColor);
379 background: pvar(--inputBackgroundColor);
384 background-color: #E5E5E5;
392 background-color: #f9f9f9;
395 @media screen and (max-width: $width) {
401 right: calc(0% + 15px);
406 pointer-events: none;
407 border: 5px solid rgba(0, 0, 0, 0);
408 border-top-color: pvar(--mainForegroundColor);
414 @include rounded-line-height-1-5($form-input-font-size);
416 font-size: $form-input-font-size;
418 padding: 3px 35px 3px 12px;
420 border: 1px solid pvar(--inputBorderColor);
421 background: transparent none;
423 text-overflow: ellipsis;
424 color: pvar(--mainForegroundColor);
432 text-shadow: 0 0 0 #000;
439 font-weight: $font-semibold;
444 &.peertube-select-button {
445 @include grey-button;
448 font-weight: $font-semibold;
449 color: pvar(--greyForegroundColor);
452 // No border, add +1 to vertical padding
453 padding: 4px 35px 4px 12px;
458 // Thanks: https://codepen.io/manabox/pen/raQmpL
459 @mixin peertube-radio-container {
461 font-size: $form-input-font-size;
464 [type=radio]:checked,
465 [type=radio]:not(:checked) {
473 [type=radio]:checked + label,
474 [type=radio]:not(:checked) + label {
479 display: inline-block;
480 font-weight: $font-regular;
483 [type=radio]:checked + label::before,
484 [type=radio]:not(:checked) + label::before {
491 border: 1px solid pvar(--inputBorderColor);
496 [type=radio]:checked + label::after,
497 [type=radio]:not(:checked) + label::after {
501 background: pvar(--mainColor);
506 transition: all 0.2s ease;
508 [type=radio]:not(:checked) + label::after {
512 [type=radio]:checked + label::after {
517 .form-group-description {
525 @mixin peertube-checkbox ($border-width) {
530 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
538 border: $border-width solid pvar(--inputBorderColor);
540 vertical-align: middle;
546 top: calc(2px - #{$border-width});
551 transform: rotate(45deg) scale(0);
552 border-right: 2px solid pvar(--mainBackgroundColor);
553 border-bottom: 2px solid pvar(--mainBackgroundColor);
558 border-color: transparent;
559 background: pvar(--mainColor);
560 animation: jelly 0.6s ease;
564 transform: rotate(45deg) scale(1);
569 @include margin-left(5px);
571 font-weight: $font-regular;
577 &[disabled] + span + span {
583 @mixin actor-avatar-size ($size) {
584 display: inline-block;
591 @mixin actor-counters ($separator-margin: 10px) {
592 color: pvar(--greyForegroundColor);
596 > *:not(:last-child)::after {
598 margin: 0 $separator-margin;
599 color: pvar(--mainColor);
603 @mixin in-content-small-title {
604 text-transform: uppercase;
605 color: pvar(--mainColor);
606 font-weight: $font-bold;
610 @mixin settings-big-title {
611 text-transform: uppercase;
612 color: pvar(--mainColor);
613 font-weight: $font-bold;
618 @mixin create-button {
619 @include peertube-button-link;
620 @include orange-button;
621 @include button-with-icon(20px, 5px, -1px);
624 @mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
626 min-height: $min-height;
627 padding-bottom: 20px;
631 border-bottom: 1px solid pvar(--inputBorderColor);
634 @media screen and (max-width: $small-view) {
635 @if $column-responsive {
636 flex-direction: column;
641 padding-bottom: 10px;
647 @mixin dropdown-with-icon-item {
651 @include margin-right(10px);
660 @mixin progressbar($small: false) {
661 background-color: pvar(--greyBackgroundColor);
666 border-radius: 0.25rem;
671 color: pvar(--greyForegroundColor);
686 color: pvar(--mainBackgroundColor);
687 background-color: pvar(--mainColor);
689 flex-direction: column;
690 justify-content: center;
693 transition: width 0.6s ease;
696 background-color: lighten($color: #c54130, $amount: 10);
707 font-weight: $font-semibold;
713 color: pvar(--mainColor);
717 @include padding-left(0.5rem);
720 @include padding-right(0.5rem);
722 display: inline-block;
740 box-sizing: border-box;
741 flex: 0 0 percentage(math.div(1, 3));
746 @include disable-default-a-behaviour;
748 text-decoration: none;
763 background: pvar(--submenuBackgroundColor);
765 box-sizing: border-box;
774 color: pvar(--mainForegroundColor);
781 color: pvar(--inputPlaceholderColor);
786 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
788 border-top: .05rem solid $color;
798 background: $background;
800 content: attr(data-content);
801 display: inline-block;
804 transform: translateY(-.65rem);
810 --avatar-size: 1.2rem;
812 display: inline-flex;
813 color: pvar(--mainForegroundColor);
814 height: var(--avatar-size);
817 text-decoration: none;
818 text-overflow: ellipsis;
819 vertical-align: middle;
823 @include margin-right(.2rem);
826 width: var(--avatar-size);
827 height: var(--avatar-size);
837 display: inline-block;
842 flex-direction: column;
843 justify-content: center;
848 // applies ratio (default to 16:9) to a child element (using $selector) only using
849 // an immediate's parent size. This allows to set a ratio without explicit
850 // dimensions, as width/height cannot be computed from each other.
851 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
852 $padding-percent: percentage($inverted-ratio);
857 padding-top: $padding-percent;
872 border-bottom: 2px solid $grey-background-color;
873 padding-bottom: 15px;
874 margin-bottom: $sub-menu-margin-bottom;
876 > span > my-global-icon,
878 @include margin-right(10px);
885 @include margin-left(7px);
892 @mixin play-icon ($width, $height) {
899 transform: translate(-50%, -50%) scale(0.5);
901 border-top: #{math.div($height, 2)} solid transparent;
902 border-bottom: #{math.div($height, 2)} solid transparent;
904 border-left: $width solid rgba(255, 255, 255, 0.95);
907 @mixin on-small-main-col () {
908 :host-context(.main-col:not(.expanded)) {
909 @media screen and (max-width: $small-view + $menu-width) {
914 :host-context(.main-col.expanded) {
915 @media screen and (max-width: $small-view) {
921 @mixin on-mobile-main-col () {
922 :host-context(.main-col:not(.expanded)) {
923 @media screen and (max-width: $mobile-view + $menu-width) {
928 :host-context(.main-col.expanded) {
929 @media screen and (max-width: $mobile-view) {
935 @mixin margin ($arg1: null, $arg2: null, $arg3: null, $arg4: null) {
936 @if $arg2 == null and $arg3 == null and $arg4 == null {
937 @include margin-original($arg1, $arg1, $arg1, $arg1);
938 } @else if $arg3 == null and $arg4 == null {
939 @include margin-original($arg1, $arg2, $arg1, $arg2);
940 } @else if $arg4 == null {
941 @include margin-original($arg1, $arg2, $arg3, $arg2);
943 @include margin-original($arg1, $arg2, $arg3, $arg4);
947 @mixin margin-original ($block-start, $inline-end, $block-end, $inline-start) {
948 @include margin-left($inline-start);
949 @include margin-right($inline-end);
950 @include margin-top($block-start);
951 @include margin-bottom($block-end);
954 @mixin margin-left ($value) {
955 @supports (margin-inline-start: $value) {
956 @include rfs($value, margin-inline-start);
959 @supports not (margin-inline-start: $value) {
960 @include rfs($value, margin-left);
964 @mixin margin-right ($value) {
965 @supports (margin-inline-end: $value) {
966 @include rfs($value, margin-inline-end);
969 @supports not (margin-inline-end: $value) {
970 @include rfs($value, margin-right);
974 @mixin padding-original ($block-start, $inline-end, $block-end, $inline-start) {
975 @include padding-left($inline-start);
976 @include padding-right($inline-end);
977 @include padding-top($block-start);
978 @include padding-bottom($block-end);
982 @mixin padding ($arg1: null, $arg2: null, $arg3: null, $arg4: null) {
983 @if $arg2 == null and $arg3 == null and $arg4 == null {
984 @include padding-original($arg1, $arg1, $arg1, $arg1);
985 } @else if $arg3 == null and $arg4 == null {
986 @include padding-original($arg1, $arg2, $arg1, $arg2);
987 } @else if $arg4 == null {
988 @include padding-original($arg1, $arg2, $arg3, $arg2);
990 @include padding-original($arg1, $arg2, $arg3, $arg4);
994 @mixin padding-left ($value) {
995 @supports (padding-inline-start: $value) {
996 @include rfs($value, padding-inline-start);
999 @supports not (padding-inline-start: $value) {
1000 @include rfs($value, padding-left);
1004 @mixin padding-right ($value) {
1005 @supports (padding-inline-end: $value) {
1006 @include rfs($value, padding-inline-end);
1009 @supports not (padding-inline-end: $value) {
1010 @include rfs($value, padding-right);