Commit 1ea6ec32 authored by Boris Kocherov's avatar Boris Kocherov

add css requirejs plugin

parent ee45f22f
/** `css` is a requirejs plugin
that loads a css file and inject it into a page.
note that this loader will return immediately,
regardless of whether the browser had finished parsing the stylesheet.
this css loader is implemented for file optimization and depedency managment
*/
define({
load: function (name, require, load, config) {
function inject(filename)
{
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
link.href = filename;
link.rel = 'stylesheet';
link.type = 'text/css';
head.appendChild(link);
}
inject(requirejs.toUrl(name));
load(true);
},
pluginBuilder: './css-build'
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment