├── .classpath ├── .gitignore ├── .project ├── README.md ├── SassAssetPipelineGrailsPlugin.groovy ├── application.properties ├── grails-app └── conf │ ├── BuildConfig.groovy │ └── UrlMappings.groovy └── scripts └── _Events.groovy /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /target 3 | plugin.xml 4 | *.log 5 | *.zip 6 | *.iml 7 | /web-app 8 | .idea 9 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | sass-asset-pipeline 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.grails.ide.eclipse.core.nature 16 | org.eclipse.jdt.groovy.core.groovyNature 17 | org.eclipse.jdt.core.javanature 18 | 19 | 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SASS/SCSS Compass Grails Asset Pipeline 2 | ======================================= 3 | The Grails `sass-asset-pipeline` is a plugin that provides SASS/SCSS support for the asset-pipeline static asset management via libsass. (Libsass was added on version 2.9.0. All previous versions used compass sass) 4 | 5 | For more information on how to use asset-pipeline, visit [here](http://www.github.com/bertramdev/asset-pipeline). 6 | 7 | *Requires*: Java 8 due to jsass features. 8 | 9 | Usage 10 | ----- 11 | 12 | Simply create files in your standard `assets/stylesheets` folder with extension `.scss` or `.sass`. You also may require other files by using the following requires syntax at the top of each file or the standard SASS import: 13 | 14 | ```css 15 | /* 16 | *= require test 17 | *= require_self 18 | *= require_tree . 19 | */ 20 | 21 | /*Or use this*/ 22 | @import 'test' 23 | 24 | ``` 25 | 26 | Including Sass files into your GSP files is easy but there are a few things worth mentioning. Say we have a file called `application.scss`. You would include it into your gsp by its compiled extension instead of its original extension. aka, use `.css` instead of `.scss` 27 | 28 | ```gsp 29 | 30 | 31 | 32 | ``` 33 | 34 | 35 | Production 36 | ---------- 37 | During war build your sass files are compiled into css files. This is all well and good but sometimes you dont want each individual sass file compiled, but rather your main base sass file. It may be best to add a sub folder for those SASS files and exclude it in your precompile config... 38 | 39 | Config.groovy: 40 | ```groovy 41 | grails.assets.excludes = ["mixins/*.scss"] 42 | ``` 43 | -------------------------------------------------------------------------------- /SassAssetPipelineGrailsPlugin.groovy: -------------------------------------------------------------------------------- 1 | import asset.pipeline.AssetHelper 2 | import asset.pipeline.AssetPipelineConfigHolder 3 | 4 | class SassAssetPipelineGrailsPlugin { 5 | def loadAfter = ['asset-pipeline'] 6 | def version = "2.14.1" 7 | def grailsVersion = "2.2 > *" 8 | def title = "SASS/SCSS Asset-Pipeline Plugin" 9 | def author = "David Estes" 10 | def authorEmail = "destes@bcap.com" 11 | def description = "Provides SASS/SCSS Compass support for the asset-pipeline static asset management plugin." 12 | def documentation = "http://github.com/bertramdev/sass-grails-asset-pipeline" 13 | def license = "APACHE" 14 | def organization = [ name: "Bertram Capital", url: "http://www.bertramcapital.com/" ] 15 | def issueManagement = [ system: "GITHUB", url: "http://github.com/bertramdev/sass-grails-asset-pipeline/issues" ] 16 | def scm = [ url: "http://github.com/bertramdev/sass-grails-asset-pipeline" ] 17 | def developers = [ [name: 'Brian Wheeler'], [name: 'Jeremy Leng'], [name: 'Jordon Saardchit'], [name: 'Jeremy Crosbie'], [name: 'Bob Whiton'], [name: 'Andy Warner'] ] 18 | 19 | } 20 | -------------------------------------------------------------------------------- /application.properties: -------------------------------------------------------------------------------- 1 | #Grails Metadata file 2 | #Fri Jan 17 14:16:41 EST 2014 3 | app.grails.version=2.5.3 4 | app.name=sass-asset-pipeline 5 | -------------------------------------------------------------------------------- /grails-app/conf/BuildConfig.groovy: -------------------------------------------------------------------------------- 1 | grails.project.work.dir = 'target' 2 | 3 | grails.project.dependency.resolution = { 4 | inherits 'global' 5 | log 'warn' 6 | 7 | repositories { 8 | grailsCentral() 9 | grailsPlugins() 10 | mavenCentral() 11 | mavenLocal() 12 | jcenter() 13 | } 14 | dependencies { 15 | compile 'com.bertramlabs.plugins:sass-asset-pipeline:2.14.1' 16 | } 17 | 18 | plugins { 19 | runtime ":asset-pipeline:2.14.1" 20 | 21 | build(":release:3.1.2", 22 | ":rest-client-builder:2.0.3") { 23 | export = false 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /grails-app/conf/UrlMappings.groovy: -------------------------------------------------------------------------------- 1 | class UrlMappings { 2 | 3 | static mappings = { 4 | "/$controller/$action?/$id?"{ 5 | constraints { 6 | // apply constraints here 7 | } 8 | } 9 | 10 | "/"(view:"/index") 11 | "500"(view:'/error') 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /scripts/_Events.groovy: -------------------------------------------------------------------------------- 1 | eventAssetPrecompileStart = { assetConfig -> 2 | def configHolder = classLoader.loadClass('asset.pipeline.AssetPipelineConfigHolder') 3 | if(configHolder.config == null) { 4 | configHolder.config = [:] 5 | } 6 | 7 | if(configHolder.config.sass == null) { 8 | configHolder.config.sass = [:] 9 | } 10 | configHolder.config.sass.resolveGems = false 11 | } --------------------------------------------------------------------------------