简体   繁体   English

VS Code CSS配置预览不适用于Markdown工作区设置

[英]VS Code CSS Configuration Preview Not Working With Markdown Workspace Settings

Issue 问题

CSS styling is not displaying in the the VS Code preview for Markdown files despite being configured under the Workspace Settings per the VS Code documentation Extending the Markdown preview . 尽管在VS Code文档扩展Markdown预览工作区设置下配置了CSS样式,但Markdown文件的VS样式预览中并未显示CSS样式。

Expected 预期

Here is how the published Markdown file media.md displays when being hosted. 这是托管时已发布的Markdown文件media.md的显示方式。

Note: Green border added to highlight Markdown code. 注意:添加了绿色边框以突出显示Markdown代码。

在此处输入图片说明

Result 结果

Here is how the Markdown file media.md displays in the VS Code preview. 这是Markdown文件media.md在VS Code预览中的显示方式。

Note: Green border added to highlight Markdown code. 注意:添加了绿色边框以突出显示Markdown代码。

在此处输入图片说明

Setup 设定

Workspace Structure 工作空间结构

The Markdown file attempting to be styled with assets/css/style.scss is media.md . 尝试使用asset / css / style.scss设置样式的Markdown文件为media.md

在此处输入图片说明

Workspace Settings 工作区设置

This is configured under Workspace Settings as opposed to User Settings . 这是在“ 工作区设置”下而不是“ 用户设置”下配置的。

{
    "markdown.styles": [
        "assets/css/style.scss"
    ]
}

It looks like the "markdown.styles": [] setting of VSC is particularly for CSS, not SCSS. 它看起来像 "markdown.styles": [] VSC的"markdown.styles": []设置特别适用于CSS,而不是SCSS。

You can use Sass to process your *.scss into *.css files that the VSC Markdown preview will be able to understand. 您可以使用Sass*.scss为VSC Markdown预览可以理解的*.css文件。

From the looks of it, though, it seems you're working on a Jekyll site (I see a _config.yml Jekyll configuration file). 但是,从外观上看,您似乎正在使用Jekyll站点(我看到了_config.yml Jekyll配置文件)。 In that case, serving your Jekyll site locally to preview changes may be a better option. 在这种情况下,最好在本地为您的Jekyll网站提供服务以预览更改。


PS it would be easier to parse your question if the Markdown screenshots had a border around them to better differentiate between them and the details of the question itself :) PS:如果Markdown屏幕截图周围有边框,则可以更轻松地解析您的问题,以便更好地区分它们和问题本身的细节:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM