Load your StyleSheets as AMD dependencies and use JavaScript to manage a style element.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build
example
src
test
.gitignore
README.md
grunt.js
package.json

README.md

StyleManager

StyleManager is a low level library that manages a style tag, useful for thick client development where CSS styles are explicit dependencies for components.

Download

Usage

StyleManager is meant to be leveraged by build tools to assist in managing styles for complex thick client applications.

constructor

var styles = new StyleManager();

register

styles.register('component', 'h1 { color: #FF6600; }');

render

// Render the styles (called automatically on each register)
styles.render();

AMD Plugin Useage

require(['css!some-stylesheet.css'], function(stylesheet) {
  // stylesheet is an instance of StyleManager representing some-stylesheet.css.
  // Your styles will be loaded onto the page at this point.
});

Build

npm install && grunt build

Author

Credits

The work done at Instructure and Rdio.

License

Available via the MIT or new BSD license.