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 $input-border-color;
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) !important;
128 background-color: pvar(--textareaBackgroundColor) !important;
134 @mixin orange-button {
135 @include button-focus(pvar(--mainColorLightest));
141 background-color: pvar(--mainColor);
146 background-color: pvar(--mainHoverColor);
153 background-color: $input-border-color;
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: $input-border-color;
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: pvar(--greyBackgroundColor);
211 color: pvar(--greyForegroundColor);
218 color: pvar(--greyForegroundColor);
219 background-color: pvar(--greySecondaryBackgroundColor);
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 {
263 font-weight: $font-semibold;
265 height: $button-height;
266 line-height: $button-height;
268 // Because of primeng that redefines border-radius of all input[type="..."]
269 border-radius: 3px !important;
275 @include margin-right(4px);
279 @mixin peertube-button-link {
280 @include disable-default-a-behaviour;
281 @include peertube-button;
283 display: inline-block;
286 @mixin peertube-button-outline {
287 @include disable-default-a-behaviour;
288 @include peertube-button;
290 display: inline-block;
294 @mixin button-with-icon($width: 20px, $margin-right: 3px, $top: -1px) {
295 display: inline-flex;
297 line-height: normal !important;
300 @include margin-right($margin-right);
308 @mixin peertube-file {
311 display: inline-block;
322 filter: alpha(opacity=0);
331 @mixin peertube-button-file ($width) {
332 @include peertube-file;
333 @include peertube-button;
338 @mixin icon ($size) {
339 display: inline-block;
340 background-repeat: no-repeat;
341 background-size: contain;
344 vertical-align: middle;
348 @mixin responsive-width ($width) {
351 @media screen and (max-width: $width) {
356 @mixin peertube-select-container ($width) {
361 color: pvar(--inputForegroundColor);
362 background: pvar(--inputBackgroundColor);
368 background-color: #E5E5E5;
375 background-color: #f9f9f9;
378 @media screen and (max-width: $width) {
384 right: calc(0% + 15px);
389 pointer-events: none;
390 border: 5px solid rgba(0, 0, 0, 0);
391 border-top-color: #000;
397 padding: 0 35px 0 12px;
399 border: 1px solid $input-border-color;
400 background: transparent none;
402 height: $button-height;
403 text-overflow: ellipsis;
404 color: pvar(--mainForegroundColor);
412 text-shadow: 0 0 0 #000;
419 font-weight: $font-semibold;
424 &.peertube-select-button {
425 @include grey-button;
428 font-weight: $font-semibold;
429 color: pvar(--greyForegroundColor);
435 // Thanks: https://codepen.io/manabox/pen/raQmpL
436 @mixin peertube-radio-container {
437 [type=radio]:checked,
438 [type=radio]:not(:checked) {
443 [type=radio]:checked + label,
444 [type=radio]:not(:checked) + label {
449 display: inline-block;
451 font-weight: $font-regular;
454 [type=radio]:checked + label::before,
455 [type=radio]:not(:checked) + label::before {
462 border: 1px solid $input-border-color;
467 [type=radio]:checked + label::after,
468 [type=radio]:not(:checked) + label::after {
472 background: pvar(--mainColor);
477 transition: all 0.2s ease;
479 [type=radio]:not(:checked) + label::after {
483 [type=radio]:checked + label::after {
488 .form-group-description {
496 @mixin peertube-checkbox ($border-width) {
501 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
509 border: $border-width solid $input-border-color;
511 vertical-align: middle;
517 top: calc(2px - #{$border-width});
522 transform: rotate(45deg) scale(0);
523 border-right: 2px solid $bg-color;
524 border-bottom: 2px solid $bg-color;
529 border-color: transparent;
530 background: pvar(--mainColor);
531 animation: jelly 0.6s ease;
535 transform: rotate(45deg) scale(1);
540 @include margin-left(5px);
543 font-weight: $font-regular;
549 &[disabled] + span + span {
555 @mixin peertube-badge {
557 padding: 1/4em 1/2em;
558 text-transform: uppercase;
559 font-weight: $font-bold;
561 letter-spacing: 1/3px;
565 background-color: #ffcdd2;
570 text-decoration: line-through;
574 background-color: #feedaf;
579 background-color: #ffd8b2;
584 background-color: #c8e6c9;
589 background-color: #b3e5fc;
594 background-color: #eccfff;
599 @mixin actor-avatar-size ($size) {
600 display: inline-block;
607 @mixin actor-counters ($separator-margin: 10px) {
608 color: pvar(--greyForegroundColor);
613 > *:not(:last-child)::after {
615 margin: 0 $separator-margin;
616 color: pvar(--mainColor);
620 @mixin chevron ($size, $border-width) {
622 border-width: $border-width $border-width 0 0;
624 display: inline-block;
625 transform: rotate(-45deg);
630 @mixin chevron-right ($size, $border-width) {
631 @include chevron($size, $border-width);
634 transform: rotate(45deg);
637 @mixin chevron-left ($size, $border-width) {
638 @include chevron($size, $border-width);
641 transform: rotate(-135deg);
644 @mixin in-content-small-title {
645 text-transform: uppercase;
646 color: pvar(--mainColor);
647 font-weight: $font-bold;
651 @mixin settings-big-title {
652 text-transform: uppercase;
653 color: pvar(--mainColor);
654 font-weight: $font-bold;
659 @mixin create-button {
660 @include peertube-button-link;
661 @include orange-button;
662 @include button-with-icon(20px, 5px, -1px);
665 @mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
667 min-height: $min-height;
668 padding-bottom: 20px;
672 border-bottom: 1px solid $input-border-color;
675 @media screen and (max-width: $small-view) {
676 @if $column-responsive {
677 flex-direction: column;
682 padding-bottom: 10px;
688 @mixin dropdown-with-icon-item {
692 @include margin-right(10px);
701 @mixin progressbar($small: false) {
702 background-color: $grey-background-color;
707 border-radius: 0.25rem;
712 color: $grey-foreground-color;
727 color: pvar(--mainBackgroundColor);
728 background-color: pvar(--mainColor);
730 flex-direction: column;
731 justify-content: center;
734 transition: width 0.6s ease;
737 background-color: pvar(--secondaryColor);
741 background-color: lighten($color: #c54130, $amount: 10);
749 padding: 0.75rem 1rem;
752 background-color: pvar(--submenuBackgroundColor);
753 border-radius: 0.25rem;
759 color: pvar(--mainColor);
763 @include padding-left(0.5rem);
766 @include padding-right(0.5rem);
768 display: inline-block;
786 box-sizing: border-box;
787 flex: 0 0 percentage(math.div(1, 3));
792 @include disable-default-a-behaviour;
794 text-decoration: none;
809 background: pvar(--submenuBackgroundColor);
811 box-sizing: border-box;
820 color: pvar(--mainForegroundColor);
827 color: pvar(--inputPlaceholderColor);
832 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
834 border-top: .05rem solid $color;
844 background: $background;
846 content: attr(data-content);
847 display: inline-block;
850 transform: translateY(-.65rem);
857 --chip-padding: .2rem .4rem;
858 $avatar-height: 1.2rem;
861 border-radius: var(--chip-radius);
862 display: inline-flex;
864 color: pvar(--mainForegroundColor);
865 height: $avatar-height;
870 padding: var(--chip-padding);
871 text-decoration: none;
872 text-overflow: ellipsis;
873 vertical-align: middle;
877 --chip-radius: .2rem;
878 --chip-padding: .2rem .3rem;
882 @include margin-left(-.4rem);
883 @include margin-right(.2rem);
887 $avatar-height: 2rem;
889 height: $avatar-height;
892 display: inline-block;
899 flex-direction: column;
900 height: $avatar-height;
901 justify-content: center;
906 // applies ratio (default to 16:9) to a child element (using $selector) only using
907 // an immediate's parent size. This allows to set a ratio without explicit
908 // dimensions, as width/height cannot be computed from each other.
909 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
910 $padding-percent: percentage($inverted-ratio);
915 padding-top: $padding-percent;
930 border-bottom: 2px solid $grey-background-color;
931 padding-bottom: 15px;
932 margin-bottom: $sub-menu-margin-bottom;
934 > span > my-global-icon,
936 @include margin-right(10px);
943 @include margin-left(7px);
949 @mixin play-icon ($width, $height) {
956 transform: translate(-50%, -50%) scale(0.5);
958 border-top: #{math.div($height, 2)} solid transparent;
959 border-bottom: #{math.div($height, 2)} solid transparent;
961 border-left: $width solid rgba(255, 255, 255, 0.95);
964 @mixin on-small-main-col () {
965 :host-context(.main-col:not(.expanded)) {
966 @media screen and (max-width: $small-view + $menu-width) {
971 :host-context(.main-col.expanded) {
972 @media screen and (max-width: $small-view) {
978 @mixin on-mobile-main-col () {
979 :host-context(.main-col:not(.expanded)) {
980 @media screen and (max-width: $mobile-view + $menu-width) {
985 :host-context(.main-col.expanded) {
986 @media screen and (max-width: $mobile-view) {
992 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
993 @include margin-left($inline-start);
994 @include margin-right($inline-end);
996 margin-top: $block-start;
997 margin-bottom: $block-end;
1000 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
1001 @include padding-left($inline-start);
1002 @include padding-right($inline-end);
1004 padding-top: $block-start;
1005 padding-bottom: $block-end;
1008 @mixin margin-left ($value) {
1009 @supports (margin-inline-start: $value) {
1010 margin-inline-start: $value;
1013 @supports not (margin-inline-start: $value) {
1014 margin-left: $value;
1018 @mixin margin-right ($value) {
1019 @supports (margin-inline-end: $value) {
1020 margin-inline-end: $value;
1023 @supports not (margin-inline-end: $value) {
1024 margin-right: $value;
1028 @mixin padding-left ($value) {
1029 @supports (padding-inline-start: $value) {
1030 padding-inline-start: $value;
1033 @supports not (padding-inline-start: $value) {
1034 padding-left: $value;
1038 @mixin padding-right ($value) {
1039 @supports (padding-inline-end: $value) {
1040 padding-inline-end: $value;
1043 @supports not (padding-inline-end: $value) {
1044 padding-right: $value;