mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-26 04:05:57 +00:00
![Dan Brown](/assets/img/avatar_default.png)
Code blocks in tinymce could sometimes end up exploded into the sub elements of the codemirror display. This changes the strategy to render codemirror within the shadow dom of a custom element while preserving the normal pre/code DOM structure. Still a little instability when moving/adding code blocks within details blocks but much harder to break things now.
115 lines
2.6 KiB
SCSS
115 lines
2.6 KiB
SCSS
|
|
// Custom full screen mode
|
|
.tox.tox-fullscreen {
|
|
position: fixed;
|
|
top: 0;
|
|
height: 100%;
|
|
width: 100%;
|
|
max-width: 100%;
|
|
z-index: 100;
|
|
}
|
|
|
|
// In editor body overrides
|
|
.page-content.mce-content-body {
|
|
padding-block-start: 1rem;
|
|
padding-block-end: 1rem;
|
|
outline: 0;
|
|
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;
|
|
}
|
|
|
|
// 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
|
|
*/
|
|
.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;
|
|
} |