Skip to content

Grails plugin for using the LESS CSS framework in conjunction with the grails-resource plugin family

License

Notifications You must be signed in to change notification settings

ggiraldez/grails-lesscss-resources

 
 

Repository files navigation

#less CSS Resource plugin# This plugin is designed to optimize the use of .less css files. The processing will compile specified .less files into their .css counterparts, and place the css into the processing chain to be available to the other resource plugin features. The plugin uses the Asual Less Engine to compile the .less files using Mozilla Rhino. The plugin uses the Resources plugin and plays nicely with both the zipped and cached resources plugins.

LESS extends CSS with dynamic behavior such as variables, mixins, operations and functions. Read more

##Installation##

grails install-plugin lesscss-resources

##Usage## An Example of using both .less and .css files together in a bundle

'style' {
        resource url:'less/test.less',attrs:[rel: "stylesheet/less", type:'css'], bundle:'bundle_style'
        resource url:'css/normal.css'
        resource url:'css/normal2.css'
    }

#Import# LESS supports importing of other less/css files. This is supported in lesscss-resources

@import 'imported_style.less';

Note that the files to be imported are not part of the resources bundle, so any changes will not trigger a rebuild of the resource.

###Required Settings for LESS###

  • url: The location of the .less file
  • attrs[rel]: should be set to stylesheet/less for compatibility reasons
  • attrs[type]: must be set to css for resources to process
  • bundle: Must be set as will not default correctly. To add to default bundle use 'bundle_'

See the Resources plugin for more details on available configurations

##Issues##

  • Must specify the default bundle manually as this is calculated based on file extension by default.
  • When debug is switched on there is currently no way to fall back to the standard LESS javascript support. The less files will be rendered unprocessed

##Special Thanks## To David Marquis for his grails-lesscss plugin, which was the inspiration for this resources based version. The guys at Asual who created the lesscss complier, with does all the heavy lifting.

About

Grails plugin for using the LESS CSS framework in conjunction with the grails-resource plugin family

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Groovy 100.0%