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 {
263 font-weight: $font-semibold;
265 height: $button-height;
266 line-height: $button-height;
268 // Because of primeng that redefines border-radius of all input[type="..."]
269 border-radius: 3px !important;
275 @include margin-right(4px);
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;
375 background-color: #f9f9f9;
378 @media screen and (max-width: $width) {
384 right: calc(0% + 15px);
389 pointer-events: none;
390 border: 5px solid rgba(0, 0, 0, 0);
391 border-top-color: #000;
397 padding: 0 35px 0 12px;
399 border: 1px solid #C6C6C6;
400 background: transparent none;
403 height: $button-height;
404 text-overflow: ellipsis;
405 color: pvar(--mainForegroundColor);
413 text-shadow: 0 0 0 #000;
421 &.peertube-select-button {
422 @include grey-button;
426 font-weight: $font-semibold;
427 color: pvar(--greyForegroundColor);
433 // Thanks: https://codepen.io/manabox/pen/raQmpL
434 @mixin peertube-radio-container {
435 [type=radio]:checked,
436 [type=radio]:not(:checked) {
441 [type=radio]:checked + label,
442 [type=radio]:not(:checked) + label {
447 display: inline-block;
449 font-weight: $font-regular;
452 [type=radio]:checked + label::before,
453 [type=radio]:not(:checked) + label::before {
460 border: 1px solid #C6C6C6;
465 [type=radio]:checked + label::after,
466 [type=radio]:not(:checked) + label::after {
470 background: pvar(--mainColor);
475 transition: all 0.2s ease;
477 [type=radio]:not(:checked) + label::after {
481 [type=radio]:checked + label::after {
486 .form-group-description {
494 @mixin peertube-checkbox ($border-width) {
499 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
507 border: $border-width solid #C6C6C6;
509 vertical-align: middle;
515 top: calc(2px - #{$border-width});
520 transform: rotate(45deg) scale(0);
521 border-right: 2px solid $bg-color;
522 border-bottom: 2px solid $bg-color;
527 border-color: transparent;
528 background: pvar(--mainColor);
529 animation: jelly 0.6s ease;
533 transform: rotate(45deg) scale(1);
538 @include margin-left(5px);
541 font-weight: $font-regular;
547 &[disabled] + span + span {
553 @mixin peertube-badge {
555 padding: 1/4em 1/2em;
556 text-transform: uppercase;
557 font-weight: $font-bold;
559 letter-spacing: 1/3px;
563 background-color: #ffcdd2;
568 text-decoration: line-through;
572 background-color: #feedaf;
577 background-color: #ffd8b2;
582 background-color: #c8e6c9;
587 background-color: #b3e5fc;
592 background-color: #eccfff;
597 @mixin actor-avatar-size ($size) {
598 display: inline-block;
605 @mixin actor-counters ($separator-margin: 10px) {
606 color: pvar(--greyForegroundColor);
611 > *:not(:last-child)::after {
613 margin: 0 $separator-margin;
614 color: pvar(--mainColor);
618 @mixin chevron ($size, $border-width) {
620 border-width: $border-width $border-width 0 0;
622 display: inline-block;
623 transform: rotate(-45deg);
628 @mixin chevron-right ($size, $border-width) {
629 @include chevron($size, $border-width);
632 transform: rotate(45deg);
635 @mixin chevron-left ($size, $border-width) {
636 @include chevron($size, $border-width);
639 transform: rotate(-135deg);
642 @mixin in-content-small-title {
643 text-transform: uppercase;
644 color: pvar(--mainColor);
645 font-weight: $font-bold;
649 @mixin settings-big-title {
650 text-transform: uppercase;
651 color: pvar(--mainColor);
652 font-weight: $font-bold;
657 @mixin create-button {
658 @include peertube-button-link;
659 @include orange-button;
660 @include button-with-icon(20px, 5px, -1px);
663 @mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
665 min-height: $min-height;
666 padding-bottom: 20px;
670 border-bottom: 1px solid #C6C6C6;
673 @media screen and (max-width: $small-view) {
674 @if $column-responsive {
675 flex-direction: column;
680 padding-bottom: 10px;
686 @mixin dropdown-with-icon-item {
690 @include margin-right(10px);
699 @mixin progressbar($small: false) {
700 background-color: $grey-background-color;
705 border-radius: 0.25rem;
710 color: $grey-foreground-color;
725 color: pvar(--mainBackgroundColor);
726 background-color: pvar(--mainColor);
728 flex-direction: column;
729 justify-content: center;
732 transition: width 0.6s ease;
735 background-color: pvar(--secondaryColor);
739 background-color: lighten($color: #c54130, $amount: 10);
747 padding: 0.75rem 1rem;
750 background-color: pvar(--submenuBackgroundColor);
751 border-radius: 0.25rem;
757 color: pvar(--mainColor);
761 @include padding-left(0.5rem);
764 @include padding-right(0.5rem);
766 display: inline-block;
784 box-sizing: border-box;
785 flex: 0 0 percentage(math.div(1, 3));
790 @include disable-default-a-behaviour;
792 text-decoration: none;
807 background: pvar(--submenuBackgroundColor);
809 box-sizing: border-box;
818 color: pvar(--mainForegroundColor);
825 color: pvar(--inputPlaceholderColor);
830 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
832 border-top: .05rem solid $color;
842 background: $background;
844 content: attr(data-content);
845 display: inline-block;
848 transform: translateY(-.65rem);
855 --chip-padding: .2rem .4rem;
856 $avatar-height: 1.2rem;
859 border-radius: var(--chip-radius);
860 display: inline-flex;
862 color: pvar(--mainForegroundColor);
863 height: $avatar-height;
868 padding: var(--chip-padding);
869 text-decoration: none;
870 text-overflow: ellipsis;
871 vertical-align: middle;
875 --chip-radius: .2rem;
876 --chip-padding: .2rem .3rem;
880 @include margin-left(-.4rem);
881 @include margin-right(.2rem);
885 $avatar-height: 2rem;
887 height: $avatar-height;
890 display: inline-block;
897 flex-direction: column;
898 height: $avatar-height;
899 justify-content: center;
904 // applies ratio (default to 16:9) to a child element (using $selector) only using
905 // an immediate's parent size. This allows to set a ratio without explicit
906 // dimensions, as width/height cannot be computed from each other.
907 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
908 $padding-percent: percentage($inverted-ratio);
913 padding-top: $padding-percent;
928 border-bottom: 2px solid $grey-background-color;
929 padding-bottom: 15px;
930 margin-bottom: $sub-menu-margin-bottom;
932 > span > my-global-icon,
934 @include margin-right(10px);
941 @include margin-left(7px);
947 @mixin play-icon ($width, $height) {
954 transform: translate(-50%, -50%) scale(0.5);
956 border-top: #{math.div($height, 2)} solid transparent;
957 border-bottom: #{math.div($height, 2)} solid transparent;
959 border-left: $width solid rgba(255, 255, 255, 0.95);
962 @mixin on-small-main-col () {
963 :host-context(.main-col:not(.expanded)) {
964 @media screen and (max-width: $small-view + $menu-width) {
969 :host-context(.main-col.expanded) {
970 @media screen and (max-width: $small-view) {
976 @mixin on-mobile-main-col () {
977 :host-context(.main-col:not(.expanded)) {
978 @media screen and (max-width: $mobile-view + $menu-width) {
983 :host-context(.main-col.expanded) {
984 @media screen and (max-width: $mobile-view) {
990 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
991 @include margin-left($inline-start);
992 @include margin-right($inline-end);
994 margin-top: $block-start;
995 margin-bottom: $block-end;
998 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
999 @include padding-left($inline-start);
1000 @include padding-right($inline-end);
1002 padding-top: $block-start;
1003 padding-bottom: $block-end;
1006 @mixin margin-left ($value) {
1007 @supports (margin-inline-start: $value) {
1008 margin-inline-start: $value;
1011 @supports not (margin-inline-start: $value) {
1012 margin-left: $value;
1016 @mixin margin-right ($value) {
1017 @supports (margin-inline-end: $value) {
1018 margin-inline-end: $value;
1021 @supports not (margin-inline-end: $value) {
1022 margin-right: $value;
1026 @mixin padding-left ($value) {
1027 @supports (padding-inline-start: $value) {
1028 padding-inline-start: $value;
1031 @supports not (padding-inline-start: $value) {
1032 padding-left: $value;
1036 @mixin padding-right ($value) {
1037 @supports (padding-inline-end: $value) {
1038 padding-inline-end: $value;
1041 @supports not (padding-inline-end: $value) {
1042 padding-right: $value;