问题:
我正在更新使用Compass创建的网站。我安装了Compass,然后运行以下命令将Compass与我现有的项目一起设置。接下来,我将Compass导入到我的global.scss文件中。 SASS-Autocompile (文本编辑器Atom的程序包)无法找到该文件并引发编译错误。我不确定这是设置罗盘的问题,还是SASS-Autocompile的问题。以下是我采取的步骤,直到现在。
compass create --sass-dir "scss" --css-dir "css" --images-dir "images"
输出:
*********************************************************************
Congratulations! Your compass project has been created.
You may now add and edit sass stylesheets in the scss subdirectory of your project.
Sass files beginning with an underscore are called partials and won't be
compiled to CSS, but they can be imported into other sass stylesheets.
You can configure your project by editing the config.rb configuration file.
You must compile your sass stylesheets into CSS when they change.
This can be done in one of the following ways:
1. To compile on demand:
compass compile [path/to/project]
2. To monitor your project for changes and automatically recompile:
compass watch [path/to/project]
More Resources:
* Website: http://compass-style.org/
* Sass: http://sass-lang.com
* Community: http://groups.google.com/group/compass-users/
To import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:
<head>
<link href="/css/screen.css" media="screen, projection" rel="stylesheet" type="text/css" />
<link href="/css/print.css" media="print" rel="stylesheet" type="text/css" />
<!--[if IE]>
<link href="/css/ie.css" media="screen, projection" rel="stylesheet" type="text/css" />
<![endif]-->
</head>
global.scss
@import "compass";
终端 (在项目根目录中)
compass compile
输出:
warning Webkit only supports pixels for the start and end stops for radial gradients. Got: 70%
write css/global.css
然后我保存运行SASS-Autocompile的global.scss文件,并显示此错误。
SASS-Autocompile:编译错误
{
"message": "File to import not found or unreadable: compass.
Parent style sheet: /Users/robby/Documents/reseminary/wordpress/wp-content/themes/dev.reseminary.edu/scss/global.scss",
}