简体   繁体   English

sass @import“指南针/重置”错误

[英]sass @import “compass/reset” error

I'd like to use Sass with Compass on my static HTML project, but following the instructions does not work.我想在我的 static HTML 项目上将 Sass 与 Compass 一起使用,但按照说明不起作用。 This is what I did:这就是我所做的:

$ gem install compass
$ cd <myproject>
$ compass install compass .

which was following by awaiting:这是通过等待:

directory ./sass/
directory ./stylesheets/
   create ./sass/screen.scss 
   create ./sass/print.scss 
   create ./sass/ie.scss 
   create ./stylesheets/screen.css 
   create ./stylesheets/ie.css 
   create ./stylesheets/print.css 

But when I start watching scss sass --watch sass:stylesheets , I get an error:但是当我开始看 scss sass --watch sass:stylesheets时,我得到一个错误:

error sass/screen.scss (Line 6: File to import not found or unreadable: compass/reset.

This msg coherent with @import "compass/reset";此消息与@import "compass/reset" 一致;

What do I have to do on my Ubuntu to see that compass imports?我必须在我的 Ubuntu 上做什么才能看到指南针导入?

Use compass watch instead of sass --watch sass:stylesheets .使用compass watch代替sass --watch sass:stylesheets If you're using compass, you don't need to bother with sass command.如果您使用的是指南针,则无需使用 sass 命令。 Just use the compass command .只需使用指南针命令

if you really wanted to use sass command i use this code.如果您真的想使用 sass 命令,我使用此代码。 Considering that you are in your sass directory running the following command.考虑到您在运行以下命令的 sass 目录中。

sass --watch style.scss:../stylesheets/ sass --watch style.scss:../stylesheets/

That simply means that I have created a new file called style.scss and imported the following files within my style.scss.这仅仅意味着我创建了一个名为style.scss的新文件,并在我的 style.scss 中导入了以下文件。 So sass would only watch a single file.所以 sass 只会看一个文件。 In the above command we wishes to have the generated style.css to be in the stylesheet directory.在上述命令中,我们希望将生成的 style.css 放在样式表目录中。

again its sass --watch style.scss:/path-to-output-directory/再次是它的sass --watch style.scss:/path-to-output-directory/

 @import "ie"; @import "print"; @import "screen";

so in this process sass is only watching single file style.scss for any changes within sass directory files.所以在这个过程中 sass 只关注单个文件 style.scss 中 sass 目录文件中的任何更改。

I hope this explains well.我希望这能很好地解释。

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

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