sass+compass起步
前言:Sass is an extension of CSS that adds power and elegance to the basic language. It allows you to use variables, nested rules, mixins, inline imports, and more, all with a fully CSS-compatible syntax. Sass helps keep large stylesheets well-organized, and get small stylesheets up and running quickly, particularly with the help of the Compass style library.——《摘自sass官方文档》
所以我们使用sass+compass组合。(本文只讲windows环境,因为工作电脑是WIN)
1、ruby环境安装
sass依赖ruby环境,官网(http://rubyinstaller.org/downloads/)下载合适的版本的ruby,安装时注意在选择路径的那一步勾选Add Ruby executables to your PATH.
2、sass安装
在菜单中打开Start Command Prompt with Ruby,运行命令来安装sass:
gem install sass //安装sass
sass -v //查看sass版本号
sass -h //查看sass命令
3、compass安装
gem install compass //安装compass
compass version //查看compass版本号
基本环节配置好之后就可以小试身手了。
4、启动项目
compass create <myproject>
会生成一个名为<myprject>的文件夹,目录结构如下:

5、编译
compass是懒编译——只编译有改动的文件。
compass compile //手动编译sacc文件为css文件
compass watch //监控scss文件,有改动的时候自动编译为css

剩下的事情就是熟悉sacc语法及compass的各大模块,compass之于css就像jquery之于javascript,了解sacc基本语法之后,使用compass来干活,事半功倍。
附录:
1、compass基本命令:
Primary Commands:
* clean - Remove generated files and the sass cache
* compile - Compile Sass stylesheets to CSS
* create - Create a new compass project
* init - Add compass to an existing project
* watch - Compile Sass stylesheets to CSS when they change
Other Commands:
* config - Generate a configuration file for the provided command line options.
* extension - Manage the list of compass extensions on your system
* frameworks - List the available frameworks
* help - Get help on a compass command or extension
* imports - Emit an imports suitable for passing to the sass command-line.
* install - Install an extension's pattern into your compass project
* interactive - Interactively evaluate SassScript
* sprite - Generate an import for your sprites.
* stats - Report statistics about your stylesheets
* unpack - Copy an extension into your extensions folder.
* validate - Validate your generated css.
* version - Print out version information
2、sacc中文文档http://sass.bootcss.com/docs/sass-reference/
3、compass官方文档http://compass-style.org/reference/compass/support/
sass+compass起步的更多相关文章
- sass+compass+bootstrap三剑合璧高效开发记录
1. 先搭建环境,下载node.js,rubyinstaller,安装, 安装rubyinstaller时,要选上include system path,这样就会自动将node.js执行添加到wind ...
- window 安装 sass compass 记录
1.安装Ruby 安装sass 和compass 需要 Ruby 的环境,还区分xp 和win7-8 下版本区别 ruby 官网中文 ruby 官网英文 注意: xp: 下载 [xp不能下载包含64位 ...
- windows下的SASS/Compass的安装与卸载
认识SASS/Compass SASS是一种CSS的开发工具,提供了许多便利的写法,大大节省了设计者的时间,使得CSS的开发,变得简单和可维护. SASS与Compass的安装说明 SASS在Wind ...
- SASS+COMPASS 自适应 学习笔记
来源 http://snugug.github.io/RWD-with-Sass-Compass/#/ 1 安装 COMPASS 扩展 安装 方式 gem 'extension', '~>X.Y ...
- sass&compass&grunt
1. compass compile path/to/project//编译scss compass watch path/to/project//自动监视文件变化 2.mixin @include ...
- sass,compass让开发效率飞起
最近开始学习并且使用,发现使用它写起css来真的是各种爽 安装sass,compass sass是依赖于ruby的,必须先安装Ruby,点击下载 下载完ruby之后,使用命令行安装sass ...
- 我给自己的Sass+Compass,在Windows下写个bat,快速cd到我的sass目录
在Windows下,我总是要打开Ruby的cmd来进行Sass,其中要写好多cd,次数多了,自己的多敲,的确能记得更牢靠,但是无形中会浪费自己的一点点敲cd命令的时间,所以我想到自己在windows下 ...
- sass compass config.rb
require 'compass/import-once/activate' # Require any additional compass plugins here. # Set this to ...
- 强悍的CSS工具组合:Blueprint, Sass, Compass
掌握CSS是每个Web开发者的基本要求,虽然CSS本身并不复杂,但怎样写出支持所有主流浏览器(特别是IE)的CSS,以及在大型网站中如何有序地组织好CSS结构却是一个相当棘手的问题.我更多的是一个开发 ...
随机推荐
- vue中如何实现后台管理系统的权限控制
vuejs单页应用的权限管理实践 一.前言 在广告机项目中,角色的权限管理是卡了挺久的一个难点.首先我们确定的权限控制分为两大部分,其中根据粒的大小分的更细: 接口访问的权限控制 页面的权限控制 菜单 ...
- 无线网络中的MAC协议(1)
前文我们对传统的有线网络的MAC协议进行了分析,接下来我们在对无线网络的MAC也进行一个详细的介绍.那么无线网络中的MAC工作方式是如何的呢?无线局域网(WLAN)中MAC所对应的标准为IEEE 80 ...
- 【NOIP2017Day1T1】 小凯的疑惑
[题目链接] 点击打开链接 [算法] px + qy不能表示的最大整数为 pq - p - q 证明见这篇博客,过程很详细,推荐阅读 : https://blog.csdn.net/qwerty112 ...
- fastText(三):微博短文本下fastText的应用(二)
上一篇讲到,fastText在训练数据中过拟合的问题.接下来将介绍一些提高fastText泛化能力的尝试. 模型泛化使用过fastText的人,往往会被它的很多特性征服,例如训练速度.兼具word e ...
- TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first.
报错原因:numpy不能读取CUDA tensor 需要将它转化为 CPU tensor. 所以如果想把CUDA tensor格式的数据改成numpy时,需要先将其转换成cpu float-tenso ...
- codeforces round 421 div2 补题 CF 820 A-E
A Mister B and Book Reading O(n)暴力即可 #include<bits/stdc++.h> using namespace std; typedef lon ...
- c++实现数值的整数次方(类似pow())作用
/* * 计算数值的整数次方.cpp * * Created on: 2018年4月13日 * Author: soyo */ #include<iostream> #include< ...
- jsp实现文件上传(一)用jspSmartUpload组件实现文件上传
java类(ImageUtil.java) import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import ...
- git 命令参考手册
你的本地仓库由 git 维护的三棵“树”组成.第一个是你的 工作目录,它持有实际文件:第二个是 缓存区(Index),它像个缓存区域,临时保存你的改动:最后是 HEAD,指向你最近一次提交后的结果. ...
- rabbitMQ的使用
介绍 一款消息队列数据库,类似redis发布订阅,但是rq 做了功能完善和数据持久化.在项目中,将一些无需即时返回且耗时的操作提取出来,进行了异步处理,而这种异步处理的方式大大的节省了服务器的请求响应 ...