-
Notifications
You must be signed in to change notification settings - Fork 14
Home
Compass is a stylesheet authoring tool that uses a the Sass stylesheet language to make your stylesheets smaller and your web site easier to maintain. This plugin brings compass advantages to Grails developers.
Compass-css requires Compass to be installed. For detailed instructions please on installing compass see here. Obviously it is necessary to have ruby installed. Looking forward to compass being ported to java.
To install plugin download it from download page here. Latest version for now is 0.1 – the very first version. Then run:
grails install grails-compass-css-0.1.zip
After installing you get the following new grails commands:
grails compass-init
grails compile-css
grails grid-img
grails list-compass-frameworks
- To get list of currently supported compass frameworks use:
grails list-compass-frameworks
. Currently supported compass frameworks are blueprint and yui. - To start working with preferred framework (e.g. blueprint) run command:
grails compass-init blueprint
. This command copies blueprint sass stylesheets to./src/stylesheets
folder andCompassConfig.groovy
to./grails-app/config
. - To compile sass stylesheets in
./src/stylesheets
run command:grails compile-css
. Parameters for running commang are taken fromCompassConfig.groovy
. - Command to generate
grid.png
–grails grid-img
does not work for now.
When you run grails application with grails run-app
compass plugin watches for changes in ./src/stylesheets and compiles sass stylesheets when they are changed. So you can observe up to date css styles in your application.
Configuration for compass plugin is kept in CompassPlugin.groovy
and includes parameters for running compass
compiler.
The default configuration is given below:
compass {
sass_dir = "src/stylesheets"
css_dir = "web-app/css"
images_dir = "../images"
// default is true
relative_assets = true
// other options: nested, expanded, compact, compressed
output_style = "compact"
}
To uninstall compass plugin run grails uninstall compass-css
. It would be also necessary to:
- manually remove
./src/stylesheets
folder containing sass stylesheets - compiled css in
./web-app/css
.
- After compiling sass stylesheets folder
./src/stylesheets/.sass-cache
is created. - Issue with relative paths to images in compiled css is to be resolved in nearest future.
-
grails grid-img
is a stub for now and shows link to the site where necessarygrid.png
can be generated. - Changing
CompassConfig.groovy
does not cause recompiling sass stylesheets when runninggrails run-app
.