]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/sass/primeng-custom.scss
Move abuse-list details into its own component
[github/Chocobozzz/PeerTube.git] / client / src / sass / primeng-custom.scss
index 4d2d6cb67669391d14d5d3f63157973b318d042b..eab2b2dfd3e3c733f3208ee938d53d068d42a7a3 100644 (file)
@@ -17,6 +17,11 @@ my-button {
   height: max-content;
 }
 
+// focus box-shadow for primeng
+.ui-inputtext:enabled:focus:not(.ui-state-error) {
+  box-shadow: #{$focus-box-shadow-form} var(--mainColorLightest) !important;
+}
+
 // data table customizations
 p-table {
   .ui-table-caption {
@@ -27,6 +32,10 @@ p-table {
       height: 40px;
       display: flex;
       align-items: center;
+
+      .input-group-text {
+        background-color: transparent;
+      }
     }
   }
 
@@ -75,7 +84,7 @@ p-table {
           my-edit-button,
           my-delete-button,
           my-button {
-            display: block !important;
+            display: inline-block !important;
           }
         }
       }
@@ -155,14 +164,20 @@ p-table {
     my-delete-button,
     my-button {
       display: none !important;
+      margin-left: 5px;
 
       &.show {
-        display: block !important;
+        display: inline-block !important;
       }
-    }
 
-    my-edit-button + my-delete-button {
-      margin-left: 5px;
+      // keep displaying on touchscreen
+      @media not all and (hover: hover) and (pointer: fine) {
+        display: inline-block !important;
+      }
+
+      :first-child {
+        margin-left: 0
+      }
     }
   }
 
@@ -178,6 +193,26 @@ p-table {
       justify-content: center;
       align-items: center;
 
+      .ui-dropdown {
+        position: absolute;
+        top: 3px;
+        left: 0;
+
+        &.ui-state-focus {
+          box-shadow: #{$focus-box-shadow-form} var(--mainColorLightest);
+        }
+
+        .ui-dropdown-label {
+          color: var(--inputPlaceholderColor);
+        }
+      }
+
+      .ui-paginator-current {
+        position: absolute;
+        right: 0;
+        color: var(--inputPlaceholderColor);
+      }
+
       .ui-paginator-first,
       .ui-paginator-prev,
       .ui-paginator-next,
@@ -189,6 +224,11 @@ p-table {
         font-size: 13px;
         top: -1px;
 
+        &.focus-within,
+        &:focus {
+          box-shadow: #{$focus-box-shadow-form} var(--mainColorLightest);
+        }
+
         &.ui-state-disabled:hover {
           background-color: #fff !important;
         }
@@ -217,6 +257,13 @@ p-table {
       .ui-paginator-pages {
         height: auto !important;
 
+        .ui-paginator-page {
+          &.focus-within,
+          &:focus {
+            box-shadow: #{$focus-box-shadow-form} var(--mainColorLightest) !important;
+          }
+        }
+
         a {
           color: var(--mainForegroundColor) !important;
           font-weight: $font-semibold !important;
@@ -239,8 +286,52 @@ p-table {
   }
 }
 
+// overflow data table
+@mixin overflow-datatable ($table-min-width, $horizontal-margins, $mobile-paginator: true) {
+  p-table {
+    .ui-table-wrapper {
+      overflow-x: auto;
+      max-width: calc(100vw - #{$horizontal-margins * 2});
+
+      table {
+        min-width: $table-min-width;
+      }
+    }
+
+    @if $mobile-paginator {
+      p-paginator .ui-paginator-bottom {
+        display: block;
+  
+        .ui-paginator-current {
+          position: relative;
+          display: block;
+        }
+  
+        a, .ui-paginator-pages {
+          vertical-align: middle;
+        }
+      }
+    }
+  }
+}
+
 // multiselect customizations
 p-multiselect {
+  .ui-multiselect {
+    border-color: #C6C6C6;
+
+    &:not(.ui-state-disabled) {
+      &:hover {
+        border-color: #C6C6C6;
+      }
+
+      &:focus,
+      &.ui-state-focus {
+        box-shadow: #{$focus-box-shadow-form} var(--mainColorLightest);
+      }
+    }
+  }
+
   .ui-multiselect-label {
     font-size: 15px !important;
     padding: 4px 30px 4px 12px !important;
@@ -274,6 +365,15 @@ p-multiselect {
     //  left: -2px !important;
     //}
   }
+
+  .ui-multiselect-panel .ui-multiselect-items .ui-multiselect-item.ui-state-highlight {
+    background-color: var(--mainColorLighter);
+  }
+
+  .ui-inputtext:enabled:focus:not(.ui-state-error) {
+    border-color: var(--mainColorLighter) !important;
+    box-shadow: none;
+  }
 }
 
 // PrimeNG calendar tweaks
@@ -379,11 +479,42 @@ p-inputswitch {
   .ui-inputswitch-checked .ui-inputswitch-slider {
     background-color: var(--mainColor) !important;
   }
+
+  &.small {
+    height: 20px;
+
+    .ui-inputswitch {
+      width: 2.5em !important;
+      height: 1.45em !important;
+
+      .ui-inputswitch-slider::before {
+        height: 1em !important;
+        width: 1em !important;
+      }
+    }
+
+    .ui-inputswitch-checked .ui-inputswitch-slider::before {
+      transform: translateX(1em) !important;
+    }
+  }
 }
 
 p-toast {
   .ui-toast {
     z-index: z(notification) !important;
+
+    .ui-toast-close-icon {
+      font-family: "Glyphicons Halflings";
+      opacity: 0;
+
+      &:after {
+        content: "\e014";
+      }
+    }
+
+    &:hover .ui-toast-close-icon {
+      opacity: .3;
+    }
   }
 
   .ui-toast-message {