]> BookStack Code Mirror - bookstack/blobdiff - resources/sass/_layout.scss
respective book and chapter structure added.
[bookstack] / resources / sass / _layout.scss
index 19333faf71baf7c4a6d69e7cfda11a3e4e7902cd..6c78419d86c96d3867fbcaa691aafeb0d0f6d90e 100644 (file)
@@ -253,14 +253,31 @@ body.flexbox {
   position: relative;
 }
 
+.fixed {
+  position: fixed;
+  z-index: 20;
+  &.top-right {
+    top: 0;
+    right: 0;
+  }
+}
+
 .hidden {
   display: none !important;
 }
 
-.fill-height {
+.overflow-hidden {
+  overflow: hidden;
+}
+
+.height-fill {
   height: 100%;
 }
 
+.height-auto {
+  height: auto !important;
+}
+
 .float {
   float: left;
   &.right {
@@ -289,6 +306,19 @@ body.flexbox {
   }
 }
 
+[hidden] {
+  display: none !important;
+}
+
+.screen-reader-only {
+  position: absolute;
+  inset-inline-start: -10000px;
+  top: auto;
+  width: 1px;
+  height: 1px;
+  overflow: hidden;
+}
+
 /**
  * Border radiuses
  */
@@ -331,40 +361,85 @@ body.flexbox {
   margin-inline-end: $-xl;
   grid-template-columns: 1fr 4fr 1fr;
   grid-template-areas: "a b c";
-  grid-column-gap: $-xxl;
-  .tri-layout-right {
-    grid-area: c;
-    min-width: 0;
+  grid-column-gap: $-xl;
+  position: relative;
+}
+.tri-layout-sides {
+  grid-column-start: a;
+  grid-column-end: c;
+  grid-row: 1;
+  min-width: 0;
+  z-index: 4;
+}
+.tri-layout-sides-content {
+  display: grid;
+  grid-template-areas: "a b c";
+  grid-template-columns: 1fr 4fr 1fr;
+  height: 100%;
+}
+.tri-layout-middle {
+  grid-area: b;
+  padding-top: $-m;
+  min-width: 0;
+  z-index: 5;
+}
+.tri-layout-right {
+  grid-area: c;
+  min-width: 0;
+}
+.tri-layout-left {
+  grid-area: a;
+  min-width: 0;
+}
+
+@include larger-than($xxl) {
+  .tri-layout-left-contents, .tri-layout-right-contents {
+    padding: $-xl $-m;
+    position: sticky;
+    top: 0;
+    max-height: 100vh;
+    min-height: 50vh;
+    overflow-y: scroll;
+    overflow-x: hidden;
+    height: 100%;
+    scrollbar-width: none;
+    -ms-overflow-style: none;
+    &::-webkit-scrollbar {
+      display: none;
+    }
   }
-  .tri-layout-left {
-    grid-area: a;
-    min-width: 0;
+  .tri-layout-middle-contents {
+    max-width: 940px;
+    margin: 0 auto;
   }
-  .tri-layout-middle {
-    grid-area: b;
-    padding-top: $-m;
-    min-width: 0;
+}
+@include between($xxl, $xxxl) {
+  .tri-layout-sides-content, .tri-layout-container {
+    grid-template-columns: 1fr calc(940px + (2 * $-m)) 1fr;
+  }
+  .tri-layout-container {
+    grid-column-gap: $-s;
+    margin-inline-start: $-m;
+    margin-inline-end: $-m;
   }
 }
 @include smaller-than($xxl) {
   .tri-layout-container {
-    grid-template-areas:  "c b b"
-    "a b b"
-    ". b b";
+    grid-template-areas:  "a b b";
     grid-template-columns: 1fr 3fr;
     grid-template-rows: min-content min-content 1fr;
     padding-inline-end: $-l;
   }
-}
-@include between($l, $xxl) {
-  .tri-layout-left {
-    position: sticky;
-    top: $-m;
+  .tri-layout-sides {
+    grid-column-start: a;
+    grid-column-end: a;
+  }
+  .tri-layout-sides-content {
+    display: block;
   }
 }
-@include larger-than($xxl) {
-  .tri-layout-left-contents, .tri-layout-right-contents {
-    padding: $-xl $-m;
+@include between($l, $xxl) {
+  .tri-layout-sides-content {
     position: sticky;
     top: 0;
     max-height: 100vh;
@@ -378,12 +453,22 @@ body.flexbox {
       display: none;
     }
   }
-  .tri-layout-middle-contents {
-    max-width: 940px;
-    margin: 0 auto;
+}
+@include larger-than($l) {
+  .tri-layout-mobile-tabs {
+    display: none;
+  }
+  .tri-layout-left-contents > *, .tri-layout-right-contents > * {
+    @include lightDark(opacity, 0.6, 0.75);
+    transition: opacity ease-in-out 120ms;
+    &:hover, &:focus-within {
+      opacity: 1 !important;
+    }
+    @media (prefers-contrast: more) {
+      opacity: 1 !important;
+    }
   }
 }
-
 @include smaller-than($l) {
   .tri-layout-container {
     grid-template-areas:  none;
@@ -391,18 +476,16 @@ body.flexbox {
     grid-column-gap: 0;
     padding-inline-end: $-xs;
     padding-inline-start: $-xs;
-    .tri-layout-left-contents, .tri-layout-right-contents {
+    .tri-layout-sides {
       padding-inline-start: $-m;
       padding-inline-end: $-m;
+      grid-column: 1/1;
     }
     .tri-layout-left > *, .tri-layout-right > * {
       display: none;
       pointer-events: none;
     }
     .tri-layout-left, .tri-layout-right {
-      grid-area: none;
-      grid-column: 1/1;
-      grid-row: 1;
       padding-top: 0 !important;
     }
     .tri-layout-middle {
@@ -428,21 +511,6 @@ body.flexbox {
     }
   }
 }
-@include larger-than($l) {
-  .tri-layout-mobile-tabs {
-    display: none;
-  }
-  .tri-layout-left-contents > *, .tri-layout-right-contents > * {
-    @include lightDark(opacity, 0.6, 0.75);
-    transition: opacity ease-in-out 120ms;
-    &:hover, &:focus-within {
-      opacity: 1 !important;
-    }
-    @media (prefers-contrast: more) {
-      opacity: 1 !important;
-    }
-  }
-}
 
 @include smaller-than($m) {
   .tri-layout-container {