2 @use '_variables' as *;
4 @mixin disable-default-a-behaviour {
8 text-decoration: none !important;
9 outline: none !important;
13 @mixin disable-outline {
14 &:focus:not(.focus-visible) {
22 text-overflow: ellipsis;
25 @mixin ellipsis-multiline($font-size: 16px, $number-of-lines: 2) {
27 /* Fallback for non-webkit */
28 display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */
29 -webkit-line-clamp: $number-of-lines;
30 -webkit-box-orient: vertical;
31 /* Fallback for non-webkit */
32 font-size: $font-size;
33 line-height: $font-size;
35 text-overflow: ellipsis;
36 max-height: $font-size * $number-of-lines;
40 color: pvar(--greyForegroundColor) !important;
43 @mixin fade-text ($fade-after, $background-color) {
55 background: linear-gradient(transparent $fade-after, $background-color);
59 @mixin peertube-word-wrap ($with-hyphen: true) {
60 word-break: break-word;
61 word-wrap: break-word;
62 overflow-wrap: break-word;
69 @mixin apply-svg-color ($color) {
77 @mixin fill-svg-color ($color) {
85 @mixin button-focus($color) {
88 box-shadow: #{$focus-box-shadow-form} $color;
92 @mixin peertube-input-text($width) {
94 display: inline-block;
97 color: pvar(--inputForegroundColor);
98 background-color: pvar(--inputBackgroundColor);
99 border: 1px solid pvar(--inputBorderColor);
101 font-size: $form-input-font-size;
102 line-height: $form-input-line-height;
105 color: pvar(--inputPlaceholderColor);
112 @media screen and (max-width: calc(#{$width} + 40px)) {
117 @mixin peertube-textarea ($width, $height) {
118 @include peertube-input-text($width);
120 color: pvar(--textareaForegroundColor) !important;
121 background-color: pvar(--textareaBackgroundColor) !important;
126 @mixin orange-button {
127 @include button-focus(pvar(--mainColorLightest));
133 background-color: pvar(--mainColor);
138 background-color: pvar(--mainHoverColor);
145 background-color: pvar(--inputBorderColor);
149 @include apply-svg-color(#fff);
153 @mixin orange-button-inverted {
154 @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: lighten($color: #c54130, $amount: 10);
228 @include button-focus(scale-color($color, $alpha: -95%));
230 background-color: $color;
238 background-color: lighten($color: $color, $amount: 10);
247 @include apply-svg-color($text);
251 @mixin peertube-button {
255 font-weight: $font-semibold;
257 // Because of primeng that redefines border-radius of all input[type="..."]
258 border-radius: 3px !important;
263 font-size: $button-font-size;
266 @include margin-right(4px);
267 @include margin-left(4px);
271 @mixin peertube-button-big {
277 font-weight: $font-semibold;
279 // Because of primeng that redefines border-radius of all input[type="..."]
280 border-radius: 3px !important;
283 @mixin peertube-button-link {
284 @include disable-default-a-behaviour;
285 @include peertube-button;
287 display: inline-block;
290 @mixin peertube-button-big-link {
291 @include disable-default-a-behaviour;
292 @include peertube-button-big;
294 display: inline-block;
297 @mixin peertube-button-outline {
298 @include disable-default-a-behaviour;
299 @include peertube-button;
301 display: inline-block;
305 @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
307 @include margin-right($margin-right);
315 @mixin peertube-file {
318 display: inline-block;
328 filter: alpha(opacity=0);
331 background: pvar(--mainBackgroundColor);
337 @mixin peertube-button-file ($width) {
338 @include peertube-file;
339 @include peertube-button;
344 @mixin icon ($size) {
345 display: inline-block;
346 background-repeat: no-repeat;
347 background-size: contain;
350 vertical-align: middle;
354 @mixin responsive-width ($width) {
357 @media screen and (max-width: $width) {
362 @mixin peertube-select-container ($width) {
367 color: pvar(--inputForegroundColor);
368 background: pvar(--inputBackgroundColor);
373 background-color: #E5E5E5;
381 background-color: #f9f9f9;
384 @media screen and (max-width: $width) {
390 right: calc(0% + 15px);
395 pointer-events: none;
396 border: 5px solid rgba(0, 0, 0, 0);
397 border-top-color: pvar(--mainForegroundColor);
403 padding: 4px 35px 4px 12px;
405 border: 1px solid pvar(--inputBorderColor);
406 background: transparent none;
408 text-overflow: ellipsis;
409 color: pvar(--mainForegroundColor);
410 font-size: $form-input-font-size;
411 line-height: $form-input-line-height;
419 text-shadow: 0 0 0 #000;
426 font-weight: $font-semibold;
431 &.peertube-select-button {
432 @include grey-button;
435 font-weight: $font-semibold;
436 color: pvar(--greyForegroundColor);
442 // Thanks: https://codepen.io/manabox/pen/raQmpL
443 @mixin peertube-radio-container {
445 font-size: $form-input-font-size;
448 [type=radio]:checked,
449 [type=radio]:not(:checked) {
457 [type=radio]:checked + label,
458 [type=radio]:not(:checked) + label {
463 display: inline-block;
464 font-weight: $font-regular;
467 [type=radio]:checked + label::before,
468 [type=radio]:not(:checked) + label::before {
475 border: 1px solid pvar(--inputBorderColor);
480 [type=radio]:checked + label::after,
481 [type=radio]:not(:checked) + label::after {
485 background: pvar(--mainColor);
490 transition: all 0.2s ease;
492 [type=radio]:not(:checked) + label::after {
496 [type=radio]:checked + label::after {
501 .form-group-description {
509 @mixin peertube-checkbox ($border-width) {
514 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
522 border: $border-width solid pvar(--inputBorderColor);
524 vertical-align: middle;
530 top: calc(2px - #{$border-width});
535 transform: rotate(45deg) scale(0);
536 border-right: 2px solid pvar(--mainBackgroundColor);
537 border-bottom: 2px solid pvar(--mainBackgroundColor);
542 border-color: transparent;
543 background: pvar(--mainColor);
544 animation: jelly 0.6s ease;
548 transform: rotate(45deg) scale(1);
553 @include margin-left(5px);
555 font-weight: $font-regular;
561 &[disabled] + span + span {
567 @mixin actor-avatar-size ($size) {
568 display: inline-block;
575 @mixin actor-counters ($separator-margin: 10px) {
576 color: pvar(--greyForegroundColor);
580 > *:not(:last-child)::after {
582 margin: 0 $separator-margin;
583 color: pvar(--mainColor);
587 @mixin in-content-small-title {
588 text-transform: uppercase;
589 color: pvar(--mainColor);
590 font-weight: $font-bold;
594 @mixin settings-big-title {
595 text-transform: uppercase;
596 color: pvar(--mainColor);
597 font-weight: $font-bold;
602 @mixin create-button {
603 @include peertube-button-link;
604 @include orange-button;
605 @include button-with-icon(20px, 5px, -1px);
608 @mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
610 min-height: $min-height;
611 padding-bottom: 20px;
615 border-bottom: 1px solid pvar(--inputBorderColor);
618 @media screen and (max-width: $small-view) {
619 @if $column-responsive {
620 flex-direction: column;
625 padding-bottom: 10px;
631 @mixin dropdown-with-icon-item {
635 @include margin-right(10px);
644 @mixin progressbar($small: false) {
645 background-color: pvar(--greyBackgroundColor);
650 border-radius: 0.25rem;
655 color: pvar(--greyForegroundColor);
670 color: pvar(--mainBackgroundColor);
671 background-color: pvar(--mainColor);
673 flex-direction: column;
674 justify-content: center;
677 transition: width 0.6s ease;
680 background-color: lighten($color: #c54130, $amount: 10);
691 font-weight: $font-semibold;
697 color: pvar(--mainColor);
701 @include padding-left(0.5rem);
704 @include padding-right(0.5rem);
706 display: inline-block;
724 box-sizing: border-box;
725 flex: 0 0 percentage(math.div(1, 3));
730 @include disable-default-a-behaviour;
732 text-decoration: none;
747 background: pvar(--submenuBackgroundColor);
749 box-sizing: border-box;
758 color: pvar(--mainForegroundColor);
765 color: pvar(--inputPlaceholderColor);
770 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
772 border-top: .05rem solid $color;
782 background: $background;
784 content: attr(data-content);
785 display: inline-block;
788 transform: translateY(-.65rem);
794 --avatar-size: 1.2rem;
796 display: inline-flex;
797 color: pvar(--mainForegroundColor);
798 height: var(--avatar-size);
801 text-decoration: none;
802 text-overflow: ellipsis;
803 vertical-align: middle;
807 @include margin-right(.2rem);
810 width: var(--avatar-size);
811 height: var(--avatar-size);
821 display: inline-block;
826 flex-direction: column;
827 justify-content: center;
832 // applies ratio (default to 16:9) to a child element (using $selector) only using
833 // an immediate's parent size. This allows to set a ratio without explicit
834 // dimensions, as width/height cannot be computed from each other.
835 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
836 $padding-percent: percentage($inverted-ratio);
841 padding-top: $padding-percent;
856 border-bottom: 2px solid $grey-background-color;
857 padding-bottom: 15px;
858 margin-bottom: $sub-menu-margin-bottom;
860 > span > my-global-icon,
862 @include margin-right(10px);
869 @include margin-left(7px);
876 @mixin play-icon ($width, $height) {
883 transform: translate(-50%, -50%) scale(0.5);
885 border-top: #{math.div($height, 2)} solid transparent;
886 border-bottom: #{math.div($height, 2)} solid transparent;
888 border-left: $width solid rgba(255, 255, 255, 0.95);
891 @mixin on-small-main-col () {
892 :host-context(.main-col:not(.expanded)) {
893 @media screen and (max-width: $small-view + $menu-width) {
898 :host-context(.main-col.expanded) {
899 @media screen and (max-width: $small-view) {
905 @mixin on-mobile-main-col () {
906 :host-context(.main-col:not(.expanded)) {
907 @media screen and (max-width: $mobile-view + $menu-width) {
912 :host-context(.main-col.expanded) {
913 @media screen and (max-width: $mobile-view) {
919 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
920 @include margin-left($inline-start);
921 @include margin-right($inline-end);
923 margin-top: $block-start;
924 margin-bottom: $block-end;
927 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
928 @include padding-left($inline-start);
929 @include padding-right($inline-end);
931 padding-top: $block-start;
932 padding-bottom: $block-end;
935 @mixin margin-left ($value) {
936 @supports (margin-inline-start: $value) {
937 margin-inline-start: $value;
940 @supports not (margin-inline-start: $value) {
945 @mixin margin-right ($value) {
946 @supports (margin-inline-end: $value) {
947 margin-inline-end: $value;
950 @supports not (margin-inline-end: $value) {
951 margin-right: $value;
955 @mixin padding-left ($value) {
956 @supports (padding-inline-start: $value) {
957 padding-inline-start: $value;
960 @supports not (padding-inline-start: $value) {
961 padding-left: $value;
965 @mixin padding-right ($value) {
966 @supports (padding-inline-end: $value) {
967 padding-inline-end: $value;
970 @supports not (padding-inline-end: $value) {
971 padding-right: $value;