最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

compass安装教程-Baiang

来源:动视网 责编:小采 时间:2020-11-27 16:42:26
文档

compass安装教程-Baiang

compass安装教程-Baiang:*:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin: 15px 0;
推荐度:
导读compass安装教程-Baiang:*:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin: 15px 0;


安装

一般来说,安装SASS的话,会自动帮助你安装compass。如果不确认是否有安装compass,在cmd中输入

compass -v

显示 'compass' 不是内部或外部命令,也不是可运行的程序或批处理文件。代表未安装compass。

显示如下,那么安装成功。

D:\WEB\aaa\myproject>compass -v
Compass 1.0.3 (Polaris)
Copyright (c) 2008-2015 Chris Eppstein
Released under the MIT License.
Compass is charityware.
Please make a tax deductable donation for a worthy cause: http://umdf.org/compass

安装指令

gem update --system #先更新gem
gem install compass #安裝Compass

其它指令

gem query –remote #卸载

md mycompass /# md 建立空文件夹

建立compass项目

cmd进入网站目录,在cmd中,输入以下指令。

compass create myproject

myproject是项目的名字,执行后,会下载compass项目文件到指定目录下: - config.rb -> 配置文件 - .sass-cache -> 缓存文件 - sass -> sass文件 - stylesheets -> sass编译文件

cofing.rb 配置文件

http_path = "/" 
css_dir = "stylesheets"
sass_dir = "sass"
images_dir = "images"
javascripts_dir = "javascripts"

//可以外加指令
output_style = :compressed //编译格式指定

编译文件

执行编译

compass compile

只有在配置文件下,才能执行编译,不然会找不到.scss文件。

D:\WEB\aaa\mycompass\myproject\sass>compass compile
Compass can't find any Sass files to compile.
Is your compass configuration correct?.
If you're trying to start a new project, you have left off the directory argumen
t.
Run "compass -h" to get help.

在命令行模式下,除了一次性编译命令,compass还有自动编译命令

compass watch

结束自动编译按 CTRL + C,同样,也需要在配置文件下执行自动编译,才执行。

调用模块报错

如果调用模块报错,有可能是编码错误。

文档

compass安装教程-Baiang

compass安装教程-Baiang:*:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* BLOCKS =============================================================================*/ p, blockquote, ul, ol, dl, table, pre { margin: 15px 0;
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top