]> BookStack Code Mirror - bookstack/blobdiff - resources/sass/_pages.scss
ExportFormatter: Add book description and check for empty book and chapter descriptio...
[bookstack] / resources / sass / _pages.scss
index 7019051653f8a17e62f400e2079143786797c876..426f7961c727896414cc65caa8aa26371ba8b313 100755 (executable)
@@ -2,13 +2,12 @@
   display: flex;
   flex-direction: column;
   align-items: stretch;
-  overflow: hidden;
-  background-color: #FFF;
 
   .edit-area {
     flex: 1;
     flex-direction: column;
     z-index: 10;
+    border-radius: 0 0 8px 8px;
   }
 
   .mce-tinymce {
   }
 }
 
-body.mce-fullscreen .page-editor .edit-area,
+.page-editor-page-area {
+  width: 100%;
+  border-radius: 8px;
+  box-shadow: $bs-card;
+  @include lightDark(background-color, #FFF, #333)
+}
+
+.page-edit-toolbar {
+  width: 100%;
+  margin: 0 auto;
+  display: grid;
+  grid-template-columns: minmax(max-content, 2fr) 1.5fr minmax(max-content, 2fr);
+  align-items: center;
+}
+
+@include larger-than($xxl) {
+  .page-editor-wysiwyg2024 .page-edit-toolbar,
+  .page-editor-wysiwyg2024 .page-editor-page-area,
+  .page-editor-wysiwyg .page-edit-toolbar,
+  .page-editor-wysiwyg .page-editor-page-area {
+    max-width: 1140px;
+  }
+
+  .page-editor-wysiwyg .floating-toolbox,
+  .page-editor-wysiwyg2024 .floating-toolbox {
+    position: absolute;
+  }
+}
+
+@include smaller-than($m) {
+  .page-edit-toolbar {
+    display: flex;
+    flex-direction: row;
+    justify-content: space-between;
+  }
+}
+
+.title-input.page-title {
+  font-size: 0.8em;
+  .input {
+    border: 0;
+    margin-bottom: -1px;
+  }
+  input[type="text"] {
+    max-width: 840px;
+    margin: 0 auto;
+    border: none;
+    height: auto;
+    display: block;
+    width: 100%;
+    font-size: 20px;
+    border-radius: 8px;
+  }
+  input[type="text"]:focus {
+    position: relative;
+    outline-offset: -1px;
+    outline: 1px dashed var(--color-primary);
+    box-shadow: $bs-card;
+    z-index: 50;
+  }
+}
+
+.page-editor-markdown .title-input.page-title input[type="text"] {
+  max-width: 100%;
+}
+
+body.tox-fullscreen .page-editor .edit-area,
 body.markdown-fullscreen .page-editor .edit-area {
   z-index: 12;
 }
 
-body.mce-fullscreen, body.markdown-fullscreen {
+body.tox-fullscreen, body.markdown-fullscreen {
   .page-editor, .flex-fill {
     overflow: visible;
   }
@@ -36,8 +101,7 @@ body.mce-fullscreen, body.markdown-fullscreen {
     overflow-x: scroll;
     overflow-y: visible;
   }
-  .page-edit-toolbar .grid.third {
-    display: block;
+  .page-edit-toolbar {
     white-space: nowrap;
     > div {
       display: inline-block;
@@ -49,10 +113,10 @@ body.mce-fullscreen, body.markdown-fullscreen {
   position: fixed;
   z-index: 30;
   border-radius: 50%;
-  width: 56px;
-  height: 56px;
-  font-size: 24px;
-  right: $-m;
+  width: 52px;
+  height: 52px;
+  font-size: 26px;
+  inset-inline-end: $-xs;
   bottom: $-s;
   box-shadow: $bs-hover;
   background-color: currentColor;
@@ -77,92 +141,20 @@ body.mce-fullscreen, body.markdown-fullscreen {
   padding: 0 !important;
 }
 
-.page-content {
-  width: 100%;
-  max-width: 840px;
-  margin: 0 auto;
-  overflow-wrap: break-word;
-  .align-left {
-    text-align: left;
-  }
-  img.align-left, table.align-left {
-    float: left !important;
-    margin: $-xs $-m $-m 0;
-  }
-  .align-right {
-    text-align: right !important;
-  }
-  img.align-right, table.align-right {
-    float: right !important;
-    margin: $-xs 0 $-xs $-s;
-  }
-  .align-center {
-    text-align: center;
-  }
-  img.align-center {
-    display: block;
-  }
-  img.align-center, table.align-center {
-    margin-left: auto;
-    margin-right: auto;
-  }
-  img {
-    max-width: 100%;
-    height:auto;
-  }
-  h1, h2, h3, h4, h5, h6, pre {
-    clear: left;
-  }
-  hr {
-    clear: both;
-    margin: $-m 0;
-  }
-  table {
-    hyphens: auto;
-    table-layout: fixed;
-    max-width: 100%;
-    height: auto !important;
-  }
-
-  // diffs
-  ins,
-  del {
-    text-decoration: none;
-  }
-  ins {
-    background: #dbffdb;
-  }
-  del {
-    background: #FFECEC;
-  }
-
-  &.page-revision {
-    pre code {
-      white-space: pre-wrap;
-    }
-  }
-}
-
 // Page content pointers
 .pointer-container {
-  position: relative;
+  position: fixed;
   display: none;
   left: 0;
   z-index: 10;
 }
 .pointer {
   border: 1px solid #CCC;
-  display: flex;
-  align-items: center;
-  justify-items: center;
-  padding: $-s $-s;
+  @include lightDark(border-color, #ccc, #000);
   border-radius: 4px;
-  box-shadow: 0 0 12px 1px rgba(212, 209, 209, 0.3);
-  position: absolute;
-  top: -60px;
-  background-color:#FFF;
+  box-shadow: 0 0 12px 1px rgba(0, 0, 0, 0.1);
+  @include lightDark(background-color, #fff, #333);
   width: 275px;
-  z-index: 55;
 
   &.is-page-editable {
     width: 328px;
@@ -177,12 +169,13 @@ body.mce-fullscreen, body.markdown-fullscreen {
     margin-inline-start: -8px;
     content: '';
     display: block;
-    background-color:#FFF;
     transform: rotate(45deg);
     transform-origin: 50% 50%;
-    border-inline-startom: 1px solid #CCC;
-    border-inline-end: 1px solid #CCC;
+    border-right: 1px solid #CCC;
+    border-bottom: 1px solid #CCC;
     z-index: 56;
+    @include lightDark(background-color, #fff, #333);
+    @include lightDark(border-color, #ccc, #000);
   }
   input, button, a {
     position: relative;
@@ -195,17 +188,14 @@ body.mce-fullscreen, body.markdown-fullscreen {
   input {
     background-color: #FFF;
     border: 1px solid #DDD;
+    @include lightDark(border-color, #ddd, #000);
     color: #666;
-    width: 172px;
+    width: 160px;
     z-index: 40;
     padding: 5px 10px;
   }
-  span.icon {
-    fill: #444;
-    cursor: pointer;
-    user-select: none;
-    display: inline-block;
-    line-height: 1;
+  .text-button {
+    @include lightDark(color, #444, #AAA);
   }
   .input-group .button {
     line-height: 1;
@@ -219,34 +209,43 @@ body.mce-fullscreen, body.markdown-fullscreen {
     width: 1.2em;
     height: 1.2em;
   }
+  .button {
+    @include lightDark(border-color, #ddd, #000);
+  }
 }
 
-// Attribute form
+// Page editor sidebar toolbox
 .floating-toolbox {
-  background-color: #FFF;
-  border: 1px solid #DDD;
-  right: $-xl*2;
-  width: 48px;
+  @include lightDark(background-color, #FFF, #222);
   overflow: hidden;
   align-items: stretch;
   flex-direction: row;
   display: flex;
-  transition: width ease-in-out 180ms;
-  margin-top: -1px;
-  min-height: 0;
+  max-height: 100%;
+  border-radius: 8px;
+  box-shadow: $bs-card;
+  margin-bottom: auto;
+  margin-inline-start: $-l;
+  position: relative;
   &.open {
-    width: 480px;
+    position: relative;
+    right: 0;
+    max-width: 480px;
+    margin-bottom: 0;
   }
-  [toolbox-toggle] svg {
+  &:not(.open) .toolbox-tab-content {
+    display: none !important;
+  }
+  .toolbox-toggle svg {
     transition: transform ease-in-out 180ms;
   }
-  [toolbox-toggle] {
+  .toolbox-toggle {
     transition: background-color ease-in-out 180ms;
   }
-  &.open [toolbox-toggle] {
-    background-color: rgba(255, 0, 0, 0.29);
+  &.open .toolbox-toggle {
+    background-color: rgba(255, 0, 0, 0.20);
   }
-  &.open [toolbox-toggle] svg {
+  &.open .toolbox-toggle svg {
     transform: rotate(180deg);
   }
   > div {
@@ -254,35 +253,45 @@ body.mce-fullscreen, body.markdown-fullscreen {
     position: relative;
   }
   .tabs {
-    display: block;
     border-inline-end: 1px solid #DDD;
-    width: 48px;
+    @include lightDark(border-inline-end-color, #DDD, #000);
+    width: 40px;
     flex: 0 1 auto;
+    margin-inline-end: -1px;
+  }
+  .tabs-inner {
+    @include lightDark(background-color, #FFFFFF, #222);
   }
   .tabs svg {
-    fill: rgba(0, 0, 0, 0.5);
     padding: 0;
     margin: 0;
   }
-  .tabs > button {
+  .tabs-inner > button {
+    @include lightDark(color, rgba(0, 0, 0, 0.7), rgba(255, 255, 255, 0.5));
     display: block;
     cursor: pointer;
-    padding: $-s $-m;
-    font-size: 16px;
+    padding: 10px $-xs;
+    font-size: 18px;
     line-height: 1.6;
-    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
   }
-  &.open .tabs > button.active {
-    fill: #444;
-    background-color: rgba(0, 0, 0, 0.1);
+  .tabs-inner > button:hover,  &.open .tabs-inner > button.active {
+    color: var(--color-link) !important;
+    position: relative;
+    &:after {
+      content: '';
+      display: block;
+      position: absolute;
+      left: 0;
+      width: 100%;
+      top: 0;
+      height: 100%;
+      background-color: currentColor;
+      opacity: .075;
+    }
   }
-  div[toolbox-tab-content] {
-    padding-bottom: 45px;
-    display: flex;
-    flex: 1;
-    flex-direction: column;
-    min-height: 0px;
-    overflow-y: scroll;
+  &.open .tabs-inner > button.active {
+    border-inline-end: 1px solid var(--color-link);
+    margin-inline-end: -1px;
   }
   h4 {
     font-size: 24px;
@@ -315,30 +324,51 @@ body.mce-fullscreen, body.markdown-fullscreen {
   }
 }
 
-[toolbox-tab-content] {
+@include smaller-than($xxl) {
+  .floating-toolbox {
+    margin-inline-start: $-s;
+  }
+}
+
+@include smaller-than($s) {
+  .page-editor-page-area-wrap {
+    margin: 4px !important;
+  }
+  .floating-toolbox {
+    margin-inline-start: 4px;
+  }
+  .floating-toolbox .tabs {
+    width: 32px;
+  }
+  .floating-toolbox .tabs-inner > button {
+    font-size: 12px;
+  }
+  .page-edit-toolbar {
+    padding-block: 0 !important;
+  }
+  .page-editor.toolbox-open .page-editor-page-area {
+    display: none;
+  }
+}
+
+.toolbox-tab-content {
   display: none;
+  overflow-y: auto;
+  padding-bottom: 45px;
 }
 
 .suggestion-box {
-  position: absolute;
-  background-color: #FFF;
-  border: 1px solid #BBB;
-  box-shadow: $bs-light;
-  list-style: none;
-  z-index: 100;
+  top: auto;
+  margin: -4px 0 0;
+  right: auto;
+  left: 0;
   padding: 0;
-  margin: 0;
-  border-radius: 3px;
   li {
     display: block;
-    padding: $-xs $-s;
     border-bottom: 1px solid #DDD;
     &:last-child {
       border-bottom: 0;
     }
-    &.active {
-      background-color: #EEE;
-    }
   }
 }
 
@@ -359,10 +389,14 @@ body.mce-fullscreen, body.markdown-fullscreen {
   }
 }
 
-.entity-list-item > span:first-child, .icon-list-item > span:first-child, .chapter-expansion > .icon {
+.entity-list-item > span:first-child,
+.icon-list-item > span:first-child,
+.split-icon-list-item > a > .icon,
+.chapter-expansion > .icon {
   font-size: 0.8rem;
   width: 1.88em;
   height: 1.88em;
+  flex-shrink: 0;
   display: flex;
   align-items: center;
   justify-content: center;
@@ -413,4 +447,7 @@ body.mce-fullscreen, body.markdown-fullscreen {
     text-decoration: none;
     opacity: 1;
   }
-}
\ No newline at end of file
+  @media (prefers-contrast: more) {
+    opacity: 1;
+  }
+}