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 -webkit-box-orient: vertical;
31 /* Fallback for non-webkit */
32 font-size: $font-size;
33 line-height: $font-size;
35 text-overflow: ellipsis;
36 max-height: $font-size * $number-of-lines;
40 color: pvar(--greyForegroundColor) !important;
43 @mixin fade-text ($fade-after, $background-color) {
55 background: linear-gradient(transparent $fade-after, $background-color);
59 @mixin peertube-word-wrap ($with-hyphen: true) {
60 word-break: break-word;
61 word-wrap: break-word;
62 overflow-wrap: break-word;
69 @mixin apply-svg-color ($color) {
77 @mixin fill-svg-color ($color) {
85 @mixin button-focus($color) {
88 box-shadow: #{$focus-box-shadow-form} $color;
92 @mixin peertube-input-text($width) {
94 display: inline-block;
95 height: $button-height;
98 color: pvar(--inputForegroundColor);
99 background-color: pvar(--inputBackgroundColor);
100 border: 1px solid pvar(--inputBorderColor);
102 font-size: $form-input-font-size;
103 line-height: $form-input-line-height;
106 color: pvar(--inputPlaceholderColor);
113 @media screen and (max-width: calc(#{$width} + 40px)) {
118 @mixin peertube-textarea ($width, $height) {
119 @include peertube-input-text($width);
121 color: pvar(--textareaForegroundColor) !important;
122 background-color: pvar(--textareaBackgroundColor) !important;
127 @mixin orange-button {
128 @include button-focus(pvar(--mainColorLightest));
134 background-color: pvar(--mainColor);
139 background-color: pvar(--mainHoverColor);
146 background-color: pvar(--inputBorderColor);
150 @include apply-svg-color(#fff);
154 @mixin orange-button-inverted {
155 @include button-focus(pvar(--mainColorLightest));
157 border: 2px solid pvar(--mainColor);
158 font-weight: $font-semibold;
163 color: pvar(--mainColor);
164 background-color: pvar(--mainBackgroundColor);
168 color: pvar(--mainColor);
169 background-color: pvar(--mainColorLightest);
175 color: pvar(--mainColor);
176 background-color: pvar(--inputBorderColor);
180 @include apply-svg-color(pvar(--mainColor));
184 @mixin tertiary-button {
185 @include button-focus($grey-button-outline-color);
187 color: pvar(--greyForegroundColor);
188 background-color: transparent;
196 @include apply-svg-color(transparent);
201 @include button-focus($grey-button-outline-color);
203 background-color: pvar(--greyBackgroundColor);
204 color: pvar(--greyForegroundColor);
211 color: pvar(--greyForegroundColor);
212 background-color: pvar(--greySecondaryBackgroundColor);
221 @include apply-svg-color(pvar(--greyForegroundColor));
225 @mixin danger-button {
226 $color: lighten($color: #c54130, $amount: 10);
229 @include button-focus(scale-color($color, $alpha: -95%));
231 background-color: $color;
239 background-color: lighten($color: $color, $amount: 10);
248 @include apply-svg-color($text);
252 @mixin peertube-button {
256 font-weight: $font-semibold;
257 height: $button-height;
258 line-height: $button-height;
260 // Because of primeng that redefines border-radius of all input[type="..."]
261 border-radius: 3px !important;
266 font-size: $button-font-size;
269 @include margin-right(4px);
273 @mixin peertube-button-big {
279 font-weight: $font-semibold;
281 // Because of primeng that redefines border-radius of all input[type="..."]
282 border-radius: 3px !important;
285 @mixin peertube-button-link {
286 @include disable-default-a-behaviour;
287 @include peertube-button;
289 display: inline-block;
292 @mixin peertube-button-big-link {
293 @include disable-default-a-behaviour;
294 @include peertube-button-big;
296 display: inline-block;
299 @mixin peertube-button-outline {
300 @include disable-default-a-behaviour;
301 @include peertube-button;
303 display: inline-block;
307 @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
309 @include margin-right($margin-right);
317 @mixin peertube-file {
320 display: inline-block;
331 filter: alpha(opacity=0);
340 @mixin peertube-button-file ($width) {
341 @include peertube-file;
342 @include peertube-button;
347 @mixin icon ($size) {
348 display: inline-block;
349 background-repeat: no-repeat;
350 background-size: contain;
353 vertical-align: middle;
357 @mixin responsive-width ($width) {
360 @media screen and (max-width: $width) {
365 @mixin peertube-select-container ($width) {
370 color: pvar(--inputForegroundColor);
371 background: pvar(--inputBackgroundColor);
376 background-color: #E5E5E5;
384 background-color: #f9f9f9;
387 @media screen and (max-width: $width) {
393 right: calc(0% + 15px);
398 pointer-events: none;
399 border: 5px solid rgba(0, 0, 0, 0);
400 border-top-color: #000;
406 padding: 0 35px 0 12px;
408 border: 1px solid pvar(--inputBorderColor);
409 background: transparent none;
411 height: $button-height;
412 text-overflow: ellipsis;
413 color: pvar(--mainForegroundColor);
414 font-size: $form-input-font-size;
415 line-height: $form-input-line-height;
423 text-shadow: 0 0 0 #000;
430 font-weight: $font-semibold;
435 &.peertube-select-button {
436 @include grey-button;
439 font-weight: $font-semibold;
440 color: pvar(--greyForegroundColor);
446 // Thanks: https://codepen.io/manabox/pen/raQmpL
447 @mixin peertube-radio-container {
449 font-size: $form-input-font-size;
452 [type=radio]:checked,
453 [type=radio]:not(:checked) {
461 [type=radio]:checked + label,
462 [type=radio]:not(:checked) + label {
467 display: inline-block;
468 font-weight: $font-regular;
471 [type=radio]:checked + label::before,
472 [type=radio]:not(:checked) + label::before {
479 border: 1px solid pvar(--inputBorderColor);
484 [type=radio]:checked + label::after,
485 [type=radio]:not(:checked) + label::after {
489 background: pvar(--mainColor);
494 transition: all 0.2s ease;
496 [type=radio]:not(:checked) + label::after {
500 [type=radio]:checked + label::after {
505 .form-group-description {
513 @mixin peertube-checkbox ($border-width) {
518 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
526 border: $border-width solid pvar(--inputBorderColor);
528 vertical-align: middle;
534 top: calc(2px - #{$border-width});
539 transform: rotate(45deg) scale(0);
540 border-right: 2px solid $bg-color;
541 border-bottom: 2px solid $bg-color;
546 border-color: transparent;
547 background: pvar(--mainColor);
548 animation: jelly 0.6s ease;
552 transform: rotate(45deg) scale(1);
557 @include margin-left(5px);
559 font-weight: $font-regular;
565 &[disabled] + span + span {
571 @mixin actor-avatar-size ($size) {
572 display: inline-block;
579 @mixin actor-counters ($separator-margin: 10px) {
580 color: pvar(--greyForegroundColor);
584 > *:not(:last-child)::after {
586 margin: 0 $separator-margin;
587 color: pvar(--mainColor);
591 @mixin in-content-small-title {
592 text-transform: uppercase;
593 color: pvar(--mainColor);
594 font-weight: $font-bold;
598 @mixin settings-big-title {
599 text-transform: uppercase;
600 color: pvar(--mainColor);
601 font-weight: $font-bold;
606 @mixin create-button {
607 @include peertube-button-link;
608 @include orange-button;
609 @include button-with-icon(20px, 5px, -1px);
612 @mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
614 min-height: $min-height;
615 padding-bottom: 20px;
619 border-bottom: 1px solid pvar(--inputBorderColor);
622 @media screen and (max-width: $small-view) {
623 @if $column-responsive {
624 flex-direction: column;
629 padding-bottom: 10px;
635 @mixin dropdown-with-icon-item {
639 @include margin-right(10px);
648 @mixin progressbar($small: false) {
649 background-color: $grey-background-color;
654 border-radius: 0.25rem;
659 color: $grey-foreground-color;
674 color: pvar(--mainBackgroundColor);
675 background-color: pvar(--mainColor);
677 flex-direction: column;
678 justify-content: center;
681 transition: width 0.6s ease;
684 background-color: lighten($color: #c54130, $amount: 10);
695 font-weight: $font-semibold;
701 color: pvar(--mainColor);
705 @include padding-left(0.5rem);
708 @include padding-right(0.5rem);
710 display: inline-block;
728 box-sizing: border-box;
729 flex: 0 0 percentage(math.div(1, 3));
734 @include disable-default-a-behaviour;
736 text-decoration: none;
751 background: pvar(--submenuBackgroundColor);
753 box-sizing: border-box;
762 color: pvar(--mainForegroundColor);
769 color: pvar(--inputPlaceholderColor);
774 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
776 border-top: .05rem solid $color;
786 background: $background;
788 content: attr(data-content);
789 display: inline-block;
792 transform: translateY(-.65rem);
798 --avatar-size: 1.2rem;
800 display: inline-flex;
801 color: pvar(--mainForegroundColor);
802 height: var(--avatar-size);
805 text-decoration: none;
806 text-overflow: ellipsis;
807 vertical-align: middle;
811 @include margin-right(.2rem);
814 width: var(--avatar-size);
815 height: var(--avatar-size);
825 display: inline-block;
830 flex-direction: column;
831 justify-content: center;
836 // applies ratio (default to 16:9) to a child element (using $selector) only using
837 // an immediate's parent size. This allows to set a ratio without explicit
838 // dimensions, as width/height cannot be computed from each other.
839 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
840 $padding-percent: percentage($inverted-ratio);
845 padding-top: $padding-percent;
860 border-bottom: 2px solid $grey-background-color;
861 padding-bottom: 15px;
862 margin-bottom: $sub-menu-margin-bottom;
864 > span > my-global-icon,
866 @include margin-right(10px);
873 @include margin-left(7px);
880 @mixin play-icon ($width, $height) {
887 transform: translate(-50%, -50%) scale(0.5);
889 border-top: #{math.div($height, 2)} solid transparent;
890 border-bottom: #{math.div($height, 2)} solid transparent;
892 border-left: $width solid rgba(255, 255, 255, 0.95);
895 @mixin on-small-main-col () {
896 :host-context(.main-col:not(.expanded)) {
897 @media screen and (max-width: $small-view + $menu-width) {
902 :host-context(.main-col.expanded) {
903 @media screen and (max-width: $small-view) {
909 @mixin on-mobile-main-col () {
910 :host-context(.main-col:not(.expanded)) {
911 @media screen and (max-width: $mobile-view + $menu-width) {
916 :host-context(.main-col.expanded) {
917 @media screen and (max-width: $mobile-view) {
923 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
924 @include margin-left($inline-start);
925 @include margin-right($inline-end);
927 margin-top: $block-start;
928 margin-bottom: $block-end;
931 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
932 @include padding-left($inline-start);
933 @include padding-right($inline-end);
935 padding-top: $block-start;
936 padding-bottom: $block-end;
939 @mixin margin-left ($value) {
940 @supports (margin-inline-start: $value) {
941 margin-inline-start: $value;
944 @supports not (margin-inline-start: $value) {
949 @mixin margin-right ($value) {
950 @supports (margin-inline-end: $value) {
951 margin-inline-end: $value;
954 @supports not (margin-inline-end: $value) {
955 margin-right: $value;
959 @mixin padding-left ($value) {
960 @supports (padding-inline-start: $value) {
961 padding-inline-start: $value;
964 @supports not (padding-inline-start: $value) {
965 padding-left: $value;
969 @mixin padding-right ($value) {
970 @supports (padding-inline-end: $value) {
971 padding-inline-end: $value;
974 @supports not (padding-inline-end: $value) {
975 padding-right: $value;