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;
39 @mixin fade-text ($fade-after, $background-color) {
51 background: linear-gradient(transparent $fade-after, $background-color);
55 @mixin peertube-word-wrap ($with-hyphen: true) {
56 word-break: break-word;
57 word-wrap: break-word;
58 overflow-wrap: break-word;
65 @mixin apply-svg-color ($color) {
73 @mixin fill-svg-color ($color) {
81 @mixin button-focus($color) {
84 box-shadow: #{$focus-box-shadow-form} $color;
88 @mixin peertube-input-text($width) {
90 display: inline-block;
91 height: $button-height;
94 color: pvar(--inputForegroundColor);
95 background-color: pvar(--inputBackgroundColor);
96 border: 1px solid pvar(--inputBorderColor);
98 font-size: $form-input-font-size;
99 line-height: $form-input-line-height;
102 color: pvar(--inputPlaceholderColor);
109 @media screen and (max-width: calc(#{$width} + 40px)) {
114 @mixin peertube-textarea ($width, $height) {
115 @include peertube-input-text($width);
117 color: pvar(--textareaForegroundColor) !important;
118 background-color: pvar(--textareaBackgroundColor) !important;
123 @mixin orange-button {
124 @include button-focus(pvar(--mainColorLightest));
130 background-color: pvar(--mainColor);
135 background-color: pvar(--mainHoverColor);
142 background-color: pvar(--inputBorderColor);
146 @include apply-svg-color(#fff);
150 @mixin orange-button-inverted {
151 @include button-focus(pvar(--mainColorLightest));
153 border: 2px solid pvar(--mainColor);
154 font-weight: $font-semibold;
159 color: pvar(--mainColor);
160 background-color: pvar(--mainBackgroundColor);
164 color: pvar(--mainColor);
165 background-color: pvar(--mainColorLightest);
171 color: pvar(--mainColor);
172 background-color: pvar(--inputBorderColor);
176 @include apply-svg-color(pvar(--mainColor));
180 @mixin tertiary-button {
181 @include button-focus($grey-button-outline-color);
183 color: pvar(--greyForegroundColor);
184 background-color: transparent;
192 @include apply-svg-color(transparent);
197 @include button-focus($grey-button-outline-color);
199 background-color: pvar(--greyBackgroundColor);
200 color: pvar(--greyForegroundColor);
207 color: pvar(--greyForegroundColor);
208 background-color: pvar(--greySecondaryBackgroundColor);
217 @include apply-svg-color(pvar(--greyForegroundColor));
221 @mixin danger-button {
222 $color: lighten($color: #c54130, $amount: 10);
225 @include button-focus(scale-color($color, $alpha: -95%));
227 background-color: $color;
235 background-color: lighten($color: $color, $amount: 10);
244 @include apply-svg-color($text);
248 @mixin peertube-button {
252 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;
262 font-size: $button-font-size;
265 @include margin-right(4px);
269 @mixin peertube-button-big {
275 font-weight: $font-semibold;
277 // Because of primeng that redefines border-radius of all input[type="..."]
278 border-radius: 3px !important;
281 @mixin peertube-button-link {
282 @include disable-default-a-behaviour;
283 @include peertube-button;
285 display: inline-block;
288 @mixin peertube-button-big-link {
289 @include disable-default-a-behaviour;
290 @include peertube-button-big;
292 display: inline-block;
295 @mixin peertube-button-outline {
296 @include disable-default-a-behaviour;
297 @include peertube-button;
299 display: inline-block;
303 @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
305 @include margin-right($margin-right);
313 @mixin peertube-file {
316 display: inline-block;
327 filter: alpha(opacity=0);
336 @mixin peertube-button-file ($width) {
337 @include peertube-file;
338 @include peertube-button;
343 @mixin icon ($size) {
344 display: inline-block;
345 background-repeat: no-repeat;
346 background-size: contain;
349 vertical-align: middle;
353 @mixin responsive-width ($width) {
356 @media screen and (max-width: $width) {
361 @mixin peertube-select-container ($width) {
366 color: pvar(--inputForegroundColor);
367 background: pvar(--inputBackgroundColor);
372 background-color: #E5E5E5;
380 background-color: #f9f9f9;
383 @media screen and (max-width: $width) {
389 right: calc(0% + 15px);
394 pointer-events: none;
395 border: 5px solid rgba(0, 0, 0, 0);
396 border-top-color: #000;
402 padding: 0 35px 0 12px;
404 border: 1px solid pvar(--inputBorderColor);
405 background: transparent none;
407 height: $button-height;
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 $bg-color;
537 border-bottom: 2px solid $bg-color;
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: $grey-background-color;
650 border-radius: 0.25rem;
655 color: $grey-foreground-color;
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);
795 --chip-padding: .2rem .4rem;
796 $avatar-height: 1.2rem;
799 border-radius: var(--chip-radius);
800 display: inline-flex;
802 color: pvar(--mainForegroundColor);
803 height: $avatar-height;
808 padding: var(--chip-padding);
809 text-decoration: none;
810 text-overflow: ellipsis;
811 vertical-align: middle;
815 --chip-radius: .2rem;
816 --chip-padding: .2rem .3rem;
820 @include margin-left(-.4rem);
821 @include margin-right(.2rem);
825 $avatar-height: 2rem;
827 height: $avatar-height;
830 display: inline-block;
837 flex-direction: column;
838 height: $avatar-height;
839 justify-content: center;
844 // applies ratio (default to 16:9) to a child element (using $selector) only using
845 // an immediate's parent size. This allows to set a ratio without explicit
846 // dimensions, as width/height cannot be computed from each other.
847 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
848 $padding-percent: percentage($inverted-ratio);
853 padding-top: $padding-percent;
868 border-bottom: 2px solid $grey-background-color;
869 padding-bottom: 15px;
870 margin-bottom: $sub-menu-margin-bottom;
872 > span > my-global-icon,
874 @include margin-right(10px);
881 @include margin-left(7px);
888 @mixin play-icon ($width, $height) {
895 transform: translate(-50%, -50%) scale(0.5);
897 border-top: #{math.div($height, 2)} solid transparent;
898 border-bottom: #{math.div($height, 2)} solid transparent;
900 border-left: $width solid rgba(255, 255, 255, 0.95);
903 @mixin on-small-main-col () {
904 :host-context(.main-col:not(.expanded)) {
905 @media screen and (max-width: $small-view + $menu-width) {
910 :host-context(.main-col.expanded) {
911 @media screen and (max-width: $small-view) {
917 @mixin on-mobile-main-col () {
918 :host-context(.main-col:not(.expanded)) {
919 @media screen and (max-width: $mobile-view + $menu-width) {
924 :host-context(.main-col.expanded) {
925 @media screen and (max-width: $mobile-view) {
931 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
932 @include margin-left($inline-start);
933 @include margin-right($inline-end);
935 margin-top: $block-start;
936 margin-bottom: $block-end;
939 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
940 @include padding-left($inline-start);
941 @include padding-right($inline-end);
943 padding-top: $block-start;
944 padding-bottom: $block-end;
947 @mixin margin-left ($value) {
948 @supports (margin-inline-start: $value) {
949 margin-inline-start: $value;
952 @supports not (margin-inline-start: $value) {
957 @mixin margin-right ($value) {
958 @supports (margin-inline-end: $value) {
959 margin-inline-end: $value;
962 @supports not (margin-inline-end: $value) {
963 margin-right: $value;
967 @mixin padding-left ($value) {
968 @supports (padding-inline-start: $value) {
969 padding-inline-start: $value;
972 @supports not (padding-inline-start: $value) {
973 padding-left: $value;
977 @mixin padding-right ($value) {
978 @supports (padding-inline-end: $value) {
979 padding-inline-end: $value;
982 @supports not (padding-inline-end: $value) {
983 padding-right: $value;