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 /* Fallback for non-webkit */
31 font-size: $font-size;
32 line-height: $font-size;
34 text-overflow: ellipsis;
35 max-height: $font-size * $number-of-lines;
38 @mixin fade-text ($fade-after, $background-color) {
50 background: linear-gradient(transparent $fade-after, $background-color);
54 @mixin peertube-word-wrap ($with-hyphen: true) {
55 word-break: break-word;
56 word-wrap: break-word;
57 overflow-wrap: break-word;
64 @mixin apply-svg-color ($color) {
72 @mixin fill-svg-color ($color) {
80 @mixin button-focus($color) {
83 box-shadow: #{$focus-box-shadow-form} $color;
87 @mixin peertube-input-text($width) {
89 display: inline-block;
90 height: $button-height;
93 color: pvar(--inputForegroundColor);
94 background-color: pvar(--inputBackgroundColor);
95 border: 1px solid $input-border-color;
100 color: pvar(--inputPlaceholderColor);
107 @media screen and (max-width: calc(#{$width} + 40px)) {
112 @mixin peertube-textarea ($width, $height) {
113 @include peertube-input-text($width);
115 color: pvar(--textareaForegroundColor) !important;
116 background-color: pvar(--textareaBackgroundColor) !important;
122 @mixin orange-button {
123 @include button-focus(pvar(--mainColorLightest));
129 background-color: pvar(--mainColor);
134 background-color: pvar(--mainHoverColor);
141 background-color: $input-border-color;
145 @include apply-svg-color(#fff);
149 @mixin orange-button-inverted {
150 @include button-focus(pvar(--mainColorLightest));
152 border: 2px solid pvar(--mainColor);
153 font-weight: $font-semibold;
158 color: pvar(--mainColor);
159 background-color: pvar(--mainBackgroundColor);
163 color: pvar(--mainColor);
164 background-color: pvar(--mainColorLightest);
170 color: pvar(--mainColor);
171 background-color: $input-border-color;
175 @include apply-svg-color(pvar(--mainColor));
179 @mixin tertiary-button {
180 @include button-focus($grey-button-outline-color);
182 color: pvar(--greyForegroundColor);
183 background-color: transparent;
191 @include apply-svg-color(transparent);
196 @include button-focus($grey-button-outline-color);
198 background-color: pvar(--greyBackgroundColor);
199 color: pvar(--greyForegroundColor);
206 color: pvar(--greyForegroundColor);
207 background-color: pvar(--greySecondaryBackgroundColor);
216 @include apply-svg-color(pvar(--greyForegroundColor));
220 @mixin danger-button {
221 $color: lighten($color: #c54130, $amount: 10);
224 @include button-focus(scale-color($color, $alpha: -95%));
226 background-color: $color;
234 background-color: lighten($color: $color, $amount: 10);
243 @include apply-svg-color($text);
247 @mixin peertube-button {
251 font-weight: $font-semibold;
253 height: $button-height;
254 line-height: $button-height;
256 // Because of primeng that redefines border-radius of all input[type="..."]
257 border-radius: 3px !important;
263 @include margin-right(4px);
267 @mixin peertube-button-big {
273 font-weight: $font-semibold;
275 // Because of primeng that redefines border-radius of all input[type="..."]
276 border-radius: 3px !important;
279 @mixin peertube-button-link {
280 @include disable-default-a-behaviour;
281 @include peertube-button;
283 display: inline-block;
286 @mixin peertube-button-outline {
287 @include disable-default-a-behaviour;
288 @include peertube-button;
290 display: inline-block;
294 @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
295 display: inline-flex;
297 line-height: normal !important;
300 @include margin-right($margin-right);
308 @mixin peertube-file {
311 display: inline-block;
322 filter: alpha(opacity=0);
331 @mixin peertube-button-file ($width) {
332 @include peertube-file;
333 @include peertube-button;
338 @mixin icon ($size) {
339 display: inline-block;
340 background-repeat: no-repeat;
341 background-size: contain;
344 vertical-align: middle;
348 @mixin responsive-width ($width) {
351 @media screen and (max-width: $width) {
356 @mixin peertube-select-container ($width) {
361 color: pvar(--inputForegroundColor);
362 background: pvar(--inputBackgroundColor);
368 background-color: #E5E5E5;
376 background-color: #f9f9f9;
379 @media screen and (max-width: $width) {
385 right: calc(0% + 15px);
390 pointer-events: none;
391 border: 5px solid rgba(0, 0, 0, 0);
392 border-top-color: #000;
398 padding: 0 35px 0 12px;
400 border: 1px solid $input-border-color;
401 background: transparent none;
403 height: $button-height;
404 text-overflow: ellipsis;
405 color: pvar(--mainForegroundColor);
413 text-shadow: 0 0 0 #000;
420 font-weight: $font-semibold;
425 &.peertube-select-button {
426 @include grey-button;
429 font-weight: $font-semibold;
430 color: pvar(--greyForegroundColor);
436 // Thanks: https://codepen.io/manabox/pen/raQmpL
437 @mixin peertube-radio-container {
438 [type=radio]:checked,
439 [type=radio]:not(:checked) {
444 [type=radio]:checked + label,
445 [type=radio]:not(:checked) + label {
450 display: inline-block;
452 font-weight: $font-regular;
455 [type=radio]:checked + label::before,
456 [type=radio]:not(:checked) + label::before {
463 border: 1px solid $input-border-color;
468 [type=radio]:checked + label::after,
469 [type=radio]:not(:checked) + label::after {
473 background: pvar(--mainColor);
478 transition: all 0.2s ease;
480 [type=radio]:not(:checked) + label::after {
484 [type=radio]:checked + label::after {
489 .form-group-description {
497 @mixin peertube-checkbox ($border-width) {
502 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
510 border: $border-width solid $input-border-color;
512 vertical-align: middle;
518 top: calc(2px - #{$border-width});
523 transform: rotate(45deg) scale(0);
524 border-right: 2px solid $bg-color;
525 border-bottom: 2px solid $bg-color;
530 border-color: transparent;
531 background: pvar(--mainColor);
532 animation: jelly 0.6s ease;
536 transform: rotate(45deg) scale(1);
541 @include margin-left(5px);
544 font-weight: $font-regular;
550 &[disabled] + span + span {
556 @mixin actor-avatar-size ($size) {
557 display: inline-block;
564 @mixin actor-counters ($separator-margin: 10px) {
565 color: pvar(--greyForegroundColor);
570 > *:not(:last-child)::after {
572 margin: 0 $separator-margin;
573 color: pvar(--mainColor);
577 @mixin in-content-small-title {
578 text-transform: uppercase;
579 color: pvar(--mainColor);
580 font-weight: $font-bold;
584 @mixin settings-big-title {
585 text-transform: uppercase;
586 color: pvar(--mainColor);
587 font-weight: $font-bold;
592 @mixin create-button {
593 @include peertube-button-link;
594 @include orange-button;
595 @include button-with-icon(20px, 5px, -1px);
598 @mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
600 min-height: $min-height;
601 padding-bottom: 20px;
605 border-bottom: 1px solid $input-border-color;
608 @media screen and (max-width: $small-view) {
609 @if $column-responsive {
610 flex-direction: column;
615 padding-bottom: 10px;
621 @mixin dropdown-with-icon-item {
625 @include margin-right(10px);
634 @mixin progressbar($small: false) {
635 background-color: $grey-background-color;
640 border-radius: 0.25rem;
645 color: $grey-foreground-color;
660 color: pvar(--mainBackgroundColor);
661 background-color: pvar(--mainColor);
663 flex-direction: column;
664 justify-content: center;
667 transition: width 0.6s ease;
670 background-color: lighten($color: #c54130, $amount: 10);
678 padding: 0.75rem 1rem;
681 background-color: pvar(--submenuBackgroundColor);
682 border-radius: 0.25rem;
688 color: pvar(--mainColor);
692 @include padding-left(0.5rem);
695 @include padding-right(0.5rem);
697 display: inline-block;
715 box-sizing: border-box;
716 flex: 0 0 percentage(math.div(1, 3));
721 @include disable-default-a-behaviour;
723 text-decoration: none;
738 background: pvar(--submenuBackgroundColor);
740 box-sizing: border-box;
749 color: pvar(--mainForegroundColor);
756 color: pvar(--inputPlaceholderColor);
761 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
763 border-top: .05rem solid $color;
773 background: $background;
775 content: attr(data-content);
776 display: inline-block;
779 transform: translateY(-.65rem);
786 --chip-padding: .2rem .4rem;
787 $avatar-height: 1.2rem;
790 border-radius: var(--chip-radius);
791 display: inline-flex;
793 color: pvar(--mainForegroundColor);
794 height: $avatar-height;
799 padding: var(--chip-padding);
800 text-decoration: none;
801 text-overflow: ellipsis;
802 vertical-align: middle;
806 --chip-radius: .2rem;
807 --chip-padding: .2rem .3rem;
811 @include margin-left(-.4rem);
812 @include margin-right(.2rem);
816 $avatar-height: 2rem;
818 height: $avatar-height;
821 display: inline-block;
828 flex-direction: column;
829 height: $avatar-height;
830 justify-content: center;
835 // applies ratio (default to 16:9) to a child element (using $selector) only using
836 // an immediate's parent size. This allows to set a ratio without explicit
837 // dimensions, as width/height cannot be computed from each other.
838 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
839 $padding-percent: percentage($inverted-ratio);
844 padding-top: $padding-percent;
859 border-bottom: 2px solid $grey-background-color;
860 padding-bottom: 15px;
861 margin-bottom: $sub-menu-margin-bottom;
863 > span > my-global-icon,
865 @include margin-right(10px);
872 @include margin-left(7px);
879 @mixin play-icon ($width, $height) {
886 transform: translate(-50%, -50%) scale(0.5);
888 border-top: #{math.div($height, 2)} solid transparent;
889 border-bottom: #{math.div($height, 2)} solid transparent;
891 border-left: $width solid rgba(255, 255, 255, 0.95);
894 @mixin on-small-main-col () {
895 :host-context(.main-col:not(.expanded)) {
896 @media screen and (max-width: $small-view + $menu-width) {
901 :host-context(.main-col.expanded) {
902 @media screen and (max-width: $small-view) {
908 @mixin on-mobile-main-col () {
909 :host-context(.main-col:not(.expanded)) {
910 @media screen and (max-width: $mobile-view + $menu-width) {
915 :host-context(.main-col.expanded) {
916 @media screen and (max-width: $mobile-view) {
922 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
923 @include margin-left($inline-start);
924 @include margin-right($inline-end);
926 margin-top: $block-start;
927 margin-bottom: $block-end;
930 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
931 @include padding-left($inline-start);
932 @include padding-right($inline-end);
934 padding-top: $block-start;
935 padding-bottom: $block-end;
938 @mixin margin-left ($value) {
939 @supports (margin-inline-start: $value) {
940 margin-inline-start: $value;
943 @supports not (margin-inline-start: $value) {
948 @mixin margin-right ($value) {
949 @supports (margin-inline-end: $value) {
950 margin-inline-end: $value;
953 @supports not (margin-inline-end: $value) {
954 margin-right: $value;
958 @mixin padding-left ($value) {
959 @supports (padding-inline-start: $value) {
960 padding-inline-start: $value;
963 @supports not (padding-inline-start: $value) {
964 padding-left: $value;
968 @mixin padding-right ($value) {
969 @supports (padding-inline-end: $value) {
970 padding-inline-end: $value;
973 @supports not (padding-inline-end: $value) {
974 padding-right: $value;