Dynamic CSS for your web page!!!
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
README.md added remove Aug 12, 2015
index.js added remove Aug 12, 2015
package.json doc fix Jan 30, 2014

README.md

Hobo Style

Dynamic CSS for your web page!!!

How to use?

Assuming you're using browserify:

npm install hobostyle

Then

var hobostyle = require('hobostyle');
var mystyle = hobostyle.style('body { background-color: blue; }');

Then later,

mystyle.set('body { background-color: red; }');

API

Style

var mystyle = hobostyle.style(css);

This will create a new <style> element in your <head> containing css.

mystyle.set(newCss);

This will replace the original css with newCss, in the same <style> element.

mystyle.remove();

Will remove the style element.

Link

var mystyle = hobostyle.link(cssUrl);

This will create a new <link type="stylesheet" href="/old?u=https%3A%2F%2Fgithub.com%2Ffeaturist%2F...&y=1999"> element in your <head> linking to cssUrl.

mystyle.set(newCssUrl);

This will set the href to newCssUrl.

mystyle.remove();

Will remove the style element.