在 SCSS 文件中导入常规 CSS 文件? [英] Import regular CSS file in SCSS file?
问题描述
有没有办法用 Sass 的 @import
命令导入一个普通的 CSS 文件?虽然我没有使用 sass 的所有 SCSS 语法,但我仍然喜欢它的组合/压缩功能,并且希望能够在不将所有文件重命名为 *.scss 的情况下使用它
Is there anyway to import a regular CSS file with Sass's @import
command? While I'm not using all of the SCSS syntax from sass, I do still enjoy it's combining/compressing features, and would like to be able to use it without renaming all of my files to *.scss
推荐答案
在撰写本文时,这似乎尚未实现:
Looks like this is unimplemented, as of the time of this writing:
https://github.com/sass/sass/issues/193罢工>
对于 libsass(C/C++ 实现),导入对 *.css
的作用与对 *.scss
文件的作用相同 - 只需省略扩展名:
For libsass (C/C++ implementation), import works for *.css
the same way as for *.scss
files - just omit the extension:
@import "path/to/file";
这将导入path/to/file.css
.
请参阅此答案了解更多详情.
请参阅此答案了解 Ruby 实现 (sass gem)
See this answer for Ruby implementation (sass gem)
这篇关于在 SCSS 文件中导入常规 CSS 文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!