Skip to content
A Require.js plugin for loading CSS resources
Branch: master
Clone or download
martinsb Merge pull request #1 from Aeriandi/master
Load now checks to see if the style has already been loaded first.
Latest commit 453ca08 Apr 2, 2014
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
css Initial commit Jul 8, 2012
README.markdown Renames README file to README.markdown Jul 8, 2012
css.js Load now checks to see if the style has already been loaded first. Apr 2, 2014
demo.html Initial commit Jul 8, 2012
require.js Initial commit Jul 8, 2012

README.markdown

Require.js plugin for loading CSS stylesheets

The plugin allows user to load a CSS resource via require.js. To use it, create a CSS rule in your stylesheet, e.g.:

.<file base name>-css-loaded {
	height: 1px;
}

/*for CSS file sample.css*/
.sample-css-loaded {
	height: 1px;
}	

Then require your resource along with the others:

require(['css!css/sample.css'], function() {
	alert('Stylesheet has been loaded');
});

Please, see the demo.html file for the full sample.

You can’t perform that action at this time.