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

vscode无法识别scss文件 #32

Open
zhangslTHU opened this issue Apr 25, 2024 · 4 comments
Open

vscode无法识别scss文件 #32

zhangslTHU opened this issue Apr 25, 2024 · 4 comments
Labels
question Further information is requested

Comments

@zhangslTHU
Copy link

感谢作者的模板。
之前1.2版本在vscode上可以正常使用,但1.3版本更新后,vscode无法识别scss文件的主题(图1)。把scss文件后缀改成css后,预览的结果很奇怪(图2)。虽然vscode官网说”Visual Studio Code has built-in support for editing style sheets in CSS .css, SCSS .scss and Less .less.“,但实际操作中确实是因为scss文件无法实现之前的预览效果。
p1
p2

@favourhong
Copy link
Owner

应该不是SCSS文件的问题,我这边预览起来都没有问题,可以尝试以下两个解决思路(出现无法预览的问题,大概率是这两个情况):

  1. 使用VScode直接打开Awesome-Marp-main文件夹
  2. 如果开启了Markdown Enhanced Preview插件,需要卸载或停用

@favourhong favourhong added the question Further information is requested label Apr 25, 2024
@zhangslTHU
Copy link
Author

非常感谢作者的解答,第一种方法:直接打开Awesome-Marp-main文件夹,可以解决问题~
但该种方法只适用project在Awesome-Marp-main文件夹下,如果常规情况,在其它目录新建project,方法一不能很好的解决,这可能是因为.vscode文件夹下的setting.json文件不能被识别(即使修改json文件的相对路径也不可以)。
我后来试了一个简单粗暴的方法,直接将themes文件下的am_template.scss和am_color.scss合并成一个新的am_color.css文件,可以解决该问题。

@sukiElaina
Copy link

这个问题出在setting.json文件内部,"./themes/am_template.scss",意思是返回上一目录再在该目录下寻找themes文件夹,如果.vscode文件夹和theme文件夹在同一目录下,需要改成"themes/am_template.scss"。即删除./就能正常索引了

@Andrew955
Copy link

可以尝试在vscode里"文件"-"打开文件夹"-选择-"Awesome-Marp-main",然后在vscode的资源管理器里打开.md文件,此时scss可以完美渲染

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

No branches or pull requests

4 participants