Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

引入了highlight对应主题的css但是没法正常显示 #62

Open
YinanZhaoXometry opened this issue Jan 19, 2019 · 3 comments
Open

Comments

@YinanZhaoXometry
Copy link

引入了highlight.js然后加载到了window上:

import hljs from 'highlight.js'
window.hljs = hljs

引入了css但是不起作用:

@import 'highlight.js/styles/atom-one-dark.css';

只能再引入详细的背景和字体的颜色才行:

  /*修改代码块背景色及字体颜色*/
  .theme .editor-preview-side pre, .theme .editor-preview pre{
    color: #abb2bf !important;
    background: #282c34 !important;
  }

很喜欢这个编辑器,希望能继续维护!

@F-loat
Copy link
Owner

F-loat commented Jan 19, 2019

引用顺序有问题没

@import '~simplemde/dist/simplemde.min.css';
@import '~highlight.js/styles/atom-one-dark.css';

@YinanZhaoXometry
Copy link
Author

YinanZhaoXometry commented Jan 24, 2019

引用顺序如下:

  @import 'simplemde/dist/simplemde.min.css';
  @import 'github-markdown-css';
  @import 'highlight.js/styles/atom-one-dark.css';

我上面写的看了vue-simplemde仓库里的Demo Source,才学习到的:

/*修改代码块背景色及字体颜色*/
  .theme .editor-preview-side pre, .theme .editor-preview pre{
    color: #abb2bf !important;
    background: #282c34 !important;
  }

有没有可能不再单独覆盖背景和字体样式?

@pdt590
Copy link

pdt590 commented Feb 7, 2020

+1 - I had same issue. Code does not highlight when i set up as your tutorial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants