8000 docs(css): translate sass related content (#4396) [ci skip] · vuejs/vue-cli@78f5a5d · GitHub
[go: up one dir, main page]

Skip to content

Commit 78f5a5d

Browse files
QC-Lhaoqunjiang
authored andcommitted
docs(css): translate sass related content (#4396) [ci skip]
1 parent 39e071d commit 78f5a5d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

docs/zh/guide/css.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Vue CLI 项目天生支持 [PostCSS](http://postcss.org/)、[CSS Modules](https:
1212

1313
``` bash
1414
# Sass
15-
npm install -D sass-loader node-sass
15+
npm install -D sass-loader sass
1616

1717
# Less
1818
npm install -D less-loader less
@@ -29,6 +29,14 @@ $color: red;
2929
</style>
3030
```
3131

32+
::: tip Sass 性能贴士
33+
请注意,当使用 Dart 版本的 Sass 时,默认情况下,**同步编译的速度为异步编译速度的两倍**,这是由于异步回调造成的性能开销。为避免此开销,你可以使用 [fibers](https://www.npmjs.com/package/fibers) 的 package 在异步环境下使用同步的代码。要启用此功能,只需安装 `fibers` 到项目依赖:
34+
```
35+
npm install -D fibers
36+
```
37+
另外请注意,由于这是一个原生模块,因此 OS 与构建环境之间可能存在兼容问题。如果遇到此问题,请执行 `npm uninstall -D fibers` 来解决此问题。
38+
:::
39+
3240
### 自动化导入
3341

3442
如果你想自动化导入文件 (用于颜色、变量、mixin……),你可以使用 [style-resources-loader](https://github.com/yenshih/style-resources-loader)。这里有一个关于 Stylus 的在每个单文件组件和 Stylus 文件中导入 `./src/styles/imports.styl` 的例子:

0 commit comments

Comments
 (0)
0