Skip to content

Commit d24d262

Browse files
mejo-juliusknorr
authored andcommitted
fix(css): Move code highlighting CSS to prosemirror.scss
Fixes syntax highlighting in readonly and non-file editors. Signed-off-by: Jonas <[email protected]>
1 parent 9c786ef commit d24d262

File tree

2 files changed

+54
-60
lines changed

2 files changed

+54
-60
lines changed

css/prosemirror.scss

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,60 @@ div.ProseMirror {
174174
border-radius: var(--border-radius);
175175
padding: 1em 1.3em;
176176
margin-bottom: 1em;
177+
178+
&::before {
179+
content: attr(data-language);
180+
text-transform: uppercase;
181+
display: block;
182+
text-align: right;
183+
font-weight: bold;
184+
font-size: 0.6rem;
185+
}
186+
code {
187+
.hljs-comment,
188+
.hljs-quote {
189+
color: #999999;
190+
}
191+
.hljs-variable,
192+
.hljs-template-variable,
193+
.hljs-attribute,
194+
.hljs-tag,
195+
.hljs-name,
196+
.hljs-regexp,
197+
.hljs-link,
198+
.hljs-selector-id,
199+
.hljs-selector-class {
200+
color: #f2777a;
201+
}
202+
.hljs-number,
203+
.hljs-meta,
204+
.hljs-built_in,
205+
.hljs-builtin-name,
206+
.hljs-literal,
207+
.hljs-type,
208+
.hljs-params {
209+
color: #f99157;
210+
}
211+
.hljs-string,
212+
.hljs-symbol,
213+
.hljs-bullet {
214+
color: #99cc99;
215+
}
216+
.hljs-title,
217+
.hljs-section {
218+
color: #ffcc66;
219+
}
220+
.hljs-keyword,
221+
.hljs-selector-tag {
222+
color: #6699cc;
223+
}
224+
.hljs-emphasis {
225+
font-style: italic;
226+
}
227+
.hljs-strong {
228+
font-weight: 700;
229+
}
230+
}
177231
}
178232

179233
pre.frontmatter {

src/components/Editor.vue

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -810,66 +810,6 @@ export default {
810810
.text-editor__wrapper {
811811
@import './../../css/prosemirror';
812812
813-
.ProseMirror {
814-
pre {
815-
background-color: var(--color-main-background);
816-
817-
&::before {
818-
content: attr(data-language);
819-
text-transform: uppercase;
820-
display: block;
821-
text-align: right;
822-
font-weight: bold;
823-
font-size: 0.6rem;
824-
}
825-
code {
826-
.hljs-comment,
827-
.hljs-quote {
828-
color: #999999;
829-
}
830-
.hljs-variable,
831-
.hljs-template-variable,
832-
.hljs-attribute,
833-
.hljs-tag,
834-
.hljs-name,
835-
.hljs-regexp,
836-
.hljs-link,
837-
.hljs-selector-id,
838-
.hljs-selector-class {
839-
color: #f2777a;
840-
}
841-
.hljs-number,
842-
.hljs-meta,
843-
.hljs-built_in,
844-
.hljs-builtin-name,
845-
.hljs-literal,
846-
.hljs-type,
847-
.hljs-params {
848-
color: #f99157;
849-
}
850-
.hljs-string,
851-
.hljs-symbol,
852-
.hljs-bullet {
853-
color: #99cc99;
854-
}
855-
.hljs-title,
856-
.hljs-section {
857-
color: #ffcc66;
858-
}
859-
.hljs-keyword,
860-
.hljs-selector-tag {
861-
color: #6699cc;
862-
}
863-
.hljs-emphasis {
864-
font-style: italic;
865-
}
866-
.hljs-strong {
867-
font-weight: 700;
868-
}
869-
}
870-
}
871-
}
872-
873813
// relative position for the alignment of the menububble
874814
.text-editor__main {
875815
&.draggedOver {

0 commit comments

Comments
 (0)