]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/sass/primeng-custom.scss
Merge remote-tracking branch 'weblate/develop' into develop
[github/Chocobozzz/PeerTube.git] / client / src / sass / primeng-custom.scss
index e71fb99a72e60ec53bac198f262cfc9d8dec14ca..9fc010d4f31c938088e23e358f6ca89cba8dc12b 100644 (file)
@@ -1,8 +1,18 @@
-@import '_variables';
-@import '_mixins';
+@use '_variables' as *;
+@use '_mixins' as *;
 
+/* stylelint-disable */
 @import '~primeng/resources/primeng.css';
 
+// Override primeng style we don't want
+input[type=button] {
+  border-radius: inherit;
+}
+
+p-table .p-datatable-header .caption {
+  margin-bottom: 15px;
+}
+
 // Taken from old nova light theme
 
 body .p-disabled {
@@ -129,7 +139,8 @@ body .p-paginator .p-paginator-pages .p-paginator-page:focus {
   box-shadow: 0 0 0 0.2em pvar(--mainColorLightest);
 }
 body .p-paginator .p-dropdown {
-  margin-left: 0.5em;
+  @include margin-left(0.5em);
+
   height: 2.286em;
   min-width: auto;
 }
@@ -151,7 +162,7 @@ body .p-dropdown:not(.p-disabled).p-focus {
   border-color: pvar(--mainColor);
 }
 body .p-dropdown .p-dropdown-label {
-  padding-right: 2em;
+  @include padding-right(2em);
 }
 body .p-dropdown .p-dropdown-trigger {
   background-color: #ffffff;
@@ -165,7 +176,7 @@ body .p-dropdown .p-dropdown-clear-icon {
   color: #848484;
 }
 body .p-dropdown.p-dropdown-clearable .p-dropdown-label {
-  padding-right: 4em;
+  @include padding-right(4em);
 }
 body .p-dropdown-panel {
   padding: 0;
@@ -181,8 +192,9 @@ body .p-dropdown-panel .p-dropdown-filter-container {
   margin: 0;
 }
 body .p-dropdown-panel .p-dropdown-filter-container .p-dropdown-filter {
+  @include padding-right(2em);
+
   width: 100%;
-  padding-right: 2em;
 }
 body .p-dropdown-panel .p-dropdown-filter-container .p-dropdown-filter-icon {
   top: 50%;
@@ -358,17 +370,18 @@ body .p-datepicker.p-datepicker-timeonly .p-timepicker {
   border-top: 0 none;
 }
 body .p-datepicker.p-datepicker-multiple-month .p-datepicker-group {
+  @include padding-right(0.857em);
+  @include padding-left(0.857em);
+
   border-right: 1px solid #d8dae2;
-  padding-right: 0.857em;
-  padding-left: 0.857em;
   padding-top: 0;
   padding-bottom: 0;
 }
 body .p-datepicker.p-datepicker-multiple-month .p-datepicker-group:first-child {
-  padding-left: 0;
+  @include padding-left(0);
 }
 body .p-datepicker.p-datepicker-multiple-month .p-datepicker-group:last-child {
-  padding-right: 0;
+  @include padding-right(0);
   border-right: 0 none;
 }
 body .p-calendar.p-calendar-w-btn .p-inputtext {
@@ -392,7 +405,7 @@ body p-calendar.ng-dirty.ng-invalid > .p-calendar > .p-inputtext {
   border: 1px solid #a80000;
 }
 body .p-timepicker .p-separator {
-  margin-left: 0;
+  @include margin-left(0);
   min-width: 0.75rem;
 }
 
@@ -482,7 +495,7 @@ body p-selectbutton.ng-dirty.ng-invalid .p-button {
   border: 1px solid #a80000;
 }
 
-//
+// data table customizations
 
 @mixin glyphicon-light {
   font-family: 'Glyphicons Halflings';
@@ -491,7 +504,6 @@ body p-selectbutton.ng-dirty.ng-invalid .p-button {
   font-display: swap;
 }
 
-// data table customizations
 p-table {
   .p-datatable-header {
     border: none !important;
@@ -504,11 +516,7 @@ p-table {
       align-items: center;
 
       .left-buttons {
-        padding-left: 15px;
-      }
-
-      .input-group-text {
-        background-color: transparent;
+        @include padding-left(15px);
       }
     }
   }
@@ -528,7 +536,7 @@ p-table {
   }
 
   td {
-    padding-left: 15px !important;
+    @include padding-left(15px !important);
 
     &.expand-cell {
       padding: 10px 15px;
@@ -611,20 +619,20 @@ p-table {
       background-color: pvar(--submenuBackgroundColor) !important;
 
       .pi {
-        @extend .glyphicon;
+        @extend .glyphicon !optional;
 
         color: #000 !important;
         font-size: 11px !important;
         top: 0 !important;
 
         &.pi-sort-amount-up-alt {
-          @extend .glyphicon-triangle-top;
+          @extend .glyphicon-triangle-top !optional;
 
           color: pvar(--mainForegroundColor) !important;
         }
 
         &.pi-sort-amount-down {
-          @extend .glyphicon-triangle-bottom;
+          @extend .glyphicon-triangle-bottom !optional;
 
           color: pvar(--mainForegroundColor) !important;
         }
@@ -640,10 +648,10 @@ p-table {
     my-delete-button,
     my-button {
       display: inline-block !important;
-      margin-left: 5px;
+      @include margin-left(5px);
 
       &:first-child {
-        margin-left: 0
+        @include margin-left(0)
       }
     }
   }
@@ -702,23 +710,23 @@ p-table {
         }
 
         &.p-paginator-first {
-          @extend .glyphicon-step-backward;
+          @extend .glyphicon-step-backward !optional;
         }
 
         &.p-paginator-prev {
-          @extend .glyphicon-chevron-left;
+          @extend .glyphicon-chevron-left !optional;
 
-          margin-right: 10px;
+          @include margin-right(10px);
         }
 
         &.p-paginator-next {
-          @extend .glyphicon-chevron-right;
+          @extend .glyphicon-chevron-right !optional;
 
-          margin-left: 10px;
+          @include margin-left(10px);
         }
 
         &.p-paginator-last {
-          @extend .glyphicon-step-forward;
+          @extend .glyphicon-step-forward !optional;
         }
       }
 
@@ -750,32 +758,39 @@ p-table {
       }
     }
   }
+
+  .badge {
+    @include peertube-badge;
+  }
 }
 
 // overflow data table
-@mixin overflow-datatable ($table-min-width, $horizontal-margins, $mobile-paginator: true) {
-  p-table {
-    .p-datatable-wrapper {
-      overflow-x: auto;
-      max-width: calc(100vw - #{$horizontal-margins * 2});
+p-table {
+  .p-datatable-wrapper {
+    overflow-x: auto;
+    max-width: 100%;
 
-      table {
-        min-width: $table-min-width;
-      }
+    table {
+      width: 100%;
     }
+  }
 
-    @if $mobile-paginator {
-      p-paginator .p-paginator-bottom {
-        display: block;
-
-        .p-paginator-current {
-          position: relative;
-          display: block;
-        }
+  @media screen and (max-width: #{breakpoint(lg)}) {
+    // Prevent overflow
+    p-paginator {
+      .p-paginator-current,
+      .p-dropdown {
+        top: 0;
+        margin-top: 30px;
+      }
+    }
+  }
 
-        a, .p-paginator-pages {
-          vertical-align: middle;
-        }
+  @media screen and (max-width: $mobile-view) {
+    // Prevent overflow
+    p-paginator {
+      .p-paginator-pages > .p-paginator-page:not(.p-highlight) {
+        display: none;
       }
     }
   }
@@ -790,15 +805,15 @@ p-calendar .p-datepicker {
   .p-datepicker-header {
 
     .p-datepicker-year {
-      margin-left: 5px;
+      @include margin-left(5px);
     }
 
     .p-datepicker-next {
-      @extend .glyphicon-chevron-right;
+      @extend .glyphicon-chevron-right !optional;
       @include glyphicon-light;
 
       color: #000 !important;
-      text-align: right;
+      text-align: end;
 
       .pi.pi-chevron-right {
         display: none !important;
@@ -806,11 +821,11 @@ p-calendar .p-datepicker {
     }
 
     .p-datepicker-prev {
-      @extend .glyphicon-chevron-left;
+      @extend .glyphicon-chevron-left !optional;
       @include glyphicon-light;
 
       color: #000 !important;
-      text-align: left;
+      text-align: start;
 
       .pi.pi-chevron-left {
         display: none !important;
@@ -821,14 +836,14 @@ p-calendar .p-datepicker {
   .p-timepicker {
 
     .pi.pi-chevron-up {
-      @extend .glyphicon-chevron-up;
+      @extend .glyphicon-chevron-up !optional;
       @include glyphicon-light;
 
       color: #000 !important;
     }
 
     .pi.pi-chevron-down {
-      @extend .glyphicon-chevron-down;
+      @extend .glyphicon-chevron-down !optional;
       @include glyphicon-light;
 
       color: #000 !important;
@@ -883,7 +898,6 @@ p-toast {
     width: auto;
     max-width: 300px;
     min-width: 200px;
-    z-index: z(notification) !important;
 
     .p-toast-icon-close {
       font-family: "Glyphicons Halflings";
@@ -936,7 +950,7 @@ p-toast {
 
       .message {
         flex-grow: 1;
-        margin-right: 20px;
+        @include margin-right(20px);
 
         h3 {
           font-size: 21px;
@@ -950,7 +964,7 @@ p-toast {
 
       .glyphicon {
         font-size: 32px;
-        margin-right: 5px;
+        @include margin-right(5px);
       }
     }
   }
@@ -967,3 +981,40 @@ p-toast {
     font-weight: 600;
   }
 }
+
+@media screen and (max-width: $primeng-breakpoint) {
+  p-table {
+    td {
+      padding: 3px 0;
+
+      &.expand-cell {
+        padding: 5px;
+      }
+    }
+
+    .p-datatable-tbody {
+
+      td:last-child {
+        padding-bottom: 15px;
+        margin-bottom: 15px;
+        border-bottom: 1px solid $separator-border-color !important;
+      }
+    }
+  }
+}
+
+@media screen and (max-width: $mobile-view) {
+  p-table {
+    .p-datatable-header {
+      .caption {
+        flex-wrap: wrap;
+
+        > div {
+          width: 100%;
+          padding: 0 !important;
+          margin-bottom: 5px;
+        }
+      }
+    }
+  }
+}