]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/sass/include/_mixins.scss
Fix tables width, paginators, button on mobile / touchscreens (#2695)
[github/Chocobozzz/PeerTube.git] / client / src / sass / include / _mixins.scss
index f96a43b34387113b78fed75cf2d0799d8d486c60..cfb14ef65ee7208b394430ca3251fe2f77059440 100644 (file)
@@ -13,7 +13,6 @@
   }
 }
 
-
 @mixin ellipsis {
   white-space: nowrap;
   overflow: hidden;
   line-height: $font-size;
   overflow: hidden;
   text-overflow: ellipsis;
+  /* Let space at right for dots */
+  position: relative;
+  margin-right: -1em;
+  padding-right: 1em;
+
+  /* Display dots if the max number of lines is exceeded */
+  &::before {
+    content: "...";
+    /* set position to right bottom corner of block */
+    position: absolute;
+    bottom: 0;
+    right: 0;
+  }
+
+  /* Hide dots if the max number of lines is not exceeded */
+  &:after {
+    content: '';
+    background-color: var(--mainBackgroundColor);
+    /* set position to right bottom corner of text */
+    position: absolute;
+    right: 0;
+    width: 1em;
+    height: 1em;
+    margin-top: 0.2em;
+  }
 }
 
 @mixin prefix($property, $parameters...) {
   }
 }
 
-@mixin button-focus-visible-shadow($color) {
+@mixin button-focus($color) {
+  &:focus,
   &.focus-visible {
-    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 4px $color;
+    box-shadow: #{$focus-box-shadow-form} $color;
   }
 }
 
 }
 
 @mixin orange-button {
-  @include button-focus-visible-shadow(var(--mainHoverColor));
+  @include button-focus(var(--mainColorLightest));
 
   &, &:active, &:focus {
     color: #fff;
 }
 
 @mixin tertiary-button {
+  @include button-focus($grey-button-outline-color);
+
   color: $grey-foreground-color;
   background-color: transparent;
 
 }
 
 @mixin grey-button {
+  @include button-focus($grey-button-outline-color);
+
   &, &:active, &:focus {
     background-color: $grey-background-color;
     color: $grey-foreground-color;
 @mixin peertube-select-container ($width) {
   padding: 0;
   margin: 0;
-  border: 1px solid #C6C6C6;
   width: $width;
   border-radius: 3px;
-  overflow: hidden;
   background: var(--inputBackgroundColor);
   position: relative;
   font-size: 15px;
     width: calc(100% + 2px);
     position: relative;
     left: 1px;
-    border: none;
-    box-shadow: none;
+    border: 1px solid #C6C6C6;
     background: transparent none;
     appearance: none;
     cursor: pointer;
   position: absolute;
 
   &:focus + span {
-    box-shadow: 0 0 0 .1rem rgba(87, 85, 217, .2);
+    box-shadow: #{$focus-box-shadow-form} var(--mainColorLightest);
   }
 
   & + span {
     width: 18px;
     min-width: 18px;
     height: 18px;
-    border: $border-width solid $fg-color;
+    border: $border-width solid #C6C6C6;
     border-radius: 3px;
     vertical-align: middle;
     cursor: pointer;
     text-align: center;
   }
 }
+
+@mixin ng2-tags {
+  ::ng-deep {
+    .ng2-tag-input {
+      border: none !important;
+    }
+
+    .ng2-tags-container {
+      display: flex;
+      align-items: center;
+      border: 1px solid #C6C6C6;
+      border-radius: 3px;
+      padding: 5px !important;
+      height: max-content;
+
+      &:focus-within {
+        box-shadow: #{$focus-box-shadow-form} var(--mainColorLightest);
+      }
+    }
+
+    tag-input-form {
+      input {
+        height: 30px !important;
+        font-size: 12px !important;
+
+        background-color: var(--mainBackgroundColor) !important;
+        color: var(--mainForegroundColor) !important;
+      }
+    }
+
+    tag {
+      background-color: $grey-background-color !important;
+      color: #000 !important;
+      border-radius: 3px !important;
+      font-size: 12px !important;
+      height: 30px !important;
+      line-height: 30px !important;
+      margin: 0 5px 0 0 !important;
+      cursor: default !important;
+      padding: 0 8px 0 10px !important;
+
+      div {
+        height: 100% !important;
+      }
+    }
+
+    delete-icon {
+      cursor: pointer !important;
+      height: auto !important;
+      vertical-align: middle !important;
+      padding-left: 6px !important;
+
+      svg {
+        position: relative;
+        top: -1px;
+        height: auto !important;
+        vertical-align: middle !important;
+
+        path  {
+          fill: $grey-foreground-color !important;
+        }
+      }
+
+      &:hover {
+        transform: none !important;
+      }
+    }
+  }
+}
+
+@mixin divider($color: var(--submenuColor), $background: var(--mainBackgroundColor)) {
+  width: 95%;
+  border-top: .05rem solid $color;
+  height: .05rem;
+  text-align: center;
+  display: block;
+  position: relative;
+
+  &[data-content] {
+    margin: .8rem 0;
+
+    &::after {
+      background: $background;
+      color: $color;
+      content: attr(data-content);
+      display: inline-block;
+      font-size: .7rem;
+      padding: 0 .4rem;
+      transform: translateY(-.65rem);
+    }
+  }
+}
+
+@mixin chip {
+  $avatar-height: 1.2rem;
+
+  align-items: center;
+  border-radius: 5rem;
+  display: inline-flex;
+  font-size: 90%;
+  color: var(--mainForegroundColor);
+  height: $avatar-height;
+  line-height: .8rem;
+  margin: .1rem;
+  max-width: 320px;
+  overflow: hidden;
+  padding: .2rem .4rem;
+  text-decoration: none;
+  text-overflow: ellipsis;
+  vertical-align: middle;
+  white-space: nowrap;
+
+  .avatar {
+    margin-left: -.4rem;
+    margin-right: .2rem;
+    height: $avatar-height;
+    width: $avatar-height;
+
+    border-radius: 50%;
+    display: inline-block;
+    line-height: 1.25;
+    position: relative;
+    vertical-align: middle;
+  }
+
+  &.two-lines {
+    $avatar-height: 1.8rem;
+
+    height: $avatar-height;
+
+    .avatar {
+      height: $avatar-height;
+      width: $avatar-height;
+    }
+
+    div {
+      display: flex;
+      flex-direction: column;
+      font-size: 80%;
+      height: $avatar-height;
+      margin-left: .1rem;
+      margin-right: .1rem;
+      justify-content: center;
+    }
+  }
+}
+
+@mixin admin-sub-header-responsive ($horizontal-margins) {
+  flex-direction: column;
+
+  .form-sub-title {
+    margin-right: 0px !important;
+    margin-bottom: 10px;
+    text-align: center;
+  }
+
+  .admin-sub-nav {
+    display: block;
+    overflow-x: auto;
+    white-space: nowrap;
+    height: 50px;
+    padding: 10px 0;
+    width: calc(100vw - #{$horizontal-margins*2});
+
+    a {
+      margin-left: 5px;
+    }
+  }
+}