X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a6633642232efd164d4708967ab59e498fbff896..refs/pull/3365/head:/resources/sass/_tinymce.scss diff --git a/resources/sass/_tinymce.scss b/resources/sass/_tinymce.scss index dfaf6683e..0ee3fa40b 100644 --- a/resources/sass/_tinymce.scss +++ b/resources/sass/_tinymce.scss @@ -1,5 +1,6 @@ -.mce-tinymce.mce-container.mce-fullscreen { +// Custom full screen mode +.tox.tox-fullscreen { position: fixed; top: 0; height: 100%; @@ -8,71 +9,139 @@ z-index: 100; } -.mce-tinymce { - .mce-panel { - @include lightDark(background-color, #fff, #333); - } - .mce-btn { - @include lightDark(background-color, #fff, #333); - } +// In editor body overrides +.page-content.mce-content-body { + padding-block-start: 1rem; + padding-block-end: 1rem; + outline: 0; + display: block; } -.mce-container-body.mce-flow-layout { - text-align: center; +// Default styles for our custom root nodes +.page-content.mce-content-body doc-root { + display: block; } - -@include smaller-than($l) { - .mce-container-body.mce-flow-layout { - overflow-x: scroll; - white-space: nowrap; - } +.page-content.mce-content-body code-block { + display: block; } -.edit-area.flex > div > .mce-tinymce.mce-container.mce-panel { - flex: 1 1 auto; - display: flex !important; - flex-direction: column; - align-items: stretch; - margin: 0 -1px; - > .mce-container-body { - flex: 1 1 auto; - display: flex !important; - flex-direction: column; - align-items: stretch; - > .mce-toolbar-grp { - flex: 0 1 auto; - } - > .mce-edit-area { - flex: 1 1 auto; - display: flex !important; - flex-direction: column; - align-items: stretch; - -webkit-overflow-scrolling:touch; - overflow:auto; - iframe { - flex: 1; - // Force TinyMCE iframe to render on its own layer - // for much greater performance in Safari - will-change: transform; - } - } - } -} +// In editor line height override .page-content.mce-content-body p { line-height: 1.6; } -.page-content.mce-content-body { - padding-top: 16px; - outline: none; +// Pad out bottom of editor +body.page-content.mce-content-body { + padding-bottom: 5rem; } -// Fix to prevent 'No color' option from not being clickable. -.mce-colorbtn-trans { - overflow: hidden; +// Center toolbar items +.tox-toolbar__primary { + justify-content: center; } -// Fix to prevent CodeMirror focus events throwing TinyMCE cursor position. -.mce-content-body .CodeMirrorContainer > .CodeMirror { +// Prevent scroll jumps on codemirror clicks +.page-content.mce-content-body code-block > * { pointer-events: none; +} +.page-content.mce-content-body code-block pre { + display: none; +} + +// Details/summary editor usability +.page-content.mce-content-body details summary { + pointer-events: none; +} +.page-content.mce-content-body details doc-root { + padding: $-s; + margin-left: (2px - $-s); + margin-right: (2px - $-s); + margin-bottom: (2px - $-s); + margin-top: (2px - $-s); + overflow: hidden; +} + +/** + * Dark Mode Overrides + */ +.dark-mode .tox .tox-toolbar__primary, +.dark-mode .tox .tox-menu, +.dark-mode .tox .tox-dialog__header, +.dark-mode .tox .tox-dialog, +.dark-mode .tox .tox-dialog__footer, +.dark-mode .tox .tox-pop__dialog, +.dark-mode .tox.tox-tinymce-aux .tox-toolbar__overflow { + background-color: #333; +} +.dark-mode .tox .tox-tbtn svg, +.dark-mode .tox .tox-tbtn, +.dark-mode .tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled) +{ + color: #dbdbdb; + fill: #dbdbdb; +} + + + +/** + * Format Menu Hacks + */ +.tox .tox-tbtn--bespoke .tox-tbtn__select-label { + width: 6em !important; +} +.tox-menu .tox-collection__item blockquote::before { + content: none; +} +.tox-menu .tox-collection__item blockquote { + border-left: 4px solid var(--color-primary) !important; + padding: 4px 6px !important; +} +.tox-menu .tox-collection__item blockquote { + border-left: 4px solid var(--color-primary) !important; + padding: 4px 6px !important; +} +.tox-menu .tox-collection__item p[style*="background-color"] { + padding: 4px 6px !important; + border-left: 3px solid currentColor !important; +} +.tox-menu .tox-collection__item[title^="<"] > div > div { + font-family: $mono !important; + border: 1px solid #DDD !important; + background-color: #EEE !important; + padding: 4px 6px !important; +} +.tox-menu .tox-collection__item-label { + line-height: normal !important; +} + +/** + * Fake task list checkboxes + */ +.page-content.mce-content-body .task-list-item { + margin-left: 0; + position: relative; +} +.page-content.mce-content-body .task-list-item > input[type="checkbox"] { + display: none; +} +.page-content.mce-content-body .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; +} + +.page-content.mce-content-body .task-list-item[checked]:before { + background-color: #CCC; + background-image: url('data:image/svg+xml;utf8,'); + background-position: 50% 50%; + background-size: 100% 100%; } \ No newline at end of file