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);
362 background-color: #E5E5E5;
369 background-color: #f9f9f9;
372 @media screen and (max-width: $width) {
378 right: calc(0% + 15px);
383 pointer-events: none;
384 border: 5px solid rgba(0, 0, 0, 0);
385 border-top-color: #000;
391 padding: 0 35px 0 12px;
393 border: 1px solid #C6C6C6;
394 background: transparent none;
397 height: $button-height;
398 text-overflow: ellipsis;
399 color: pvar(--mainForegroundColor);
407 text-shadow: 0 0 0 #000;
415 &.peertube-select-button {
416 @include grey-button;
420 font-weight: $font-semibold;
421 color: pvar(--greyForegroundColor);
427 // Thanks: https://codepen.io/manabox/pen/raQmpL
428 @mixin peertube-radio-container {
429 [type=radio]:checked,
430 [type=radio]:not(:checked) {
435 [type=radio]:checked + label,
436 [type=radio]:not(:checked) + label {
441 display: inline-block;
443 font-weight: $font-regular;
446 [type=radio]:checked + label::before,
447 [type=radio]:not(:checked) + label::before {
454 border: 1px solid #C6C6C6;
459 [type=radio]:checked + label::after,
460 [type=radio]:not(:checked) + label::after {
464 background: pvar(--mainColor);
469 transition: all 0.2s ease;
471 [type=radio]:not(:checked) + label::after {
475 [type=radio]:checked + label::after {
480 .form-group-description {
488 @mixin peertube-checkbox ($border-width) {
493 box-shadow: #{$focus-box-shadow-form} pvar(--mainColorLightest);
501 border: $border-width solid #C6C6C6;
503 vertical-align: middle;
509 top: calc(2px - #{$border-width});
514 transform: rotate(45deg) scale(0);
515 border-right: 2px solid $bg-color;
516 border-bottom: 2px solid $bg-color;
521 border-color: transparent;
522 background: pvar(--mainColor);
523 animation: jelly 0.6s ease;
527 transform: rotate(45deg) scale(1);
532 @include margin-left(5px);
535 font-weight: $font-regular;
541 &[disabled] + span + span {
549 padding: 1/4em 1/2em;
550 text-transform: uppercase;
551 font-weight: $font-bold;
553 letter-spacing: 1/3px;
557 background-color: #ffcdd2;
562 text-decoration: line-through;
566 background-color: #feedaf;
571 background-color: #ffd8b2;
576 background-color: #c8e6c9;
581 background-color: #b3e5fc;
586 background-color: #eccfff;
591 @mixin actor-avatar-size ($size) {
592 display: inline-block;
599 @mixin actor-counters ($separator-margin: 10px) {
600 color: pvar(--greyForegroundColor);
605 > *:not(:last-child)::after {
607 margin: 0 $separator-margin;
608 color: pvar(--mainColor);
612 @mixin chevron ($size, $border-width) {
614 border-width: $border-width $border-width 0 0;
616 display: inline-block;
617 transform: rotate(-45deg);
622 @mixin chevron-right ($size, $border-width) {
623 @include chevron($size, $border-width);
626 transform: rotate(45deg);
629 @mixin chevron-left ($size, $border-width) {
630 @include chevron($size, $border-width);
633 transform: rotate(-135deg);
636 @mixin in-content-small-title {
637 text-transform: uppercase;
638 color: pvar(--mainColor);
639 font-weight: $font-bold;
643 @mixin settings-big-title {
644 text-transform: uppercase;
645 color: pvar(--mainColor);
646 font-weight: $font-bold;
651 @mixin create-button {
652 @include peertube-button-link;
653 @include orange-button;
654 @include button-with-icon(20px, 5px, -1px);
657 @mixin row-blocks ($column-responsive: true, $min-height: 130px, $separator: true) {
659 min-height: $min-height;
660 padding-bottom: 20px;
664 border-bottom: 1px solid #C6C6C6;
667 @media screen and (max-width: $small-view) {
668 @if $column-responsive {
669 flex-direction: column;
674 padding-bottom: 10px;
680 @mixin dropdown-with-icon-item {
684 @include margin-right(10px);
693 @mixin progressbar($small: false) {
694 background-color: $grey-background-color;
699 border-radius: 0.25rem;
704 color: $grey-foreground-color;
719 color: pvar(--mainBackgroundColor);
720 background-color: pvar(--mainColor);
722 flex-direction: column;
723 justify-content: center;
726 transition: width 0.6s ease;
729 background-color: pvar(--secondaryColor);
733 background-color: lighten($color: #c54130, $amount: 10);
741 padding: 0.75rem 1rem;
744 background-color: pvar(--submenuBackgroundColor);
745 border-radius: 0.25rem;
751 color: pvar(--mainColor);
755 @include padding-left(0.5rem);
758 @include padding-right(0.5rem);
760 display: inline-block;
778 box-sizing: border-box;
779 flex: 0 0 percentage(math.div(1, 3));
784 @include disable-default-a-behaviour;
786 text-decoration: none;
801 background: pvar(--submenuBackgroundColor);
803 box-sizing: border-box;
812 color: pvar(--mainForegroundColor);
819 color: pvar(--inputPlaceholderColor);
824 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
826 border-top: .05rem solid $color;
836 background: $background;
838 content: attr(data-content);
839 display: inline-block;
842 transform: translateY(-.65rem);
849 --chip-padding: .2rem .4rem;
850 $avatar-height: 1.2rem;
853 border-radius: var(--chip-radius);
854 display: inline-flex;
856 color: pvar(--mainForegroundColor);
857 height: $avatar-height;
862 padding: var(--chip-padding);
863 text-decoration: none;
864 text-overflow: ellipsis;
865 vertical-align: middle;
869 --chip-radius: .2rem;
870 --chip-padding: .2rem .3rem;
874 @include margin-left(-.4rem);
875 @include margin-right(.2rem);
879 $avatar-height: 2rem;
881 height: $avatar-height;
884 @include actor-avatar-size($avatar-height);
891 flex-direction: column;
892 height: $avatar-height;
893 justify-content: center;
898 // applies ratio (default to 16:9) to a child element (using $selector) only using
899 // an immediate's parent size. This allows to set a ratio without explicit
900 // dimensions, as width/height cannot be computed from each other.
901 @mixin block-ratio ($selector: 'div', $inverted-ratio: math.div(9, 16)) {
902 $padding-percent: percentage($inverted-ratio);
907 padding-top: $padding-percent;
922 border-bottom: 2px solid $grey-background-color;
923 padding-bottom: 15px;
924 margin-bottom: $sub-menu-margin-bottom;
926 > span > my-global-icon,
928 @include margin-right(10px);
935 @include margin-left(7px);
941 @mixin play-icon ($width, $height) {
948 transform: translate(-50%, -50%) scale(0.5);
950 border-top: #{math.div($height, 2)} solid transparent;
951 border-bottom: #{math.div($height, 2)} solid transparent;
953 border-left: $width solid rgba(255, 255, 255, 0.95);
956 @mixin on-small-main-col () {
957 :host-context(.main-col:not(.expanded)) {
958 @media screen and (max-width: $small-view + $menu-width) {
963 :host-context(.main-col.expanded) {
964 @media screen and (max-width: $small-view) {
970 @mixin on-mobile-main-col () {
971 :host-context(.main-col:not(.expanded)) {
972 @media screen and (max-width: $mobile-view + $menu-width) {
977 :host-context(.main-col.expanded) {
978 @media screen and (max-width: $mobile-view) {
984 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
985 @include margin-left($inline-start);
986 @include margin-right($inline-end);
988 margin-top: $block-start;
989 margin-bottom: $block-end;
992 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
993 @include padding-left($inline-start);
994 @include padding-right($inline-end);
996 padding-top: $block-start;
997 padding-bottom: $block-end;
1000 @mixin margin-left ($value) {
1001 @supports (margin-inline-start: $value) {
1002 margin-inline-start: $value;
1005 @supports not (margin-inline-start: $value) {
1006 margin-left: $value;
1010 @mixin margin-right ($value) {
1011 @supports (margin-inline-end: $value) {
1012 margin-inline-end: $value;
1015 @supports not (margin-inline-end: $value) {
1016 margin-right: $value;
1020 @mixin padding-left ($value) {
1021 @supports (padding-inline-start: $value) {
1022 padding-inline-start: $value;
1025 @supports not (padding-inline-start: $value) {
1026 padding-left: $value;
1030 @mixin padding-right ($value) {
1031 @supports (padding-inline-end: $value) {
1032 padding-inline-end: $value;
1035 @supports not (padding-inline-end: $value) {
1036 padding-right: $value;