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;
92 color: pvar(--inputForegroundColor);
93 background-color: pvar(--inputBackgroundColor);
94 border: 1px solid #C6C6C6;
99 color: pvar(--inputPlaceholderColor);
106 @media screen and (max-width: calc(#{$width} + 40px)) {
111 @mixin peertube-input-group($width) {
113 min-height: $button-height;
124 @mixin peertube-textarea ($width, $height) {
125 @include peertube-input-text($width);
127 color: pvar(--textareaForegroundColor);
128 background-color: pvar(--textareaBackgroundColor);
134 @mixin orange-button {
135 @include button-focus(pvar(--mainColorLightest));
141 background-color: pvar(--mainColor);
146 background-color: pvar(--mainHoverColor);
153 background-color: #C6C6C6;
157 @include apply-svg-color(#fff);
161 @mixin orange-button-inverted {
162 @include button-focus(pvar(--mainColorLightest));
164 border: 2px solid pvar(--mainColor);
165 font-weight: $font-semibold;
170 color: pvar(--mainColor);
171 background-color: pvar(--mainBackgroundColor);
175 color: pvar(--mainColor);
176 background-color: pvar(--mainColorLightest);
182 color: pvar(--mainColor);
183 background-color: #C6C6C6;
187 @include apply-svg-color(pvar(--mainColor));
191 @mixin tertiary-button {
192 @include button-focus($grey-button-outline-color);
194 color: pvar(--greyForegroundColor);
195 background-color: transparent;
203 @include apply-svg-color(transparent);
208 @include button-focus($grey-button-outline-color);
210 background-color: $grey-background-color;
211 color: pvar(--greyForegroundColor);
218 color: pvar(--greyForegroundColor);
219 background-color: $grey-background-hover-color;
228 @include apply-svg-color(pvar(--greyForegroundColor));
232 @mixin danger-button {
233 $color: lighten($color: #c54130, $amount: 10);
236 @include button-focus(scale-color($color, $alpha: -95%));
238 background-color: $color;
246 background-color: lighten($color: $color, $amount: 10);
255 @include apply-svg-color($text);
259 @mixin peertube-button {
260 @include padding(0, 17px, 0, 13px);
263 font-weight: $font-semibold;
265 height: $button-height;
266 line-height: $button-height;
267 // FIXME: because of primeng that redefines border-radius of all input[type="..."]
268 border-radius: 3px !important;
273 @mixin peertube-button-link {
274 @include disable-default-a-behaviour;
275 @include peertube-button;
277 display: inline-block;
280 @mixin peertube-button-outline {
281 @include disable-default-a-behaviour;
282 @include peertube-button;
284 display: inline-block;
288 @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
289 display: inline-flex;
291 line-height: normal !important;
294 @include margin-right($margin-right);
302 @mixin peertube-file {
305 display: inline-block;
316 filter: alpha(opacity=0);
325 @mixin peertube-button-file ($width) {
326 @include peertube-file;
327 @include peertube-button;
332 @mixin icon ($size) {
333 display: inline-block;
334 background-repeat: no-repeat;
335 background-size: contain;
338 vertical-align: middle;
342 @mixin responsive-width ($width) {
345 @media screen and (max-width: $width) {
350 @mixin peertube-select-container ($width) {
355 color: pvar(--inputForegroundColor);
356 background: pvar(--inputBackgroundColor);
361 background-color: #E5E5E5;
368 background-color: #f9f9f9;
371 @media screen and (max-width: $width) {
377 right: calc(0% + 15px);
382 pointer-events: none;
383 border: 5px solid rgba(0, 0, 0, 0);
384 border-top-color: #000;
390 padding: 0 35px 0 12px;
392 border: 1px solid #C6C6C6;
393 background: transparent none;
396 height: $button-height;
397 text-overflow: ellipsis;
398 color: pvar(--mainForegroundColor);
406 text-shadow: 0 0 0 #000;
414 &.peertube-select-button {
415 @include grey-button;
419 font-weight: $font-semibold;
420 color: pvar(--greyForegroundColor);
426 // Thanks: https://codepen.io/manabox/pen/raQmpL
427 @mixin peertube-radio-container {
428 [type=radio]:checked,
429 [type=radio]:not(:checked) {
434 [type=radio]:checked + label,
435 [type=radio]:not(:checked) + label {
440 display: inline-block;
442 font-weight: $font-regular;
445 [type=radio]:checked + label::before,
446 [type=radio]:not(:checked) + label::before {
453 border: 1px solid #C6C6C6;
458 [type=radio]:checked + label::after,
459 [type=radio]:not(:checked) + label::after {
463 background: pvar(--mainColor);
468 transition: all 0.2s ease;
470 [type=radio]:not(:checked) + label::after {
474 [type=radio]:checked + label::after {
479 .form-group-description {
487 @mixin peertube-checkbox ($border-width) {
492 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
500 border: $border-width solid #C6C6C6;
502 vertical-align: middle;
508 top: calc(2px - #{$border-width});
513 transform: rotate(45deg) scale(0);
514 border-right: 2px solid $bg-color;
515 border-bottom: 2px solid $bg-color;
520 border-color: transparent;
521 background: pvar(--mainColor);
522 animation: jelly 0.6s ease;
526 transform: rotate(45deg) scale(1);
531 @include margin-left(5px);
534 font-weight: $font-regular;
540 &[disabled] + span + span {
548 padding: 1/4em 1/2em;
549 text-transform: uppercase;
550 font-weight: $font-bold;
552 letter-spacing: 1/3px;
556 background-color: #ffcdd2;
561 text-decoration: line-through;
565 background-color: #feedaf;
570 background-color: #ffd8b2;
575 background-color: #c8e6c9;
580 background-color: #b3e5fc;
585 background-color: #eccfff;
590 @mixin actor-avatar-size ($size) {
591 display: inline-block;
598 @mixin actor-counters ($separator-margin: 10px) {
599 color: pvar(--greyForegroundColor);
604 > *:not(:last-child)::after {
606 margin: 0 $separator-margin;
607 color: pvar(--mainColor);
611 @mixin chevron ($size, $border-width) {
613 border-width: $border-width $border-width 0 0;
615 display: inline-block;
616 transform: rotate(-45deg);
621 @mixin chevron-right ($size, $border-width) {
622 @include chevron($size, $border-width);
625 transform: rotate(45deg);
628 @mixin chevron-left ($size, $border-width) {
629 @include chevron($size, $border-width);
632 transform: rotate(-135deg);
635 @mixin in-content-small-title {
636 text-transform: uppercase;
637 color: pvar(--mainColor);
638 font-weight: $font-bold;
642 @mixin settings-big-title {
643 text-transform: uppercase;
644 color: pvar(--mainColor);
645 font-weight: $font-bold;
650 @mixin create-button {
651 @include peertube-button-link;
652 @include orange-button;
653 @include button-with-icon(20px, 5px, -1px);
656 @mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
658 min-height: $min-height;
659 padding-bottom: 20px;
663 border-bottom: 1px solid #C6C6C6;
666 @media screen and (max-width: $small-view) {
667 @if $column-responsive {
668 flex-direction: column;
673 padding-bottom: 10px;
679 @mixin dropdown-with-icon-item {
683 @include margin-right(10px);
692 @mixin progressbar($small: false) {
693 background-color: $grey-background-color;
698 border-radius: 0.25rem;
703 color: $grey-foreground-color;
717 color: pvar(--mainBackgroundColor);
718 background-color: pvar(--mainColor);
720 flex-direction: column;
721 justify-content: center;
724 transition: width 0.6s ease;
727 background-color: pvar(--secondaryColor);
731 background-color: lighten($color: #c54130, $amount: 10);
739 padding: 0.75rem 1rem;
742 background-color: pvar(--submenuBackgroundColor);
743 border-radius: 0.25rem;
749 color: pvar(--mainColor);
753 @include padding-left(0.5rem);
756 @include padding-right(0.5rem);
758 display: inline-block;
776 box-sizing: border-box;
777 flex: 0 0 percentage(math.div(1, 3));
782 @include disable-default-a-behaviour;
784 text-decoration: none;
799 background: pvar(--submenuBackgroundColor);
801 box-sizing: border-box;
810 color: pvar(--mainForegroundColor);
817 color: pvar(--inputPlaceholderColor);
822 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
824 border-top: .05rem solid $color;
834 background: $background;
836 content: attr(data-content);
837 display: inline-block;
840 transform: translateY(-.65rem);
847 --chip-padding: .2rem .4rem;
848 $avatar-height: 1.2rem;
851 border-radius: var(--chip-radius);
852 display: inline-flex;
854 color: pvar(--mainForegroundColor);
855 height: $avatar-height;
860 padding: var(--chip-padding);
861 text-decoration: none;
862 text-overflow: ellipsis;
863 vertical-align: middle;
867 --chip-radius: .2rem;
868 --chip-padding: .2rem .3rem;
872 @include margin-left(-.4rem);
873 @include margin-right(.2rem);
877 $avatar-height: 2rem;
879 height: $avatar-height;
882 @include actor-avatar-size($avatar-height);
889 flex-direction: column;
890 height: $avatar-height;
891 justify-content: center;
896 // applies ratio (default to 16:9) to a child element (using $selector) only using
897 // an immediate's parent size. This allows to set a ratio without explicit
898 // dimensions, as width/height cannot be computed from each other.
899 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
900 $padding-percent: percentage($inverted-ratio);
905 padding-top: $padding-percent;
920 border-bottom: 2px solid $grey-background-color;
921 padding-bottom: 15px;
922 margin-bottom: $sub-menu-margin-bottom;
924 > span > my-global-icon,
926 @include margin-right(10px);
933 @include margin-left(7px);
939 @mixin play-icon ($width, $height) {
946 transform: translate(-50%, -50%) scale(0.5);
948 border-top: #{math.div($height, 2)} solid transparent;
949 border-bottom: #{math.div($height, 2)} solid transparent;
951 border-left: $width solid rgba(255, 255, 255, 0.95);
954 @mixin on-small-main-col () {
955 :host-context(.main-col:not(.expanded)) {
956 @media screen and (max-width: $small-view + $menu-width) {
961 :host-context(.main-col.expanded) {
962 @media screen and (max-width: $small-view) {
968 @mixin on-mobile-main-col () {
969 :host-context(.main-col:not(.expanded)) {
970 @media screen and (max-width: $mobile-view + $menu-width) {
975 :host-context(.main-col.expanded) {
976 @media screen and (max-width: $mobile-view) {
982 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
983 @include margin-left($inline-start);
984 @include margin-right($inline-end);
986 margin-top: $block-start;
987 margin-bottom: $block-end;
990 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
991 @include padding-left($inline-start);
992 @include padding-right($inline-end);
994 padding-top: $block-start;
995 padding-bottom: $block-end;
998 @mixin margin-left ($value) {
999 @supports (margin-inline-start: $value) {
1000 margin-inline-start: $value;
1003 @supports not (margin-inline-start: $value) {
1004 margin-left: $value;
1008 @mixin margin-right ($value) {
1009 @supports (margin-inline-end: $value) {
1010 margin-inline-end: $value;
1013 @supports not (margin-inline-end: $value) {
1014 margin-right: $value;
1018 @mixin padding-left ($value) {
1019 @supports (padding-inline-start: $value) {
1020 padding-inline-start: $value;
1023 @supports not (padding-inline-start: $value) {
1024 padding-left: $value;
1028 @mixin padding-right ($value) {
1029 @supports (padding-inline-end: $value) {
1030 padding-inline-end: $value;
1033 @supports not (padding-inline-end: $value) {
1034 padding-right: $value;