]> BookStack Code Mirror - bookstack/blobdiff - resources/sass/_layout.scss
Updated attachment links to have dropdown for open type
[bookstack] / resources / sass / _layout.scss
index 1a7ff2cab029e615c9f7ad7025b4b4fcc8bc2b9a..14a37dd4a2465777572e7787695d69ac690f1e26 100644 (file)
@@ -4,10 +4,13 @@
  */
 .container {
   max-width: $xxl;
-  margin-left: auto;
-  margin-right: auto;
-  padding-left: $-m;
-  padding-right: $-m;
+  margin-inline-start: auto;
+  margin-inline-end: auto;
+  padding-inline-start: $-m;
+  padding-inline-end: $-m;
+  &.medium {
+    max-width: 1100px;
+  }
   &.small {
     max-width: 840px;
   }
@@ -49,6 +52,9 @@
   &.v-center {
     align-items: center;
   }
+  &.v-end {
+    align-items: end;
+  }
   &.no-gap {
     grid-row-gap: 0;
     grid-column-gap: 0;
   }
 }
 
+#content {
+  flex: 1 0 auto;
+}
+
 /**
  * Flexbox layout system
  */
@@ -116,12 +126,53 @@ body.flexbox {
   min-height: 0;
   max-width: 100%;
   position: relative;
-  overflow-y: hidden;
+}
+
+.flex-container-row {
+  display: flex;
+  flex-direction: row;
+  &.v-center {
+    align-items: center;
+  }
+}
+
+.flex-container-column {
+  display: flex;
+  flex-direction: column;
+}
+
+.flex-container-column.wrap, .flex-container-row.wrap {
+  flex-wrap: wrap;
 }
 
 .flex {
   min-height: 0;
   flex: 1;
+  max-width: 100%;
+  &.fit-content {
+    flex-basis: auto;
+    flex-grow: 0;
+  }
+}
+
+.gap-m {
+  gap: $-m;
+}
+
+.justify-flex-start {
+  justify-content: flex-start;
+}
+.justify-flex-end {
+  justify-content: flex-end;
+}
+.justify-center {
+  justify-content: center;
+}
+.justify-space-between {
+  justify-content: space-between;
+}
+.items-center {
+  align-items: center;
 }
 
 
@@ -129,20 +180,28 @@ body.flexbox {
  * Display and float utilities
  */
 .block {
-  display: block;
+  display: block !important;
   position: relative;
 }
 
 .inline {
-  display: inline;
+  display: inline !important;
 }
 
 .block.inline {
-  display: inline-block;
+  display: inline-block !important;
+}
+
+.relative {
+  position: relative;
 }
 
 .hidden {
-  display: none;
+  display: none !important;
+}
+
+.fill-height {
+  height: 100%;
 }
 
 .float {
@@ -168,6 +227,13 @@ body.flexbox {
   }
 }
 
+/**
+ * Border radiuses
+ */
+.rounded {
+  border-radius: 4px;
+}
+
 /**
  * Inline content columns
  */
@@ -185,12 +251,12 @@ body.flexbox {
 /**
  * Fixes
  */
-.clearfix:before,
-.clearfix:after {
+.clearfix::before,
+.clearfix::after {
   content: " ";
   display: table;
 }
-.clearfix:after {
+.clearfix::after {
   clear: both;
 }
 
@@ -199,8 +265,8 @@ body.flexbox {
  */
 .tri-layout-container {
   display: grid;
-  margin-left: $-xl;
-  margin-right: $-xl;
+  margin-inline-start: $-xl;
+  margin-inline-end: $-xl;
   grid-template-columns: 1fr 4fr 1fr;
   grid-template-areas: "a b c";
   grid-column-gap: $-xxl;
@@ -215,6 +281,7 @@ body.flexbox {
   .tri-layout-middle {
     grid-area: b;
     padding-top: $-m;
+    min-width: 0;
   }
 }
 @include smaller-than($xxl) {
@@ -224,7 +291,7 @@ body.flexbox {
     ". b b";
     grid-template-columns: 1fr 3fr;
     grid-template-rows: min-content min-content 1fr;
-    padding-right: $-l;
+    padding-inline-end: $-l;
   }
 }
 @include between($l, $xxl) {
@@ -235,13 +302,14 @@ body.flexbox {
 }
 @include larger-than($xxl) {
   .tri-layout-left-contents, .tri-layout-right-contents {
-    padding: $-m;
+    padding: $-xl $-m;
     position: sticky;
-    top: $-m;
+    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 {
@@ -259,11 +327,11 @@ body.flexbox {
     grid-template-areas:  none;
     grid-template-columns: 1fr;
     grid-column-gap: 0;
-    padding-right: $-xs;
-    padding-left: $-xs;
+    padding-inline-end: $-xs;
+    padding-inline-start: $-xs;
     .tri-layout-left-contents, .tri-layout-right-contents {
-      padding-left: $-m;
-      padding-right: $-m;
+      padding-inline-start: $-m;
+      padding-inline-end: $-m;
     }
     .tri-layout-left > *, .tri-layout-right > * {
       display: none;
@@ -303,13 +371,13 @@ body.flexbox {
     display: none;
   }
   .tri-layout-left-contents > *, .tri-layout-right-contents > * {
-    opacity: 0.6;
+    @include lightDark(opacity, 0.6, 0.7);
     transition: opacity ease-in-out 120ms;
-    &:hover {
-      opacity: 1;
+    &:hover, &:focus-within {
+      opacity: 1 !important;
     }
-    &:focus-within {
-      opacity: 1;
+    @media (prefers-contrast: more) {
+      opacity: 1 !important;
     }
   }
 
@@ -317,7 +385,7 @@ body.flexbox {
 
 @include smaller-than($m) {
   .tri-layout-container {
-    margin-left: 0;
-    margin-right: 0;
+    margin-inline-start: 0;
+    margin-inline-end: 0;
   }
 }
\ No newline at end of file