RequireJS Style Plugins
Small set of plugins for RequireJS that deal with CSS and preprocessors such as Less or Sass.
For more plugins please check the RequireJS wiki.
Installing
You can use bower to install this set of plugins:
$ bower install --save requirejs-style-plugins
Loading a CSS stylesheet
To use CSS stylesheets in your app, your configuration should look like this:
require;
Then you would load the stylesheet in your view like this:
;
Which would try to load views/button.css
:
Loading a Less stylesheet
To use Less stylesheets, your configuration should look like this:
require;
Then you would load the stylesheet in your view like this:
;
Which would try to load views/button.less
:
@color: green; button color: @color;
Loading a Sass stylesheet
To use Sass stylesheets, your configuration should look like this:
require;
Then you would load the stylesheet in your view like this:
;
Which would try to load views/button.sass
:
}
Testing
Browser
Run the following:
$ grunt test:browser
And open http://localhost:8000/ in your browser.
If you want to rerun tests on file changes, run the following instead:
$ grunt follow:browser
PhantomJS
Run the following:
$ grunt test:phantom
If you want to rerun tests on file changes, run the following instead:
$ grunt follow:phantom
Meta
- Code:
git clone git://github.com/unindented/requirejs-style-plugins.git
- Home: http://github.com/unindented/requirejs-style-plugins/
Contributors
Daniel Perez Alvarez (unindented@gmail.com)
License
Copyright (c) 2014 Daniel Perez Alvarez (unindented.org). This is free software, and may be redistributed under the terms specified in the LICENSE file.