Skip to content
library for Alternate StyleSheets
JavaScript CSS
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
HISTORY.md
LICENSE
README.md
alternate-stylesheets.min.js
bower.json
package.json
testem.json

README.md

alternate-stylesheets.js

Build Status Dependency Status

library for Alternate StyleSheets

Installation

$ bower install alternate-stylesheets

Usage

<script src="alternate-stylesheets.min.js"></script>
// <link rel="stylesheet" title="cafe" href="cafe.css">
// <link rel="alternate stylesheet" title="orange" href="orange.css">
// <link rel="alternate stylesheet" title="chocolate" href="chocolate.css">

alternateStyleSheets.get();
// get alternate stylesheets

alternateStyleSheets.set('orange');
// set to disabled for cafe, set to enabled for orange

alternateStyleSheets.set('chocolate');
// set to disabled for orange, set to enabled for chocolate

Functions

get()

  • return StyleSheetList|Element[] - alternate stylesheets

get alternate stylesheets.

return link tags if document.styleSheets not found. return link tags if rendering engine is WebKit or Blink.

set(title)

  • title String - alternate stylesheet title

set enabled with alternate stylesheet for title.

Test

$ npm install
$ npm test

License

The MIT License. Please see LICENSE file.

Something went wrong with that request. Please try again.