Compass installation tutorial-Baiang Compass installation tutorial
Compass and sass are equivalent to jquery and javascript. One is the encapsulated css library and the other is the javascript library. They both aim at the same and simplify development.
Install
Generally, installSASS
It will automatically help you install compass. If you are not sure whether compass is installed, enter
compass -v
Display'compass
'It is not an internal or external command, nor a program or batch file that can be run. Indicates that compass is not installed.
As shown below, the installation is successful.
D:\WEB\aaa\myproject>compass -vCompass 1.0.3 (Polaris)Copyright (c) 2008-2015 Chris EppsteinReleased under the MIT License.Compass is charityware.Please make a tax deductable donation for a worthy cause: http://umdf.org/compass
Installation instructions
Gem update -- system # update gemgem install compass # install Compass
Other commands
Gem query-remote # uninstall md mycompass/# create an empty folder in md
Create a compass project
Go to the website directory in cmd and enter the following command.
compass create myproject
Myproject is the project name. After execution, the compass project file will be downloaded to the specified directory:-config. rb-> Configuration File -. sass-cache-> cache file-sass-> sass file-stylesheets-> sass compilation File
Cofing. rb configuration file
Http_path = "/" css_dir = "stylesheets" sass_dir = "sass" images_dir = "images" javascripts_dir = "javascripts" // The command output_style =: compressed // specify the compilation format
Compile a file
Execute Compilation
compass compile
Compilation can be performed only in the configuration file, or the. scss file cannot be found.
D:\WEB\aaa\mycompass\myproject\sass>compass compileCompass 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 argument.Run "compass -h" to get help.
In command line mode, in addition to one-time compilation commands, compass also has automatic compilation commands.
compass watch
End automatic compilationCTRL + C
In the same way, you also need to execute automatic compilation in the configuration file.
Call module Error
If the call module reports an error, it may be an Encoding Error.