2020-04-10 17:38:29 -04:00
|
|
|
/**
|
2023-04-16 11:05:16 -04:00
|
|
|
* Custom CodeMirror BookStack overrides
|
2020-04-10 17:38:29 -04:00
|
|
|
*/
|
|
|
|
|
2023-04-16 11:05:16 -04:00
|
|
|
.cm-editor {
|
2017-05-28 08:16:21 -04:00
|
|
|
font-size: 12px;
|
2023-04-18 08:41:28 -04:00
|
|
|
border: 1px solid #ddd;
|
2023-04-16 11:05:16 -04:00
|
|
|
line-height: 1.4;
|
2023-04-18 10:08:17 -04:00
|
|
|
margin-bottom: $-l;
|
2023-04-18 09:21:22 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
.page-content .cm-editor,
|
|
|
|
.CodeMirrorContainer .cm-editor {
|
2023-04-16 11:05:16 -04:00
|
|
|
border-radius: 4px;
|
2018-06-09 05:41:01 -04:00
|
|
|
}
|
|
|
|
|
2023-06-14 07:53:48 -04:00
|
|
|
.cm-editor .cm-line, .cm-editor .cm-gutter {
|
|
|
|
font-family: var(--font-code);
|
|
|
|
}
|
|
|
|
|
2023-04-18 08:41:28 -04:00
|
|
|
// 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;
|
|
|
|
}
|
|
|
|
|
2018-06-09 05:41:01 -04:00
|
|
|
/**
|
|
|
|
* Custom Copy Button
|
|
|
|
*/
|
2023-04-14 09:08:40 -04:00
|
|
|
.cm-copy-button {
|
2018-06-09 05:41:01 -04:00
|
|
|
position: absolute;
|
2023-04-16 11:05:16 -04:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2018-06-09 05:41:01 -04:00
|
|
|
top: -1px;
|
|
|
|
right: -1px;
|
|
|
|
background-color: #EEE;
|
2020-04-10 17:38:29 -04:00
|
|
|
border: 1px solid #DDD;
|
2023-04-16 11:05:16 -04:00
|
|
|
border-radius: 0 4px 0 0;
|
2020-04-10 17:38:29 -04:00
|
|
|
@include lightDark(background-color, #eee, #333);
|
|
|
|
@include lightDark(border-color, #ddd, #444);
|
2023-04-16 11:05:16 -04:00
|
|
|
@include lightDark(color, #444, #888);
|
2018-06-09 05:41:01 -04:00
|
|
|
line-height: 0;
|
|
|
|
cursor: pointer;
|
|
|
|
z-index: 5;
|
|
|
|
user-select: none;
|
2018-09-22 09:55:33 -04:00
|
|
|
opacity: 0;
|
|
|
|
pointer-events: none;
|
2023-04-16 11:05:16 -04:00
|
|
|
width: 32px;
|
|
|
|
height: 32px;
|
|
|
|
transition: background-color linear 60ms, color linear 60ms;
|
2018-06-09 05:41:01 -04:00
|
|
|
svg {
|
2023-04-16 11:05:16 -04:00
|
|
|
fill: currentColor;
|
2018-06-09 05:41:01 -04:00
|
|
|
}
|
|
|
|
&.success {
|
2023-06-13 10:52:33 -04:00
|
|
|
background: var(--color-positive);
|
2023-04-16 11:05:16 -04:00
|
|
|
color: #FFF;
|
|
|
|
}
|
|
|
|
&:focus {
|
|
|
|
outline: 0 !important;
|
2018-06-09 05:41:01 -04:00
|
|
|
}
|
|
|
|
}
|
2023-04-14 09:08:40 -04:00
|
|
|
.cm-editor:hover .cm-copy-button {
|
2018-06-09 05:41:01 -04:00
|
|
|
user-select: all;
|
2023-04-16 11:05:16 -04:00
|
|
|
opacity: .6;
|
2018-09-22 09:55:33 -04:00
|
|
|
pointer-events: all;
|
2017-05-28 11:02:46 -04:00
|
|
|
}
|