]> BookStack Code Mirror - bookstack/blobdiff - resources/sass/_editor.scss
Lexical: Added media resize support via drag handles
[bookstack] / resources / sass / _editor.scss
index b577d185027935661d1146947a0c861a44595729..31ce564be3797afbc2537dc8c943febf48d070bc 100644 (file)
@@ -31,6 +31,7 @@ body.editor-is-fullscreen {
   }
 }
 .editor-content-wrap {
+  position: relative;
   overflow-y: scroll;
 }
 
@@ -59,6 +60,18 @@ body.editor-is-fullscreen {
   background-color: #ceebff;
   color: #000;
 }
+.editor-button-long {
+  display: flex !important;
+  flex-direction: row;
+  align-items: center;
+  justify-content: start;
+  gap: .5rem;
+}
+.editor-button-text {
+  font-weight: 400;
+  color: #000;
+  font-size: 12.2px;
+}
 .editor-button-format-preview {
   padding: 4px 6px;
   display: block;
@@ -70,6 +83,31 @@ body.editor-is-fullscreen {
   fill: currentColor;
   display: block;
 }
+.editor-button-with-menu-container {
+  display: flex;
+  flex-direction: row;
+  gap: 0;
+  align-items: stretch;
+  border-radius: 4px;
+  .editor-dropdown-menu-container {
+    display: flex;
+  }
+  .editor-dropdown-menu-container > .editor-dropdown-menu {
+    top: 100%;
+  }
+  .editor-dropdown-menu-container > .editor-button {
+    padding-inline: 4px;
+    margin-inline-start: -3px;
+    svg {
+      width: 12px;
+      height: 12px;
+    }
+  }
+  &:hover {
+    outline: 1px solid #DDD;
+    outline-offset: -3px;
+  }
+}
 
 // Containers
 .editor-dropdown-menu-container {
@@ -84,21 +122,20 @@ body.editor-is-fullscreen {
   display: flex;
   flex-direction: row;
 }
-.editor-menu-list {
+.editor-dropdown-menu-vertical {
   display: flex;
   flex-direction: column;
   align-items: stretch;
 }
-.editor-menu-list .editor-button {
+.editor-dropdown-menu-vertical .editor-button {
   border-bottom: 0;
   text-align: start;
   display: block;
   width: 100%;
 }
-.editor-menu-list > .editor-dropdown-menu-container .editor-dropdown-menu {
+.editor-dropdown-menu-vertical > .editor-dropdown-menu-container .editor-dropdown-menu {
   inset-inline-start: 100%;
   top: 0;
-  flex-direction: column;
 }
 
 .editor-format-menu-toggle {
@@ -161,6 +198,10 @@ body.editor-is-fullscreen {
     margin-left: -4px;
     top: -5px;
   }
+  &.is-above:before {
+    top: calc(100% - 5px);
+    transform: rotate(225deg);
+  }
 }
 
 // Modals
@@ -247,23 +288,20 @@ body.editor-is-fullscreen {
   position: relative;
   display: inline-flex;
 }
-.editor-image-decorator {
+.editor-node-resizer {
   position: absolute;
   left: 0;
   right: 0;
-  width: 100%;
-  height: 100%;
   display: inline-block;
-  &.selected {
-    border: 1px dashed var(--editor-color-primary);
-  }
+  outline: 2px dashed var(--editor-color-primary);
 }
-.editor-image-decorator-handle {
+.editor-node-resizer-handle {
   position: absolute;
   display: block;
   width: 10px;
   height: 10px;
   border: 2px solid var(--editor-color-primary);
+  z-index: 3;
   background-color: #FFF;
   user-select: none;
   &.nw {
@@ -287,6 +325,21 @@ body.editor-is-fullscreen {
     cursor: sw-resize;
   }
 }
+.editor-node-resizer-ghost {
+  opacity: 0.5;
+  display: none;
+  position: absolute;
+  left: 0;
+  top: 0;
+  width: 100%;
+  height: 100%;
+  z-index: 2;
+  pointer-events: none;
+  background-color: var(--editor-color-primary);
+}
+.editor-node-resizer.active .editor-node-resizer-ghost {
+  display: block;
+}
 
 .editor-table-marker {
   position: fixed;
@@ -320,6 +373,44 @@ body.editor-is-fullscreen {
   outline: 2px dashed var(--editor-color-primary);
 }
 
+.editor-media-wrap {
+  cursor: not-allowed;
+  iframe {
+    pointer-events: none;
+  }
+}
+
+/**
+ * Fake task list checkboxes
+ */
+.editor-content-area .task-list-item {
+  margin-left: 0;
+  position: relative;
+}
+.editor-content-area .task-list-item > input[type="checkbox"] {
+  display: none;
+}
+.editor-content-area .task-list-item:before {
+  content: '';
+  display: inline-block;
+  border: 2px solid #CCC;
+  width: 12px;
+  height: 12px;
+  border-radius: 2px;
+  margin-right: 8px;
+  vertical-align: text-top;
+  cursor: pointer;
+  position: absolute;
+  left: -24px;
+  top: 4px;
+}
+.editor-content-area .task-list-item[checked]:before {
+  background-color: #CCC;
+  background-image: url('data:image/svg+xml;utf8,<svg fill="%23FFFFFF" version="1.1" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m8.4856 20.274-6.736-6.736 2.9287-2.7823 3.8073 3.8073 10.836-10.836 2.9287 2.9287z" stroke-width="1.4644"/></svg>');
+  background-position: 50% 50%;
+  background-size: 100% 100%;
+}
+
 // Editor form elements
 .editor-form-field-wrapper {
   margin-bottom: .5rem;
@@ -394,6 +485,55 @@ textarea.editor-form-field-input {
     box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.1);
   }
 }
+.editor-form-tab-container {
+  display: flex;
+  flex-direction: row;
+  gap: 2rem;
+}
+.editor-form-tab-controls {
+  display: flex;
+  flex-direction: column;
+  align-items: stretch;
+  gap: .25rem;
+}
+.editor-form-tab-control {
+  font-weight: bold;
+  font-size: 14px;
+  color: #444;
+  border-bottom: 2px solid transparent;
+  position: relative;
+  cursor: pointer;
+  padding: .25rem .5rem;
+  text-align: start;
+  &[aria-selected="true"] {
+    border-color: var(--editor-color-primary);
+    color: var(--editor-color-primary);
+  }
+  &[aria-selected="true"]:after, &:hover:after {
+    background-color: var(--editor-color-primary);
+    opacity: .15;
+    content: '';
+    display: block;
+    position: absolute;
+    left: 0;
+    top: 0;
+    width: 100%;
+    height: 100%;
+  }
+}
+.editor-form-tab-contents {
+  width: 360px;
+}
+.editor-action-input-container {
+  display: flex;
+  flex-direction: row;
+  align-items: end;
+  justify-content: space-between;
+  gap: .1rem;
+  .editor-button {
+    margin-bottom: 12px;
+  }
+}
 
 // Editor theme styles
 .editor-theme-bold {