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 chevron ($size, $border-width) {
574 border-width: $border-width $border-width 0 0;
576 display: inline-block;
577 transform: rotate(-45deg);
582 @mixin chevron-right ($size, $border-width) {
583 @include chevron($size, $border-width);
586 transform: rotate(45deg);
589 @mixin chevron-left ($size, $border-width) {
590 @include chevron($size, $border-width);
593 transform: rotate(-135deg);
596 @mixin in-content-small-title {
597 text-transform: uppercase;
598 color: pvar(--mainColor);
599 font-weight: $font-bold;
603 @mixin settings-big-title {
604 text-transform: uppercase;
605 color: pvar(--mainColor);
606 font-weight: $font-bold;
611 @mixin create-button {
612 @include peertube-button-link;
613 @include orange-button;
614 @include button-with-icon(20px, 5px, -1px);
617 @mixin row-blocks ($column-responsive: true) {
620 padding-bottom: 20px;
622 border-bottom: 1px solid #C6C6C6;
624 @media screen and (max-width: $small-view) {
625 @if $column-responsive {
626 flex-direction: column;
631 padding-bottom: 10px;
637 @mixin dropdown-with-icon-item {
641 @include margin-right(10px);
650 @mixin progressbar($small: false) {
651 background-color: $grey-background-color;
656 border-radius: 0.25rem;
661 color: $grey-foreground-color;
675 color: pvar(--mainBackgroundColor);
676 background-color: pvar(--mainColor);
678 flex-direction: column;
679 justify-content: center;
682 transition: width 0.6s ease;
685 background-color: pvar(--secondaryColor);
689 background-color: lighten($color: #c54130, $amount: 10);
697 padding: 0.75rem 1rem;
700 background-color: pvar(--submenuBackgroundColor);
701 border-radius: 0.25rem;
707 color: pvar(--mainColor);
711 @include padding-left(0.5rem);
714 @include padding-right(0.5rem);
716 display: inline-block;
734 box-sizing: border-box;
735 flex: 0 0 percentage(1/3);
740 @include disable-default-a-behaviour;
742 text-decoration: none;
757 background: pvar(--submenuBackgroundColor);
759 box-sizing: border-box;
768 color: pvar(--mainForegroundColor);
775 color: pvar(--inputPlaceholderColor);
780 @mixin divider($color: pvar(--submenuBackgroundColor), $background: pvar(--mainBackgroundColor)) {
782 border-top: .05rem solid $color;
792 background: $background;
794 content: attr(data-content);
795 display: inline-block;
798 transform: translateY(-.65rem);
805 --chip-padding: .2rem .4rem;
806 $avatar-height: 1.2rem;
809 border-radius: var(--chip-radius);
810 display: inline-flex;
812 color: pvar(--mainForegroundColor);
813 height: $avatar-height;
818 padding: var(--chip-padding);
819 text-decoration: none;
820 text-overflow: ellipsis;
821 vertical-align: middle;
825 --chip-radius: .2rem;
826 --chip-padding: .2rem .3rem;
830 @include margin-left(-.4rem);
831 @include margin-right(.2rem);
835 $avatar-height: 2rem;
837 height: $avatar-height;
840 @include actor-avatar-size($avatar-height);
847 flex-direction: column;
848 height: $avatar-height;
849 justify-content: center;
854 // applies ratio (default to 16:9) to a child element (using $selector) only using
855 // an immediate's parent size. This allows to set a ratio without explicit
856 // dimensions, as width/height cannot be computed from each other.
857 @mixin block-ratio ($selector: 'div', $inverted-ratio: 9/16) {
858 $padding-percent: percentage($inverted-ratio);
863 padding-top: $padding-percent;
877 border-bottom: 2px solid $grey-background-color;
878 padding-bottom: 15px;
879 margin-bottom: $sub-menu-margin-bottom;
881 > span > my-global-icon,
883 @include margin-right(10px);
890 @include margin-left(7px);
896 @mixin play-icon ($width, $height) {
903 transform: translate(-50%, -50%) scale(0.5);
905 border-top: ($height / 2) solid transparent;
906 border-bottom: ($height / 2) solid transparent;
908 border-left: $width solid rgba(255, 255, 255, 0.95);
911 @mixin on-small-main-col () {
912 :host-context(.main-col:not(.expanded)) {
913 @media screen and (max-width: $small-view + $menu-width) {
918 :host-context(.main-col.expanded) {
919 @media screen and (max-width: $small-view) {
925 @mixin on-mobile-main-col () {
926 :host-context(.main-col:not(.expanded)) {
927 @media screen and (max-width: $mobile-view + $menu-width) {
932 :host-context(.main-col.expanded) {
933 @media screen and (max-width: $mobile-view) {
939 @mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
940 @include margin-left($inline-start);
941 @include margin-right($inline-end);
943 margin-top: $block-start;
944 margin-bottom: $block-end;
947 @mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
948 @include padding-left($inline-start);
949 @include padding-right($inline-end);
951 padding-top: $block-start;
952 padding-bottom: $block-end;
955 @mixin margin-left ($value) {
956 @supports (margin-inline-start: $value) {
957 margin-inline-start: $value;
960 @supports not (margin-inline-start: $value) {
965 @mixin margin-right ($value) {
966 @supports (margin-inline-end: $value) {
967 margin-inline-end: $value;
970 @supports not (margin-inline-end: $value) {
971 margin-right: $value;
975 @mixin padding-left ($value) {
976 @supports (padding-inline-start: $value) {
977 padding-inline-start: $value;
980 @supports not (padding-inline-start: $value) {
981 padding-left: $value;
985 @mixin padding-right ($value) {
986 @supports (padding-inline-end: $value) {
987 padding-inline-end: $value;
990 @supports not (padding-inline-end: $value) {
991 padding-right: $value;