hobostyle
Dynamic CSS for your web page!!!
Last updated 5 years ago by refractalize .
BSD-2-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hobostyle 
SYNC missed versions from official npm registry.

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="..."> element in your <head> linking to cssUrl.

mystyle.set(newCssUrl);

This will set the href to newCssUrl.

mystyle.remove();

Will remove the style element.

Current Tags

  • 1.0.0                                ...           latest (5 years ago)

5 Versions

  • 1.0.0                                ...           5 years ago
  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
  • 0.0.2                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 7
Dependencies (0)
None
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |