Skip to content
No description or website provided.
JavaScript Groovy
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.settings
grails-app
scripts
src/groovy/com/saasplex/stylus
test/integration/com/saasplex/stylus
web-app/WEB-INF
.classpath
.gitignore
.project
README.md
StylusResourcesGrailsPlugin.groovy
application.properties
plugin.xml

README.md

This is a Grails plugin than enables the easy inclusion of files of the Stylus stylesheet language into a Grails appplication. It requires the well established resources plugin.

Background

Stylus is yet another stylesheet language. There are quite a few these days! Stylus is written by the prolific TJ Holowaychuk.

This plugin uses Mozilla's Rhino engine to execute a slightly modified version of the browser compatible version of the Stylus compiler.

Usage

To add Stylus files to your Grails project:

  • Install the plugin (adding to your BuildConfig is best)
  • Actually add the stylus files to your project. I placed mine adjacent to the css folder in web-app/styl.
  • Reference your stylus files in your ApplicationResources file (or where ever your defining your resources)

Example

  stylus {
    resource url: 'styl/main.styl'
  }  

The above example will create a resource you can include in pages or have another resource depend on. The Stylus files are converted into Css files.

Example main.styl

  border-radius()
    -webkit-border-radius arguments  
    -moz-border-radius arguments  
    border-radius arguments 
  div#my-box
    border-radius 4px

which would be converted to main.css

  div#my-box {
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
  }

Note: that not all features of Stylus may work due to the porting process of the compiler from nodeJs to the browser.

Something went wrong with that request. Please try again.