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;
95 height: $button-height;
98 color: pvar(--inputForegroundColor);
99 background-color: pvar(--inputBackgroundColor);
100 border: 1px solid pvar(--inputBorderColor);
102 font-size: $form-input-font-size;
103 line-height: $form-input-line-height;
106 color: pvar(--inputPlaceholderColor);
113 @media screen and (max-width: calc(#{$width} + 40px)) {
118 @mixin peertube-textarea ($width, $height) {
119 @include peertube-input-text($width);
121 color: pvar(--textareaForegroundColor) !important;
122 background-color: pvar(--textareaBackgroundColor) !important;
127 @mixin orange-button {
128 @include button-focus(pvar(--mainColorLightest));
134 background-color: pvar(--mainColor);
139 background-color: pvar(--mainHoverColor);
146 background-color: pvar(--inputBorderColor);
150 @include apply-svg-color(#fff);
154 @mixin orange-button-inverted {
155 @include button-focus(pvar(--mainColorLightest));
157 border: 2px solid pvar(--mainColor);
158 font-weight: $font-semibold;
163 color: pvar(--mainColor);
164 background-color: pvar(--mainBackgroundColor);
168 color: pvar(--mainColor);
169 background-color: pvar(--mainColorLightest);
175 color: pvar(--mainColor);
176 background-color: pvar(--inputBorderColor);
180 @include apply-svg-color(pvar(--mainColor));
184 @mixin tertiary-button {
185 @include button-focus($grey-button-outline-color);
187 color: pvar(--greyForegroundColor);
188 background-color: transparent;
196 @include apply-svg-color(transparent);
201 @include button-focus($grey-button-outline-color);
203 background-color: pvar(--greyBackgroundColor);
204 color: pvar(--greyForegroundColor);
211 color: pvar(--greyForegroundColor);
212 background-color: pvar(--greySecondaryBackgroundColor);
221 @include apply-svg-color(pvar(--greyForegroundColor));
225 @mixin danger-button {
226 $color: lighten($color: #c54130, $amount: 10);
229 @include button-focus(scale-color($color, $alpha: -95%));
231 background-color: $color;
239 background-color: lighten($color: $color, $amount: 10);
248 @include apply-svg-color($text);
252 @mixin peertube-button {
256 font-weight: $font-semibold;
258 // Because of primeng that redefines border-radius of all input[type="..."]
259 border-radius: 3px !important;
264 font-size: $button-font-size;
267 @include margin-right(4px);
268 @include margin-left(4px);
272 @mixin peertube-button-big {
278 font-weight: $font-semibold;
280 // Because of primeng that redefines border-radius of all input[type="..."]
281 border-radius: 3px !important;
284 @mixin peertube-button-link {
285 @include disable-default-a-behaviour;
286 @include peertube-button;
288 display: inline-block;
291 @mixin peertube-button-big-link {
292 @include disable-default-a-behaviour;
293 @include peertube-button-big;
295 display: inline-block;
298 @mixin peertube-button-outline {
299 @include disable-default-a-behaviour;
300 @include peertube-button;
302 display: inline-block;
306 @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
308 @include margin-right($margin-right);
316 @mixin peertube-file {
319 display: inline-block;
329 filter: alpha(opacity=0);
332 background: pvar(--mainBackgroundColor);
338 @mixin peertube-button-file ($width) {
339 @include peertube-file;
340 @include peertube-button;
345 @mixin icon ($size) {
346 display: inline-block;
347 background-repeat: no-repeat;
348 background-size: contain;
351 vertical-align: middle;
355 @mixin responsive-width ($width) {
358 @media screen and (max-width: $width) {
363 @mixin peertube-select-container ($width) {
368 color: pvar(--inputForegroundColor);
369 background: pvar(--inputBackgroundColor);
374 background-color: #E5E5E5;
382 background-color: #f9f9f9;
385 @media screen and (max-width: $width) {
391 right: calc(0% + 15px);
396 pointer-events: none;
397 border: 5px solid rgba(0, 0, 0, 0);
398 border-top-color: pvar(--mainForegroundColor);
404 padding: 0 35px 0 12px;
406 border: 1px solid pvar(--inputBorderColor);
407 background: transparent none;
409 height: $button-height;
410 text-overflow: ellipsis;
411 color: pvar(--mainForegroundColor);
412 font-size: $form-input-font-size;
413 line-height: $form-input-line-height;
421 text-shadow: 0 0 0 #000;
428 font-weight: $font-semibold;
433 &.peertube-select-button {
434 @include grey-button;
437 font-weight: $font-semibold;
438 color: pvar(--greyForegroundColor);
444 // Thanks: https://codepen.io/manabox/pen/raQmpL
445 @mixin peertube-radio-container {
447 font-size: $form-input-font-size;
450 [type=radio]:checked,
451 [type=radio]:not(:checked) {
459 [type=radio]:checked + label,
460 [type=radio]:not(:checked) + label {
465 display: inline-block;
466 font-weight: $font-regular;
469 [type=radio]:checked + label::before,
470 [type=radio]:not(:checked) + label::before {
477 border: 1px solid pvar(--inputBorderColor);
482 [type=radio]:checked + label::after,
483 [type=radio]:not(:checked) + label::after {
487 background: pvar(--mainColor);
492 transition: all 0.2s ease;
494 [type=radio]:not(:checked) + label::after {
498 [type=radio]:checked + label::after {
503 .form-group-description {
511 @mixin peertube-checkbox ($border-width) {
516 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
524 border: $border-width solid pvar(--inputBorderColor);
526 vertical-align: middle;
532 top: calc(2px - #{$border-width});
537 transform: rotate(45deg) scale(0);
538 border-right: 2px solid pvar(--mainBackgroundColor);
539 border-bottom: 2px solid pvar(--mainBackgroundColor);
544 border-color: transparent;
545 background: pvar(--mainColor);
546 animation: jelly 0.6s ease;
550 transform: rotate(45deg) scale(1);
555 @include margin-left(5px);
557 font-weight: $font-regular;
563 &[disabled] + span + span {
569 @mixin actor-avatar-size ($size) {
570 display: inline-block;
577 @mixin actor-counters ($separator-margin: 10px) {
578 color: pvar(--greyForegroundColor);
582 > *:not(:last-child)::after {
584 margin: 0 $separator-margin;
585 color: pvar(--mainColor);
589 @mixin in-content-small-title {
590 text-transform: uppercase;
591 color: pvar(--mainColor);
592 font-weight: $font-bold;
596 @mixin settings-big-title {
597 text-transform: uppercase;
598 color: pvar(--mainColor);
599 font-weight: $font-bold;
604 @mixin create-button {
605 @include peertube-button-link;
606 @include orange-button;
607 @include button-with-icon(20px, 5px, -1px);
610 @mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
612 min-height: $min-height;
613 padding-bottom: 20px;
617 border-bottom: 1px solid pvar(--inputBorderColor);
620 @media screen and (max-width: $small-view) {
621 @if $column-responsive {
622 flex-direction: column;
627 padding-bottom: 10px;
633 @mixin dropdown-with-icon-item {
637 @include margin-right(10px);
646 @mixin progressbar($small: false) {
647 background-color: pvar(--greyBackgroundColor);
652 border-radius: 0.25rem;
657 color: pvar(--greyForegroundColor);
672 color: pvar(--mainBackgroundColor);
673 background-color: pvar(--mainColor);
675 flex-direction: column;
676 justify-content: center;
679 transition: width 0.6s ease;
682 background-color: lighten($color: #c54130, $amount: 10);
693 font-weight: $font-semibold;
699 color: pvar(--mainColor);
703 @include padding-left(0.5rem);
706 @include padding-right(0.5rem);
708 display: inline-block;
726 box-sizing: border-box;
727 flex: 0 0 percentage(math.div(1, 3));
732 @include disable-default-a-behaviour;
734 text-decoration: none;
749 background: pvar(--submenuBackgroundColor);
751 box-sizing: border-box;
760 color: pvar(--mainForegroundColor);
767 color: pvar(--inputPlaceholderColor);
772 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
774 border-top: .05rem solid $color;
784 background: $background;
786 content: attr(data-content);
787 display: inline-block;
790 transform: translateY(-.65rem);
796 --avatar-size: 1.2rem;
798 display: inline-flex;
799 color: pvar(--mainForegroundColor);
800 height: var(--avatar-size);
803 text-decoration: none;
804 text-overflow: ellipsis;
805 vertical-align: middle;
809 @include margin-right(.2rem);
812 width: var(--avatar-size);
813 height: var(--avatar-size);
823 display: inline-block;
828 flex-direction: column;
829 justify-content: center;
834 // applies ratio (default to 16:9) to a child element (using $selector) only using
835 // an immediate's parent size. This allows to set a ratio without explicit
836 // dimensions, as width/height cannot be computed from each other.
837 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
838 $padding-percent: percentage($inverted-ratio);
843 padding-top: $padding-percent;
858 border-bottom: 2px solid $grey-background-color;
859 padding-bottom: 15px;
860 margin-bottom: $sub-menu-margin-bottom;
862 > span > my-global-icon,
864 @include margin-right(10px);
871 @include margin-left(7px);
878 @mixin play-icon ($width, $height) {
885 transform: translate(-50%, -50%) scale(0.5);
887 border-top: #{math.div($height, 2)} solid transparent;
888 border-bottom: #{math.div($height, 2)} solid transparent;
890 border-left: $width solid rgba(255, 255, 255, 0.95);
893 @mixin on-small-main-col () {
894 :host-context(.main-col:not(.expanded)) {
895 @media screen and (max-width: $small-view + $menu-width) {
900 :host-context(.main-col.expanded) {
901 @media screen and (max-width: $small-view) {
907 @mixin on-mobile-main-col () {
908 :host-context(.main-col:not(.expanded)) {
909 @media screen and (max-width: $mobile-view + $menu-width) {
914 :host-context(.main-col.expanded) {
915 @media screen and (max-width: $mobile-view) {
921 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
922 @include margin-left($inline-start);
923 @include margin-right($inline-end);
925 margin-top: $block-start;
926 margin-bottom: $block-end;
929 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
930 @include padding-left($inline-start);
931 @include padding-right($inline-end);
933 padding-top: $block-start;
934 padding-bottom: $block-end;
937 @mixin margin-left ($value) {
938 @supports (margin-inline-start: $value) {
939 margin-inline-start: $value;
942 @supports not (margin-inline-start: $value) {
947 @mixin margin-right ($value) {
948 @supports (margin-inline-end: $value) {
949 margin-inline-end: $value;
952 @supports not (margin-inline-end: $value) {
953 margin-right: $value;
957 @mixin padding-left ($value) {
958 @supports (padding-inline-start: $value) {
959 padding-inline-start: $value;
962 @supports not (padding-inline-start: $value) {
963 padding-left: $value;
967 @mixin padding-right ($value) {
968 @supports (padding-inline-end: $value) {
969 padding-inline-end: $value;
972 @supports not (padding-inline-end: $value) {
973 padding-right: $value;