X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/84c501bcf4bdd4c672c1d2d41f538b19dd5a1859..refs/pull/3391/head:/resources/sass/_tinymce.scss diff --git a/resources/sass/_tinymce.scss b/resources/sass/_tinymce.scss index d64e0e63d..0ee3fa40b 100644 --- a/resources/sass/_tinymce.scss +++ b/resources/sass/_tinymce.scss @@ -1,4 +1,5 @@ +// Custom full screen mode .tox.tox-fullscreen { position: fixed; top: 0; @@ -8,6 +9,7 @@ z-index: 100; } +// In editor body overrides .page-content.mce-content-body { padding-block-start: 1rem; padding-block-end: 1rem; @@ -15,18 +17,72 @@ display: block; } +// Default styles for our custom root nodes +.page-content.mce-content-body doc-root { + display: block; +} +.page-content.mce-content-body code-block { + display: block; +} + +// In editor line height override .page-content.mce-content-body p { line-height: 1.6; } -.page-content.mce-content-body > :last-child { - margin-bottom: 5rem; +// Pad out bottom of editor +body.page-content.mce-content-body { + padding-bottom: 5rem; } +// Center toolbar items .tox-toolbar__primary { justify-content: center; } +// 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 */ @@ -56,4 +112,36 @@ } .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