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;
443 [type=radio]:checked + label::before,
444 [type=radio]:not(:checked) + label::before {
451 border: 1px solid #C6C6C6;
456 [type=radio]:checked + label::after,
457 [type=radio]:not(:checked) + label::after {
461 background: pvar(--mainColor);
466 transition: all 0.2s ease;
468 [type=radio]:not(:checked) + label::after {
472 [type=radio]:checked + label::after {
478 @mixin peertube-checkbox ($border-width) {
483 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
491 border: $border-width solid #C6C6C6;
493 vertical-align: middle;
499 top: calc(2px - #{$border-width});
504 transform: rotate(45deg) scale(0);
505 border-right: 2px solid $bg-color;
506 border-bottom: 2px solid $bg-color;
511 border-color: transparent;
512 background: pvar(--mainColor);
513 animation: jelly 0.6s ease;
517 transform: rotate(45deg) scale(1);
522 @include margin-left(5px);
525 font-weight: $font-regular;
531 &[disabled] + span + span {
539 padding: 1/4em 1/2em;
540 text-transform: uppercase;
541 font-weight: $font-bold;
543 letter-spacing: 1/3px;
547 background-color: #ffcdd2;
552 text-decoration: line-through;
556 background-color: #feedaf;
561 background-color: #ffd8b2;
566 background-color: #c8e6c9;
571 background-color: #b3e5fc;
576 background-color: #eccfff;
581 @mixin actor-avatar-size ($size) {
582 display: inline-block;
589 @mixin actor-counters ($separator-margin: 10px) {
590 color: pvar(--greyForegroundColor);
595 > *:not(:last-child)::after {
597 margin: 0 $separator-margin;
598 color: pvar(--mainColor);
602 @mixin chevron ($size, $border-width) {
604 border-width: $border-width $border-width 0 0;
606 display: inline-block;
607 transform: rotate(-45deg);
612 @mixin chevron-right ($size, $border-width) {
613 @include chevron($size, $border-width);
616 transform: rotate(45deg);
619 @mixin chevron-left ($size, $border-width) {
620 @include chevron($size, $border-width);
623 transform: rotate(-135deg);
626 @mixin in-content-small-title {
627 text-transform: uppercase;
628 color: pvar(--mainColor);
629 font-weight: $font-bold;
633 @mixin settings-big-title {
634 text-transform: uppercase;
635 color: pvar(--mainColor);
636 font-weight: $font-bold;
641 @mixin create-button {
642 @include peertube-button-link;
643 @include orange-button;
644 @include button-with-icon(20px, 5px, -1px);
647 @mixin row-blocks ($column-responsive: true) {
650 padding-bottom: 20px;
652 border-bottom: 1px solid #C6C6C6;
654 @media screen and (max-width: $small-view) {
655 @if $column-responsive {
656 flex-direction: column;
661 padding-bottom: 10px;
667 @mixin dropdown-with-icon-item {
671 @include margin-right(10px);
680 @mixin progressbar($small: false) {
681 background-color: $grey-background-color;
686 border-radius: 0.25rem;
691 color: $grey-foreground-color;
705 color: pvar(--mainBackgroundColor);
706 background-color: pvar(--mainColor);
708 flex-direction: column;
709 justify-content: center;
712 transition: width 0.6s ease;
715 background-color: pvar(--secondaryColor);
719 background-color: lighten($color: #c54130, $amount: 10);
727 padding: 0.75rem 1rem;
730 background-color: pvar(--submenuBackgroundColor);
731 border-radius: 0.25rem;
737 color: pvar(--mainColor);
741 @include padding-left(0.5rem);
744 @include padding-right(0.5rem);
746 display: inline-block;
764 box-sizing: border-box;
765 flex: 0 0 percentage(math.div(1, 3));
770 @include disable-default-a-behaviour;
772 text-decoration: none;
787 background: pvar(--submenuBackgroundColor);
789 box-sizing: border-box;
798 color: pvar(--mainForegroundColor);
805 color: pvar(--inputPlaceholderColor);
810 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
812 border-top: .05rem solid $color;
822 background: $background;
824 content: attr(data-content);
825 display: inline-block;
828 transform: translateY(-.65rem);
835 --chip-padding: .2rem .4rem;
836 $avatar-height: 1.2rem;
839 border-radius: var(--chip-radius);
840 display: inline-flex;
842 color: pvar(--mainForegroundColor);
843 height: $avatar-height;
848 padding: var(--chip-padding);
849 text-decoration: none;
850 text-overflow: ellipsis;
851 vertical-align: middle;
855 --chip-radius: .2rem;
856 --chip-padding: .2rem .3rem;
860 @include margin-left(-.4rem);
861 @include margin-right(.2rem);
865 $avatar-height: 2rem;
867 height: $avatar-height;
870 @include actor-avatar-size($avatar-height);
877 flex-direction: column;
878 height: $avatar-height;
879 justify-content: center;
884 // applies ratio (default to 16:9) to a child element (using $selector) only using
885 // an immediate's parent size. This allows to set a ratio without explicit
886 // dimensions, as width/height cannot be computed from each other.
887 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
888 $padding-percent: percentage($inverted-ratio);
893 padding-top: $padding-percent;
908 border-bottom: 2px solid $grey-background-color;
909 padding-bottom: 15px;
910 margin-bottom: $sub-menu-margin-bottom;
912 > span > my-global-icon,
914 @include margin-right(10px);
921 @include margin-left(7px);
927 @mixin play-icon ($width, $height) {
934 transform: translate(-50%, -50%) scale(0.5);
936 border-top: #{math.div($height, 2)} solid transparent;
937 border-bottom: #{math.div($height, 2)} solid transparent;
939 border-left: $width solid rgba(255, 255, 255, 0.95);
942 @mixin on-small-main-col () {
943 :host-context(.main-col:not(.expanded)) {
944 @media screen and (max-width: $small-view + $menu-width) {
949 :host-context(.main-col.expanded) {
950 @media screen and (max-width: $small-view) {
956 @mixin on-mobile-main-col () {
957 :host-context(.main-col:not(.expanded)) {
958 @media screen and (max-width: $mobile-view + $menu-width) {
963 :host-context(.main-col.expanded) {
964 @media screen and (max-width: $mobile-view) {
970 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
971 @include margin-left($inline-start);
972 @include margin-right($inline-end);
974 margin-top: $block-start;
975 margin-bottom: $block-end;
978 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
979 @include padding-left($inline-start);
980 @include padding-right($inline-end);
982 padding-top: $block-start;
983 padding-bottom: $block-end;
986 @mixin margin-left ($value) {
987 @supports (margin-inline-start: $value) {
988 margin-inline-start: $value;
991 @supports not (margin-inline-start: $value) {
996 @mixin margin-right ($value) {
997 @supports (margin-inline-end: $value) {
998 margin-inline-end: $value;
1001 @supports not (margin-inline-end: $value) {
1002 margin-right: $value;
1006 @mixin padding-left ($value) {
1007 @supports (padding-inline-start: $value) {
1008 padding-inline-start: $value;
1011 @supports not (padding-inline-start: $value) {
1012 padding-left: $value;
1016 @mixin padding-right ($value) {
1017 @supports (padding-inline-end: $value) {
1018 padding-inline-end: $value;
1021 @supports not (padding-inline-end: $value) {
1022 padding-right: $value;