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) {
659 padding-bottom: 20px;
661 border-bottom: 1px solid #C6C6C6;
663 @media screen and (max-width: $small-view) {
664 @if $column-responsive {
665 flex-direction: column;
670 padding-bottom: 10px;
676 @mixin dropdown-with-icon-item {
680 @include margin-right(10px);
689 @mixin progressbar($small: false) {
690 background-color: $grey-background-color;
695 border-radius: 0.25rem;
700 color: $grey-foreground-color;
714 color: pvar(--mainBackgroundColor);
715 background-color: pvar(--mainColor);
717 flex-direction: column;
718 justify-content: center;
721 transition: width 0.6s ease;
724 background-color: pvar(--secondaryColor);
728 background-color: lighten($color: #c54130, $amount: 10);
736 padding: 0.75rem 1rem;
739 background-color: pvar(--submenuBackgroundColor);
740 border-radius: 0.25rem;
746 color: pvar(--mainColor);
750 @include padding-left(0.5rem);
753 @include padding-right(0.5rem);
755 display: inline-block;
773 box-sizing: border-box;
774 flex: 0 0 percentage(math.div(1, 3));
779 @include disable-default-a-behaviour;
781 text-decoration: none;
796 background: pvar(--submenuBackgroundColor);
798 box-sizing: border-box;
807 color: pvar(--mainForegroundColor);
814 color: pvar(--inputPlaceholderColor);
819 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
821 border-top: .05rem solid $color;
831 background: $background;
833 content: attr(data-content);
834 display: inline-block;
837 transform: translateY(-.65rem);
844 --chip-padding: .2rem .4rem;
845 $avatar-height: 1.2rem;
848 border-radius: var(--chip-radius);
849 display: inline-flex;
851 color: pvar(--mainForegroundColor);
852 height: $avatar-height;
857 padding: var(--chip-padding);
858 text-decoration: none;
859 text-overflow: ellipsis;
860 vertical-align: middle;
864 --chip-radius: .2rem;
865 --chip-padding: .2rem .3rem;
869 @include margin-left(-.4rem);
870 @include margin-right(.2rem);
874 $avatar-height: 2rem;
876 height: $avatar-height;
879 @include actor-avatar-size($avatar-height);
886 flex-direction: column;
887 height: $avatar-height;
888 justify-content: center;
893 // applies ratio (default to 16:9) to a child element (using $selector) only using
894 // an immediate's parent size. This allows to set a ratio without explicit
895 // dimensions, as width/height cannot be computed from each other.
896 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
897 $padding-percent: percentage($inverted-ratio);
902 padding-top: $padding-percent;
917 border-bottom: 2px solid $grey-background-color;
918 padding-bottom: 15px;
919 margin-bottom: $sub-menu-margin-bottom;
921 > span > my-global-icon,
923 @include margin-right(10px);
930 @include margin-left(7px);
936 @mixin play-icon ($width, $height) {
943 transform: translate(-50%, -50%) scale(0.5);
945 border-top: #{math.div($height, 2)} solid transparent;
946 border-bottom: #{math.div($height, 2)} solid transparent;
948 border-left: $width solid rgba(255, 255, 255, 0.95);
951 @mixin on-small-main-col () {
952 :host-context(.main-col:not(.expanded)) {
953 @media screen and (max-width: $small-view + $menu-width) {
958 :host-context(.main-col.expanded) {
959 @media screen and (max-width: $small-view) {
965 @mixin on-mobile-main-col () {
966 :host-context(.main-col:not(.expanded)) {
967 @media screen and (max-width: $mobile-view + $menu-width) {
972 :host-context(.main-col.expanded) {
973 @media screen and (max-width: $mobile-view) {
979 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
980 @include margin-left($inline-start);
981 @include margin-right($inline-end);
983 margin-top: $block-start;
984 margin-bottom: $block-end;
987 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
988 @include padding-left($inline-start);
989 @include padding-right($inline-end);
991 padding-top: $block-start;
992 padding-bottom: $block-end;
995 @mixin margin-left ($value) {
996 @supports (margin-inline-start: $value) {
997 margin-inline-start: $value;
1000 @supports not (margin-inline-start: $value) {
1001 margin-left: $value;
1005 @mixin margin-right ($value) {
1006 @supports (margin-inline-end: $value) {
1007 margin-inline-end: $value;
1010 @supports not (margin-inline-end: $value) {
1011 margin-right: $value;
1015 @mixin padding-left ($value) {
1016 @supports (padding-inline-start: $value) {
1017 padding-inline-start: $value;
1020 @supports not (padding-inline-start: $value) {
1021 padding-left: $value;
1025 @mixin padding-right ($value) {
1026 @supports (padding-inline-end: $value) {
1027 padding-inline-end: $value;
1030 @supports not (padding-inline-end: $value) {
1031 padding-right: $value;