]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/sass/include/_mixins.scss
Add ability to search playlists
[github/Chocobozzz/PeerTube.git] / client / src / sass / include / _mixins.scss
index b2083e51653d3445e4745e062f22178cd43a7536..62e1ca163dfbaa1b5b647dda4f7d5db1a672f4e4 100644 (file)
@@ -62,7 +62,8 @@
 
 @mixin apply-svg-color ($color) {
   ::ng-deep .feather,
-  ::ng-deep .material {
+  ::ng-deep .material,
+  ::ng-deep .misc {
     color: $color;
   }
 }
@@ -83,6 +84,7 @@
 }
 
 @mixin peertube-input-text($width) {
+  padding: 0 15px;
   display: inline-block;
   height: $button-height;
   width: $width;
@@ -90,8 +92,6 @@
   background-color: pvar(--inputBackgroundColor);
   border: 1px solid #C6C6C6;
   border-radius: 3px;
-  padding-left: 15px;
-  padding-right: 15px;
   font-size: 15px;
 
   &::placeholder {
     opacity: 0.7;
   }
 
-  @media screen and (max-width: $width) {
+  @media screen and (max-width: calc(#{$width} + 40px)) {
     width: 100%;
   }
 }
 }
 
 @mixin peertube-button {
+  @include padding(0, 17px, 0, 13px);
+
   border: 0;
   font-weight: $font-semibold;
   font-size: 15px;
   // FIXME: because of primeng that redefines border-radius of all input[type="..."]
   border-radius: 3px !important;
   text-align: center;
-  padding: 0 17px 0 13px;
   cursor: pointer;
 }
 
   line-height: normal !important;
 
   my-global-icon {
+    @include margin-right($margin-right);
+
     position: relative;
     width: $width;
-    margin-right: $margin-right;
     top: $top;
   }
 }
     width: 100%;
     height: 100%;
     font-size: 100px;
-    text-align: right;
+    text-align: end;
     filter: alpha(opacity=0);
     opacity: 0;
     outline: none;
   cursor: pointer;
 }
 
-@mixin select-arrow-down {
-  top: 50%;
-  right: calc(0% + 15px);
-  content: ' ';
-  height: 0;
-  width: 0;
-  position: absolute;
-  pointer-events: none;
-  border: 5px solid rgba(0, 0, 0, 0);
-  border-top-color: #000;
-  margin-top: -2px;
-  z-index: 100;
-}
-
 @mixin responsive-width ($width) {
   width: $width;
 
   }
 
   &::after {
-    @include select-arrow-down;
+    top: 50%;
+    right: calc(0% + 15px);
+    content: ' ';
+    height: 0;
+    width: 0;
+    position: absolute;
+    pointer-events: none;
+    border: 5px solid rgba(0, 0, 0, 0);
+    border-top-color: #000;
+    margin-top: -2px;
+    z-index: 100;
   }
 
   select {
       cursor: pointer;
 
       &::before {
+        @include margin-right(10px);
+
         position: relative;
         top: -2px;
         content: '';
         vertical-align: middle;
         cursor: pointer;
         text-align: center;
-        margin-right: 10px;
       }
     }
 
   }
 
   + span + span {
+    @include margin-left(5px);
+
     font-size: 15px;
     font-weight: $font-regular;
-    margin-left: 5px;
     cursor: pointer;
     display: inline;
   }
   min-height: $size;
 }
 
+@mixin actor-counters ($separator-margin: 10px) {
+  color: pvar(--greyForegroundColor);
+  font-size: 16px;
+  display: flex;
+  align-items: center;
+
+  > *:not(:last-child)::after {
+    content: '•';
+    margin: 0 $separator-margin;
+    color: pvar(--mainColor);
+  }
+}
+
 @mixin chevron ($size, $border-width) {
   border-style: solid;
   border-width: $border-width $border-width 0 0;
   padding: 6px 15px;
 
   my-global-icon {
+    @include margin-right(10px);
+
     width: 22px;
     opacity: .7;
-
-    margin-right: 10px;
     position: relative;
     top: -2px;
   }
     }
 
     + .breadcrumb-item {
-      padding-left: 0.5rem;
+      @include padding-left(0.5rem);
+
       &::before {
+        @include padding-right(0.5rem);
+
         display: inline-block;
-        padding-right: 0.5rem;
         color: #6c757d;
         content: '/';
       }
   }
 
   my-actor-avatar {
-    margin-left: -.4rem;
-    margin-right: .2rem;
+    @include margin-left(-.4rem);
+    @include margin-right(.2rem);
   }
 
   &.two-lines {
     }
 
     div {
+      margin: 0 .1rem;
+
       display: flex;
       flex-direction: column;
       height: $avatar-height;
-      margin-left: .1rem;
-      margin-right: .1rem;
       justify-content: center;
     }
   }
 }
 
-@mixin admin-sub-header-responsive {
-  flex-direction: column;
-
-  .form-sub-title {
-    margin-right: 0 !important;
-    margin-bottom: 10px;
-    text-align: center;
-  }
-
-  .admin-sub-nav {
-    display: block;
-    overflow-x: auto;
-    white-space: nowrap;
-    height: 50px;
-    padding: 10px 0;
-    width: 100%;
-
-    a {
-      margin-left: 5px;
-    }
-  }
-}
-
 // applies ratio (default to 16:9) to a child element (using $selector) only using
 // an immediate's parent size. This allows to set a ratio without explicit
 // dimensions, as width/height cannot be computed from each other.
     width: 100%;
     height: 100%;
     top: 0;
+
     @content;
   }
 }
 
     > span > my-global-icon,
     > my-global-icon {
-      margin-right: 10px;
+      @include margin-right(10px);
       width: 24px;
       height: 24px;
       vertical-align: top;
     }
 
     .badge {
-      margin-left: 7px;
+      @include margin-left(7px);
       vertical-align: top;
     }
   }
     }
   }
 }
+
+@mixin margin ($block-start, $inline-end, $block-end, $inline-start) {
+  @include margin-left($inline-start);
+  @include margin-right($inline-end);
+
+  margin-top: $block-start;
+  margin-bottom: $block-end;
+}
+
+@mixin padding ($block-start, $inline-end, $block-end, $inline-start) {
+  @include padding-left($inline-start);
+  @include padding-right($inline-end);
+
+  padding-top: $block-start;
+  padding-bottom: $block-end;
+}
+
+@mixin margin-left ($value) {
+  @supports (margin-inline-start: $value) {
+    margin-inline-start: $value;
+  }
+
+  @supports not (margin-inline-start: $value) {
+    margin-left: $value;
+  }
+}
+
+@mixin margin-right ($value) {
+  @supports (margin-inline-end: $value) {
+    margin-inline-end: $value;
+  }
+
+  @supports not (margin-inline-end: $value) {
+    margin-right: $value;
+  }
+}
+
+@mixin padding-left ($value) {
+  @supports (padding-inline-start: $value) {
+    padding-inline-start: $value;
+  }
+
+  @supports not (padding-inline-start: $value) {
+    padding-left: $value;
+  }
+}
+
+@mixin padding-right ($value) {
+  @supports (padding-inline-end: $value) {
+    padding-inline-end: $value;
+  }
+
+  @supports not (padding-inline-end: $value) {
+    padding-right: $value;
+  }
+}