3 @mixin disable-default-a-behaviour {
7 text-decoration: none !important;
8 outline: none !important;
12 @mixin disable-outline {
13 &:focus:not(.focus-visible) {
21 text-overflow: ellipsis;
24 @mixin ellipsis-multiline($font-size: 16px, $number-of-lines: 2) {
26 /* Fallback for non-webkit */
27 display: -webkit-box; /* stylelint-disable-line value-no-vendor-prefix */
28 -webkit-line-clamp: $number-of-lines;
29 /* Fallback for non-webkit */
30 font-size: $font-size;
31 line-height: $font-size;
33 text-overflow: ellipsis;
34 max-height: $font-size * $number-of-lines;
37 @mixin fade-text ($fade-after, $background-color) {
49 background: linear-gradient(transparent $fade-after, $background-color);
53 @mixin peertube-word-wrap ($with-hyphen: true) {
54 word-break: break-word;
55 word-wrap: break-word;
56 overflow-wrap: break-word;
63 @mixin apply-svg-color ($color) {
71 @mixin fill-svg-color ($color) {
79 @mixin button-focus($color) {
82 box-shadow: #{$focus-box-shadow-form} $color;
86 @mixin peertube-input-text($width) {
88 display: inline-block;
89 height: $button-height;
91 color: pvar(--inputForegroundColor);
92 background-color: pvar(--inputBackgroundColor);
93 border: 1px solid #C6C6C6;
98 color: pvar(--inputPlaceholderColor);
105 @media screen and (max-width: $width) {
110 @mixin peertube-input-group($width) {
112 min-height: $button-height;
123 @mixin peertube-textarea ($width, $height) {
124 @include peertube-input-text($width);
126 color: pvar(--textareaForegroundColor);
127 background-color: pvar(--textareaBackgroundColor);
133 @mixin orange-button {
134 @include button-focus(pvar(--mainColorLightest));
140 background-color: pvar(--mainColor);
145 background-color: pvar(--mainHoverColor);
152 background-color: #C6C6C6;
156 @include apply-svg-color(#fff);
160 @mixin orange-button-inverted {
161 @include button-focus(pvar(--mainColorLightest));
163 border: 2px solid pvar(--mainColor);
164 font-weight: $font-semibold;
169 color: pvar(--mainColor);
170 background-color: pvar(--mainBackgroundColor);
174 color: pvar(--mainColor);
175 background-color: pvar(--mainColorLightest);
181 color: pvar(--mainColor);
182 background-color: #C6C6C6;
186 @include apply-svg-color(pvar(--mainColor));
190 @mixin tertiary-button {
191 @include button-focus($grey-button-outline-color);
193 color: pvar(--greyForegroundColor);
194 background-color: transparent;
202 @include apply-svg-color(transparent);
207 @include button-focus($grey-button-outline-color);
209 background-color: $grey-background-color;
210 color: pvar(--greyForegroundColor);
217 color: pvar(--greyForegroundColor);
218 background-color: $grey-background-hover-color;
227 @include apply-svg-color(pvar(--greyForegroundColor));
231 @mixin danger-button {
232 $color: lighten($color: #c54130, $amount: 10);
235 @include button-focus(scale-color($color, $alpha: -95%));
237 background-color: $color;
245 background-color: lighten($color: $color, $amount: 10);
254 @include apply-svg-color($text);
258 @mixin peertube-button {
259 @include padding(0, 17px, 0, 13px);
262 font-weight: $font-semibold;
264 height: $button-height;
265 line-height: $button-height;
266 // FIXME: because of primeng that redefines border-radius of all input[type="..."]
267 border-radius: 3px !important;
272 @mixin peertube-button-link {
273 @include disable-default-a-behaviour;
274 @include peertube-button;
276 display: inline-block;
279 @mixin peertube-button-outline {
280 @include disable-default-a-behaviour;
281 @include peertube-button;
283 display: inline-block;
287 @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
288 display: inline-flex;
290 line-height: normal !important;
293 @include margin-right($margin-right);
301 @mixin peertube-file {
304 display: inline-block;
315 filter: alpha(opacity=0);
324 @mixin peertube-button-file ($width) {
325 @include peertube-file;
326 @include peertube-button;
331 @mixin icon ($size) {
332 display: inline-block;
333 background-repeat: no-repeat;
334 background-size: contain;
337 vertical-align: middle;
341 @mixin responsive-width ($width) {
344 @media screen and (max-width: $width) {
349 @mixin peertube-select-container ($width) {
354 color: pvar(--inputForegroundColor);
355 background: pvar(--inputBackgroundColor);
360 background-color: #E5E5E5;
367 @media screen and (max-width: $width) {
373 right: calc(0% + 15px);
378 pointer-events: none;
379 border: 5px solid rgba(0, 0, 0, 0);
380 border-top-color: #000;
386 padding: 0 35px 0 12px;
388 border: 1px solid #C6C6C6;
389 background: transparent none;
392 height: $button-height;
393 text-overflow: ellipsis;
394 color: pvar(--mainForegroundColor);
402 text-shadow: 0 0 0 #000;
410 &.peertube-select-button {
411 @include grey-button;
415 font-weight: $font-semibold;
416 color: pvar(--greyForegroundColor);
422 // Thanks: https://codepen.io/triss90/pen/XNEdRe/
423 @mixin peertube-radio-container {
428 font-weight: $font-regular;
432 @include margin-right(10px);
439 border: 1px solid #000;
440 display: inline-block;
443 vertical-align: middle;
449 &:checked + label::before {
450 background-color: #000;
451 box-shadow: inset 0 0 0 4px #fff;
454 &:focus + label::before {
461 @mixin peertube-checkbox ($border-width) {
466 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
474 border: $border-width solid #C6C6C6;
476 vertical-align: middle;
482 top: calc(2px - #{$border-width});
487 transform: rotate(45deg) scale(0);
488 border-right: 2px solid $bg-color;
489 border-bottom: 2px solid $bg-color;
494 border-color: transparent;
495 background: pvar(--mainColor);
496 animation: jelly 0.6s ease;
500 transform: rotate(45deg) scale(1);
505 @include margin-left(5px);
508 font-weight: $font-regular;
514 &[disabled] + span + span {
522 padding: 1/4em 1/2em;
523 text-transform: uppercase;
524 font-weight: $font-bold;
526 letter-spacing: 1/3px;
530 background-color: #ffcdd2;
535 text-decoration: line-through;
539 background-color: #feedaf;
544 background-color: #ffd8b2;
549 background-color: #c8e6c9;
554 background-color: #b3e5fc;
559 background-color: #eccfff;
564 @mixin actor-avatar-size ($size) {
565 display: inline-block;
572 @mixin actor-counters ($separator-margin: 10px) {
573 color: pvar(--greyForegroundColor);
578 > *:not(:last-child)::after {
580 margin: 0 $separator-margin;
581 color: pvar(--mainColor);
585 @mixin chevron ($size, $border-width) {
587 border-width: $border-width $border-width 0 0;
589 display: inline-block;
590 transform: rotate(-45deg);
595 @mixin chevron-right ($size, $border-width) {
596 @include chevron($size, $border-width);
599 transform: rotate(45deg);
602 @mixin chevron-left ($size, $border-width) {
603 @include chevron($size, $border-width);
606 transform: rotate(-135deg);
609 @mixin in-content-small-title {
610 text-transform: uppercase;
611 color: pvar(--mainColor);
612 font-weight: $font-bold;
616 @mixin settings-big-title {
617 text-transform: uppercase;
618 color: pvar(--mainColor);
619 font-weight: $font-bold;
624 @mixin create-button {
625 @include peertube-button-link;
626 @include orange-button;
627 @include button-with-icon(20px, 5px, -1px);
630 @mixin row-blocks ($column-responsive: true) {
633 padding-bottom: 20px;
635 border-bottom: 1px solid #C6C6C6;
637 @media screen and (max-width: $small-view) {
638 @if $column-responsive {
639 flex-direction: column;
644 padding-bottom: 10px;
650 @mixin dropdown-with-icon-item {
654 @include margin-right(10px);
663 @mixin progressbar($small: false) {
664 background-color: $grey-background-color;
669 border-radius: 0.25rem;
674 color: $grey-foreground-color;
688 color: pvar(--mainBackgroundColor);
689 background-color: pvar(--mainColor);
691 flex-direction: column;
692 justify-content: center;
695 transition: width 0.6s ease;
698 background-color: pvar(--secondaryColor);
702 background-color: lighten($color: #c54130, $amount: 10);
710 padding: 0.75rem 1rem;
713 background-color: pvar(--submenuBackgroundColor);
714 border-radius: 0.25rem;
720 color: pvar(--mainColor);
724 @include padding-left(0.5rem);
727 @include padding-right(0.5rem);
729 display: inline-block;
747 box-sizing: border-box;
748 flex: 0 0 percentage(1/3);
753 @include disable-default-a-behaviour;
755 text-decoration: none;
770 background: pvar(--submenuBackgroundColor);
772 box-sizing: border-box;
781 color: pvar(--mainForegroundColor);
788 color: pvar(--inputPlaceholderColor);
793 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
795 border-top: .05rem solid $color;
805 background: $background;
807 content: attr(data-content);
808 display: inline-block;
811 transform: translateY(-.65rem);
818 --chip-padding: .2rem .4rem;
819 $avatar-height: 1.2rem;
822 border-radius: var(--chip-radius);
823 display: inline-flex;
825 color: pvar(--mainForegroundColor);
826 height: $avatar-height;
831 padding: var(--chip-padding);
832 text-decoration: none;
833 text-overflow: ellipsis;
834 vertical-align: middle;
838 --chip-radius: .2rem;
839 --chip-padding: .2rem .3rem;
843 @include margin-left(-.4rem);
844 @include margin-right(.2rem);
848 $avatar-height: 2rem;
850 height: $avatar-height;
853 @include actor-avatar-size($avatar-height);
860 flex-direction: column;
861 height: $avatar-height;
862 justify-content: center;
867 // applies ratio (default to 16:9) to a child element (using $selector) only using
868 // an immediate's parent size. This allows to set a ratio without explicit
869 // dimensions, as width/height cannot be computed from each other.
870 @mixin block-ratio ($selector: 'div', $inverted-ratio: 9/16) {
871 $padding-percent: percentage($inverted-ratio);
876 padding-top: $padding-percent;
890 border-bottom: 2px solid $grey-background-color;
891 padding-bottom: 15px;
892 margin-bottom: $sub-menu-margin-bottom;
894 > span > my-global-icon,
896 @include margin-right(10px);
903 @include margin-left(7px);
909 @mixin play-icon ($width, $height) {
916 transform: translate(-50%, -50%) scale(0.5);
918 border-top: ($height / 2) solid transparent;
919 border-bottom: ($height / 2) solid transparent;
921 border-left: $width solid rgba(255, 255, 255, 0.95);
924 @mixin on-small-main-col () {
925 :host-context(.main-col:not(.expanded)) {
926 @media screen and (max-width: $small-view + $menu-width) {
931 :host-context(.main-col.expanded) {
932 @media screen and (max-width: $small-view) {
938 @mixin on-mobile-main-col () {
939 :host-context(.main-col:not(.expanded)) {
940 @media screen and (max-width: $mobile-view + $menu-width) {
945 :host-context(.main-col.expanded) {
946 @media screen and (max-width: $mobile-view) {
952 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
953 @include margin-left($inline-start);
954 @include margin-right($inline-end);
956 margin-top: $block-start;
957 margin-bottom: $block-end;
960 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
961 @include padding-left($inline-start);
962 @include padding-right($inline-end);
964 padding-top: $block-start;
965 padding-bottom: $block-end;
968 @mixin margin-left ($value) {
969 @supports (margin-inline-start: $value) {
970 margin-inline-start: $value;
973 @supports not (margin-inline-start: $value) {
978 @mixin margin-right ($value) {
979 @supports (margin-inline-end: $value) {
980 margin-inline-end: $value;
983 @supports not (margin-inline-end: $value) {
984 margin-right: $value;
988 @mixin padding-left ($value) {
989 @supports (padding-inline-start: $value) {
990 padding-inline-start: $value;
993 @supports not (padding-inline-start: $value) {
994 padding-left: $value;
998 @mixin padding-right ($value) {
999 @supports (padding-inline-end: $value) {
1000 padding-inline-end: $value;
1003 @supports not (padding-inline-end: $value) {
1004 padding-right: $value;