]> BookStack Code Mirror - bookstack/blob - resources/sass/_codemirror.scss
Searching: Added test for guillemets
[bookstack] / resources / sass / _codemirror.scss
1 @use "mixins";
2 @use "vars";
3
4 /**
5  * Custom CodeMirror BookStack overrides
6  */
7
8 .cm-editor {
9   font-size: 12px;
10   border: 1px solid #ddd;
11   line-height: 1.4;
12   margin-bottom: vars.$l;
13 }
14
15 .page-content .cm-editor,
16 .CodeMirrorContainer .cm-editor {
17   border-radius: 4px;
18 }
19
20 .cm-editor .cm-line {
21   line-height: 1.6;
22 }
23
24 .cm-editor .cm-line, .cm-editor .cm-gutter {
25   font-family: var(--font-code);
26 }
27
28 // Manual dark-mode definition so that it applies to code blocks within the shadow
29 // dom which are used within the WYSIWYG editor, as the .dark-mode on the parent
30 // <html> node are not applies so instead we have the class on the parent element.
31 .dark-mode .cm-editor {
32   border-color: #444;
33 }
34
35 /**
36  * Custom Copy Button
37  */
38 .cm-copy-button {
39   position: absolute;
40   display: flex;
41   align-items: center;
42   justify-content: center;
43   top: -1px;
44   inset-inline-end: -1px;
45   background-color: #EEE;
46   border: 1px solid #DDD;
47   border-start-end-radius: 4px;
48   @include mixins.lightDark(background-color, #eee, #333);
49   @include mixins.lightDark(border-color, #ddd, #444);
50   @include mixins.lightDark(color, #444, #888);
51   line-height: 0;
52   cursor: pointer;
53   z-index: 5;
54   user-select: none;
55   opacity: 0;
56   pointer-events: none;
57   width: 32px;
58   height: 32px;
59   transition: background-color linear 60ms, color linear 60ms;
60   svg {
61     fill: currentColor;
62   }
63   &.success {
64     background: var(--color-positive);
65     color: #FFF;
66   }
67   &:focus {
68     outline: 0 !important;
69   }
70 }
71 .cm-editor:hover .cm-copy-button  {
72   user-select: all;
73   opacity: .6;
74   pointer-events: all;
75 }