我在 SCSS 文件中导入常规 CSS 文件,但是?

alo*_*oky 6 css sass

我在 scss 中导入 @import "./libs/bootstrap-select.css";

给出构建后 @import url(./libs/bootstrap-select.css);

我需要文件中的 css 代码

如果以 scss@import "./libs/bootstrap-select";规范导入,但是

DEPRECATION WARNING on line 1, column 8 of /libsass/test.scss: Including .css files with @import is non-standard behaviour which will be removed in future versions of LibSass. Use a custom importer to maintain this behaviour. Check your implementations documentation on how to create a custom importer.

Tor*_*giu -1

导入对 *.scss 的作用与对 *.css 文件的作用相同 - 只需省略扩展名:

这将导入 file.css

如果这不起作用,请将扩展名从 .css 文件更改为 .scss 并导入它@import "yourfile";

  • 嗯,它不起作用,并且并不总是可以重命名 css -> scss (当文件属于外部库时)。 (4认同)