sass - Webstorm 6 - 如何使 scss 文件观察器忽略文件

标签 sass webstorm

我希望 SCSS 文件的文件观察器忽略文件名以下划线开头的文件,例如 _buttons.scss。

我该怎么做?

最佳答案

首先向您想要忽略的文件添加 _...完成!来自 documentation :

Partials

If you have a SCSS or Sass file that you want to import but don’t want to compile to a CSS file, you can add an underscore to the beginning of the filename. This will tell Sass not to compile it to a normal CSS file. You can then import these files without using the underscore.

For example, you might have _colors.scss. Then no _colors.css file would be created, and you can do

@import "colors";

所以添加下划线就可以了。只是不要导入。

请小心命名文件,因为如果您有 style.scss_style.scss Sass 会将它们视为相同的文件名并引发错误:

>>> Change detected to: /Users/allcaps/test/style.scss
WARNING: In /Users/allcaps/test:
  There are multiple files that match the name "style.scss":
    _style.scss
    style.scss

一个简单的解决方法是添加两个下划线:__style.scss

关于sass - Webstorm 6 - 如何使 scss 文件观察器忽略文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18905242/

相关文章:

css - compass 监听器错误

php - Gulp-webapp 运行 BrowserSync 和 PHP

css - 如何在 scss 中实现可切换的主题?

css - 为 SASS 文本阴影添加不透明度

node.js - WebStorm/grunt 调试运行抛出 EADDRINUSE 错误

webstorm - WebStorm block 注释中的前导空格

html - BEM 类(class)太多?

javascript - WebStorm - 制作 node_modules "library root"但也将其排除在索引之外

less - 如何在 WebStorm 中为嵌入式 LESS 样式启用语法高亮显示?

eclipse - WebStorm 中 Eclipse 的 Alt+左/右箭头键相当于什么?