3e738b1471
- Fixed some keybindings not running as expected, due to some editor defaults overriding or further actions taking place since the action would not indicate it's been dealt with (by returning boolean). - Fixed spacing/border-radius being used on codeblocks on non-intended areas like the MD editor. - Fixed lack of BG on default light theme, visible on full screen md editor. - Fixed error thrown when the user does not have access to change the current editor (Likely non-cm related existing issue)
64 lines
No EOL
1.3 KiB
SCSS
64 lines
No EOL
1.3 KiB
SCSS
/**
|
|
* Custom CodeMirror BookStack overrides
|
|
*/
|
|
|
|
.cm-editor {
|
|
font-size: 12px;
|
|
border: 1px solid #ddd;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.page-content .cm-editor,
|
|
.CodeMirrorContainer .cm-editor {
|
|
margin-bottom: $-l;
|
|
border-radius: 4px;
|
|
}
|
|
|
|
// Manual dark-mode definition so that it applies to code blocks within the shadow
|
|
// dom which are used within the WYSIWYG editor, as the .dark-mode on the parent
|
|
// <html> node are not applies so instead we have the class on the parent element.
|
|
.dark-mode .cm-editor {
|
|
border-color: #444;
|
|
}
|
|
|
|
/**
|
|
* Custom Copy Button
|
|
*/
|
|
.cm-copy-button {
|
|
position: absolute;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
top: -1px;
|
|
right: -1px;
|
|
background-color: #EEE;
|
|
border: 1px solid #DDD;
|
|
border-radius: 0 4px 0 0;
|
|
@include lightDark(background-color, #eee, #333);
|
|
@include lightDark(border-color, #ddd, #444);
|
|
@include lightDark(color, #444, #888);
|
|
line-height: 0;
|
|
cursor: pointer;
|
|
z-index: 5;
|
|
user-select: none;
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
width: 32px;
|
|
height: 32px;
|
|
transition: background-color linear 60ms, color linear 60ms;
|
|
svg {
|
|
fill: currentColor;
|
|
}
|
|
&.success {
|
|
background: $positive;
|
|
color: #FFF;
|
|
}
|
|
&:focus {
|
|
outline: 0 !important;
|
|
}
|
|
}
|
|
.cm-editor:hover .cm-copy-button {
|
|
user-select: all;
|
|
opacity: .6;
|
|
pointer-events: all;
|
|
} |