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/triss90/pen/XNEdRe/
424 @mixin peertube-radio-container {
429 font-weight: $font-regular;
433 @include margin-right(10px);
440 border: 1px solid #000;
441 display: inline-block;
444 vertical-align: middle;
450 &:checked + label::before {
451 background-color: #000;
452 box-shadow: inset 0 0 0 4px #fff;
455 &:focus + label::before {
462 @mixin peertube-checkbox ($border-width) {
467 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
475 border: $border-width solid #C6C6C6;
477 vertical-align: middle;
483 top: calc(2px - #{$border-width});
488 transform: rotate(45deg) scale(0);
489 border-right: 2px solid $bg-color;
490 border-bottom: 2px solid $bg-color;
495 border-color: transparent;
496 background: pvar(--mainColor);
497 animation: jelly 0.6s ease;
501 transform: rotate(45deg) scale(1);
506 @include margin-left(5px);
509 font-weight: $font-regular;
515 &[disabled] + span + span {
523 padding: 1/4em 1/2em;
524 text-transform: uppercase;
525 font-weight: $font-bold;
527 letter-spacing: 1/3px;
531 background-color: #ffcdd2;
536 text-decoration: line-through;
540 background-color: #feedaf;
545 background-color: #ffd8b2;
550 background-color: #c8e6c9;
555 background-color: #b3e5fc;
560 background-color: #eccfff;
565 @mixin actor-avatar-size ($size) {
566 display: inline-block;
573 @mixin actor-counters ($separator-margin: 10px) {
574 color: pvar(--greyForegroundColor);
579 > *:not(:last-child)::after {
581 margin: 0 $separator-margin;
582 color: pvar(--mainColor);
586 @mixin chevron ($size, $border-width) {
588 border-width: $border-width $border-width 0 0;
590 display: inline-block;
591 transform: rotate(-45deg);
596 @mixin chevron-right ($size, $border-width) {
597 @include chevron($size, $border-width);
600 transform: rotate(45deg);
603 @mixin chevron-left ($size, $border-width) {
604 @include chevron($size, $border-width);
607 transform: rotate(-135deg);
610 @mixin in-content-small-title {
611 text-transform: uppercase;
612 color: pvar(--mainColor);
613 font-weight: $font-bold;
617 @mixin settings-big-title {
618 text-transform: uppercase;
619 color: pvar(--mainColor);
620 font-weight: $font-bold;
625 @mixin create-button {
626 @include peertube-button-link;
627 @include orange-button;
628 @include button-with-icon(20px, 5px, -1px);
631 @mixin row-blocks ($column-responsive: true) {
634 padding-bottom: 20px;
636 border-bottom: 1px solid #C6C6C6;
638 @media screen and (max-width: $small-view) {
639 @if $column-responsive {
640 flex-direction: column;
645 padding-bottom: 10px;
651 @mixin dropdown-with-icon-item {
655 @include margin-right(10px);
664 @mixin progressbar($small: false) {
665 background-color: $grey-background-color;
670 border-radius: 0.25rem;
675 color: $grey-foreground-color;
689 color: pvar(--mainBackgroundColor);
690 background-color: pvar(--mainColor);
692 flex-direction: column;
693 justify-content: center;
696 transition: width 0.6s ease;
699 background-color: pvar(--secondaryColor);
703 background-color: lighten($color: #c54130, $amount: 10);
711 padding: 0.75rem 1rem;
714 background-color: pvar(--submenuBackgroundColor);
715 border-radius: 0.25rem;
721 color: pvar(--mainColor);
725 @include padding-left(0.5rem);
728 @include padding-right(0.5rem);
730 display: inline-block;
748 box-sizing: border-box;
749 flex: 0 0 percentage(math.div(1, 3));
754 @include disable-default-a-behaviour;
756 text-decoration: none;
771 background: pvar(--submenuBackgroundColor);
773 box-sizing: border-box;
782 color: pvar(--mainForegroundColor);
789 color: pvar(--inputPlaceholderColor);
794 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
796 border-top: .05rem solid $color;
806 background: $background;
808 content: attr(data-content);
809 display: inline-block;
812 transform: translateY(-.65rem);
819 --chip-padding: .2rem .4rem;
820 $avatar-height: 1.2rem;
823 border-radius: var(--chip-radius);
824 display: inline-flex;
826 color: pvar(--mainForegroundColor);
827 height: $avatar-height;
832 padding: var(--chip-padding);
833 text-decoration: none;
834 text-overflow: ellipsis;
835 vertical-align: middle;
839 --chip-radius: .2rem;
840 --chip-padding: .2rem .3rem;
844 @include margin-left(-.4rem);
845 @include margin-right(.2rem);
849 $avatar-height: 2rem;
851 height: $avatar-height;
854 @include actor-avatar-size($avatar-height);
861 flex-direction: column;
862 height: $avatar-height;
863 justify-content: center;
868 // applies ratio (default to 16:9) to a child element (using $selector) only using
869 // an immediate's parent size. This allows to set a ratio without explicit
870 // dimensions, as width/height cannot be computed from each other.
871 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
872 $padding-percent: percentage($inverted-ratio);
877 padding-top: $padding-percent;
892 border-bottom: 2px solid $grey-background-color;
893 padding-bottom: 15px;
894 margin-bottom: $sub-menu-margin-bottom;
896 > span > my-global-icon,
898 @include margin-right(10px);
905 @include margin-left(7px);
911 @mixin play-icon ($width, $height) {
918 transform: translate(-50%, -50%) scale(0.5);
920 border-top: #{math.div($height, 2)} solid transparent;
921 border-bottom: #{math.div($height, 2)} solid transparent;
923 border-left: $width solid rgba(255, 255, 255, 0.95);
926 @mixin on-small-main-col () {
927 :host-context(.main-col:not(.expanded)) {
928 @media screen and (max-width: $small-view + $menu-width) {
933 :host-context(.main-col.expanded) {
934 @media screen and (max-width: $small-view) {
940 @mixin on-mobile-main-col () {
941 :host-context(.main-col:not(.expanded)) {
942 @media screen and (max-width: $mobile-view + $menu-width) {
947 :host-context(.main-col.expanded) {
948 @media screen and (max-width: $mobile-view) {
954 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
955 @include margin-left($inline-start);
956 @include margin-right($inline-end);
958 margin-top: $block-start;
959 margin-bottom: $block-end;
962 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
963 @include padding-left($inline-start);
964 @include padding-right($inline-end);
966 padding-top: $block-start;
967 padding-bottom: $block-end;
970 @mixin margin-left ($value) {
971 @supports (margin-inline-start: $value) {
972 margin-inline-start: $value;
975 @supports not (margin-inline-start: $value) {
980 @mixin margin-right ($value) {
981 @supports (margin-inline-end: $value) {
982 margin-inline-end: $value;
985 @supports not (margin-inline-end: $value) {
986 margin-right: $value;
990 @mixin padding-left ($value) {
991 @supports (padding-inline-start: $value) {
992 padding-inline-start: $value;
995 @supports not (padding-inline-start: $value) {
996 padding-left: $value;
1000 @mixin padding-right ($value) {
1001 @supports (padding-inline-end: $value) {
1002 padding-inline-end: $value;
1005 @supports not (padding-inline-end: $value) {
1006 padding-right: $value;