0.5.1 • Published 11 years ago

rave-load-css v0.5.1

Weekly downloads
2
License
MIT
Repository
github
Last release
11 years ago

rave-load-css

Adds css style sheet loading to rave.js based on file extensions.

By default, rave-load-css loads and injects a style sheet when it detects the following file extension:

css

You can change this list by adding a loadCss rave env property. For example, to detect ".less" and ".css-theme" extensions, add the following to your app's bower.json or package.json:

{
	"rave": {
		"env": {
			"loadCss": {
				"extensions": [ "less", "css-theme" ]
			}
		}
	}
}

Usage

Importing a css stylsheet is easy. Just import it as if it were a module.

For CommonJS/node-formatted modules (or AMD-wrapped CommonJS):

var overrides = require('./override-theme.css');
overrides.insertRule('p { text-weight: 200; }', overrides.rules.length);

For classic AMD modules:

define(['./override-theme.css'], function (overrides) {
	overrides.insertRule('p { text-weight: 200; }', overrides.rules.length);
});

For ES6-formatted modules:

import overrides from './override-theme.css';
// ...
overrides.insertRule('p { text-weight: 200; }', overrides.rules.length);
0.5.1

11 years ago

0.5.0

11 years ago

0.4.1

11 years ago

0.4.0

11 years ago

0.3.0

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago