-
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.
- Plugin has been renamed to
Grass
– thanks to Robert Fischer for his idea in the mailing list and permission to use it. - Issue with relative paths to images in compiled css has been resolved.
-
grails grid-img
has been implemented. - Command
grails compass-init
shows proper html code to be included into your layout.
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.2. Then run:
grails install-plugin grails-grass-0.2.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 fromGrasssConfig.groovy
. - Command to generate
grid.png
–grails grid-img
.
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 GrassConfig.groovy
and includes parameters for running compass
compiler.
The default configuration is given below:
grass {
sass_dir = "./src/stylesheets"
css_dir = "./web-app/css"
images_dir = "web-app/images"
// default is true
relative_assets = true
// other options: nested, expanded, compact, compressed
output_style = "compact"
}
To uninstall compass plugin run grails uninstall grass
. It would be also necessary to:
- manually remove
./src/stylesheets
folder containing sass stylesheets - compiled css in
./web-app/css
. - manually remove
./grails-app/conf/GrassConfig.groovy
- After compiling sass stylesheets folder
./src/stylesheets/.sass-cache
is created. - Changing
GrassConfig.groovy
does not cause recompiling sass stylesheets when runninggrails run-app
. Is planned to be resolved in near future.