作者:叨B叨B叨叨叨 | 来源:互联网 | 2023-05-18 23:58
Pleaserefertothecsssectionofthiscodepen:请参阅此codepen的css部分:http:codepen.ioanonpenJddz
Please refer to the css section of this codepen:
请参阅此codepen的css部分:
http://codepen.io/anon/pen/JddzEJ
it has a bunch of sass code.
它有一堆sass代码。
I am trying to run that on my local machine. I install sass and compass using gem.
我想在我的本地机器上运行它。我使用gem安装sass和指南针。
After that I ran the following command on the terminal:
之后我在终端上运行了以下命令:
sass --watch slider.scss:slider.css
Now this is the error that it reports:
现在这是它报告的错误:
error slider.scss (Line 156: Undefined operation: "1.27273em times 1cos(115.71429deg)".)
I do not want to copy and paste the entire 200 line scss file hence I am pasting the section where the error appears:
我不想复制并粘贴整个200行scss文件,因此我粘贴出现错误的部分:
@for $i from 0 through $tip-cp-n {
$ang-curr: $tip-bubble-ang-ref + $i*$tip-cp-ang-base;
@if $ang-curr >= $tip-bubble-ang-s and $ang-curr <= $tip-bubble-ang-e {
$x: $tip-bubble-rx*(1 + cos($ang-curr)); <-- line 156
$y: $tip-bubble-ry*(1 + sin($ang-curr));
$tip-cp: $tip-cp, $x $y !global;
}
}
I there some other addon that I require here ?
我还需要其他一些插件吗?
1 个解决方案
You would not use sass --watch
as you mentioned above to watch and compile changes. In this case, you are receiving that error because only Sass is doing the compilation for you, and doesn't know anything about that Compass command. With Compass projects, you need to do a few things.
你不会像上面提到的那样使用sass -watch来观察和编译变化。在这种情况下,您收到该错误,因为只有Sass正在为您进行编译,并且对该Compass命令一无所知。使用Compass项目,您需要做一些事情。
Make sure the project directory was created with the Compass command.
确保使用Compass命令创建项目目录。
compass create
, for example compass create compass-test
指南针创建
,例如指南针创建指南针测试
This will create the proper framework for your Compass project, including automatically creating a /sass
directory and .scss
files within it, as well as the config.rb
file that defines the various paths and outputs for compiled files.
这将为Compass项目创建适当的框架,包括在其中自动创建/ sass目录和.scss文件,以及定义编译文件的各种路径和输出的config.rb文件。
Change into the directory and then run compass watch
to watch for changes.
切换到目录,然后运行指南针监视以观察更改。
You should then see in terminal "Compass is watching for changes. Press Ctrl-C to Stop."
This means it's running.
然后你应该在终端看到“指南针正在观察变化。按Ctrl-C停止。”这意味着它正在运行。
You can now make changes to the .scss
files within the /sass
directory.
您现在可以更改/ sass目录中的.scss文件。