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 @media screen and (max-width: $width) {
374 right: calc(0% + 15px);
379 pointer-events: none;
380 border: 5px solid rgba(0, 0, 0, 0);
381 border-top-color: #000;
387 padding: 0 35px 0 12px;
389 border: 1px solid #C6C6C6;
390 background: transparent none;
393 height: $button-height;
394 text-overflow: ellipsis;
395 color: pvar(--mainForegroundColor);
403 text-shadow: 0 0 0 #000;
411 &.peertube-select-button {
412 @include grey-button;
416 font-weight: $font-semibold;
417 color: pvar(--greyForegroundColor);
423 // Thanks: https://codepen.io/manabox/pen/raQmpL
424 @mixin peertube-radio-container {
425 [type=radio]:checked,
426 [type=radio]:not(:checked) {
431 [type=radio]:checked + label,
432 [type=radio]:not(:checked) + label {
437 display: inline-block;
440 [type=radio]:checked + label::before,
441 [type=radio]:not(:checked) + label::before {
448 border: 1px solid #C6C6C6;
453 [type=radio]:checked + label::after,
454 [type=radio]:not(:checked) + label::after {
458 background: pvar(--mainColor);
463 transition: all 0.2s ease;
465 [type=radio]:not(:checked) + label::after {
469 [type=radio]:checked + label::after {
475 @mixin peertube-checkbox ($border-width) {
480 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
488 border: $border-width solid #C6C6C6;
490 vertical-align: middle;
496 top: calc(2px - #{$border-width});
501 transform: rotate(45deg) scale(0);
502 border-right: 2px solid $bg-color;
503 border-bottom: 2px solid $bg-color;
508 border-color: transparent;
509 background: pvar(--mainColor);
510 animation: jelly 0.6s ease;
514 transform: rotate(45deg) scale(1);
519 @include margin-left(5px);
522 font-weight: $font-regular;
528 &[disabled] + span + span {
536 padding: 1/4em 1/2em;
537 text-transform: uppercase;
538 font-weight: $font-bold;
540 letter-spacing: 1/3px;
544 background-color: #ffcdd2;
549 text-decoration: line-through;
553 background-color: #feedaf;
558 background-color: #ffd8b2;
563 background-color: #c8e6c9;
568 background-color: #b3e5fc;
573 background-color: #eccfff;
578 @mixin actor-avatar-size ($size) {
579 display: inline-block;
586 @mixin actor-counters ($separator-margin: 10px) {
587 color: pvar(--greyForegroundColor);
592 > *:not(:last-child)::after {
594 margin: 0 $separator-margin;
595 color: pvar(--mainColor);
599 @mixin chevron ($size, $border-width) {
601 border-width: $border-width $border-width 0 0;
603 display: inline-block;
604 transform: rotate(-45deg);
609 @mixin chevron-right ($size, $border-width) {
610 @include chevron($size, $border-width);
613 transform: rotate(45deg);
616 @mixin chevron-left ($size, $border-width) {
617 @include chevron($size, $border-width);
620 transform: rotate(-135deg);
623 @mixin in-content-small-title {
624 text-transform: uppercase;
625 color: pvar(--mainColor);
626 font-weight: $font-bold;
630 @mixin settings-big-title {
631 text-transform: uppercase;
632 color: pvar(--mainColor);
633 font-weight: $font-bold;
638 @mixin create-button {
639 @include peertube-button-link;
640 @include orange-button;
641 @include button-with-icon(20px, 5px, -1px);
644 @mixin row-blocks ($column-responsive: true) {
647 padding-bottom: 20px;
649 border-bottom: 1px solid #C6C6C6;
651 @media screen and (max-width: $small-view) {
652 @if $column-responsive {
653 flex-direction: column;
658 padding-bottom: 10px;
664 @mixin dropdown-with-icon-item {
668 @include margin-right(10px);
677 @mixin progressbar($small: false) {
678 background-color: $grey-background-color;
683 border-radius: 0.25rem;
688 color: $grey-foreground-color;
702 color: pvar(--mainBackgroundColor);
703 background-color: pvar(--mainColor);
705 flex-direction: column;
706 justify-content: center;
709 transition: width 0.6s ease;
712 background-color: pvar(--secondaryColor);
716 background-color: lighten($color: #c54130, $amount: 10);
724 padding: 0.75rem 1rem;
727 background-color: pvar(--submenuBackgroundColor);
728 border-radius: 0.25rem;
734 color: pvar(--mainColor);
738 @include padding-left(0.5rem);
741 @include padding-right(0.5rem);
743 display: inline-block;
761 box-sizing: border-box;
762 flex: 0 0 percentage(math.div(1, 3));
767 @include disable-default-a-behaviour;
769 text-decoration: none;
784 background: pvar(--submenuBackgroundColor);
786 box-sizing: border-box;
795 color: pvar(--mainForegroundColor);
802 color: pvar(--inputPlaceholderColor);
807 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
809 border-top: .05rem solid $color;
819 background: $background;
821 content: attr(data-content);
822 display: inline-block;
825 transform: translateY(-.65rem);
832 --chip-padding: .2rem .4rem;
833 $avatar-height: 1.2rem;
836 border-radius: var(--chip-radius);
837 display: inline-flex;
839 color: pvar(--mainForegroundColor);
840 height: $avatar-height;
845 padding: var(--chip-padding);
846 text-decoration: none;
847 text-overflow: ellipsis;
848 vertical-align: middle;
852 --chip-radius: .2rem;
853 --chip-padding: .2rem .3rem;
857 @include margin-left(-.4rem);
858 @include margin-right(.2rem);
862 $avatar-height: 2rem;
864 height: $avatar-height;
867 @include actor-avatar-size($avatar-height);
874 flex-direction: column;
875 height: $avatar-height;
876 justify-content: center;
881 // applies ratio (default to 16:9) to a child element (using $selector) only using
882 // an immediate's parent size. This allows to set a ratio without explicit
883 // dimensions, as width/height cannot be computed from each other.
884 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
885 $padding-percent: percentage($inverted-ratio);
890 padding-top: $padding-percent;
905 border-bottom: 2px solid $grey-background-color;
906 padding-bottom: 15px;
907 margin-bottom: $sub-menu-margin-bottom;
909 > span > my-global-icon,
911 @include margin-right(10px);
918 @include margin-left(7px);
924 @mixin play-icon ($width, $height) {
931 transform: translate(-50%, -50%) scale(0.5);
933 border-top: #{math.div($height, 2)} solid transparent;
934 border-bottom: #{math.div($height, 2)} solid transparent;
936 border-left: $width solid rgba(255, 255, 255, 0.95);
939 @mixin on-small-main-col () {
940 :host-context(.main-col:not(.expanded)) {
941 @media screen and (max-width: $small-view + $menu-width) {
946 :host-context(.main-col.expanded) {
947 @media screen and (max-width: $small-view) {
953 @mixin on-mobile-main-col () {
954 :host-context(.main-col:not(.expanded)) {
955 @media screen and (max-width: $mobile-view + $menu-width) {
960 :host-context(.main-col.expanded) {
961 @media screen and (max-width: $mobile-view) {
967 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
968 @include margin-left($inline-start);
969 @include margin-right($inline-end);
971 margin-top: $block-start;
972 margin-bottom: $block-end;
975 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
976 @include padding-left($inline-start);
977 @include padding-right($inline-end);
979 padding-top: $block-start;
980 padding-bottom: $block-end;
983 @mixin margin-left ($value) {
984 @supports (margin-inline-start: $value) {
985 margin-inline-start: $value;
988 @supports not (margin-inline-start: $value) {
993 @mixin margin-right ($value) {
994 @supports (margin-inline-end: $value) {
995 margin-inline-end: $value;
998 @supports not (margin-inline-end: $value) {
999 margin-right: $value;
1003 @mixin padding-left ($value) {
1004 @supports (padding-inline-start: $value) {
1005 padding-inline-start: $value;
1008 @supports not (padding-inline-start: $value) {
1009 padding-left: $value;
1013 @mixin padding-right ($value) {
1014 @supports (padding-inline-end: $value) {
1015 padding-inline-end: $value;
1018 @supports not (padding-inline-end: $value) {
1019 padding-right: $value;