diff --git a/README.md b/README.md index e3f1ab9..f4c07d4 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,6 @@ The switcher is fully modular, so you can easily drop it into your own pages to To use the CSS switcher, just clone or download the project and then copy your html file into the main project folder (you can replace `index.html` if you want, since it's just the demo). -If you don't already have a stylesheet defined, you'll need to add the following default stylesheet to the header of your page: - - - Include the js for the switcher in the header of the page: diff --git a/switcher.js b/switcher.js index 4babfa0..1d6fc61 100644 --- a/switcher.js +++ b/switcher.js @@ -1,5 +1,15 @@ var frameworks = "bullframe,caiuss,kathamo,kube,lotus,milligram,min,monalisa,motherplate,normalize,oh-my-css,pure,sanitize-10up,sanitize-zdroid,siimple,simple,skeleton-framework,skeleton-plus,skeleton,tacit,thao"; +stylesheet = document.getElementsByTagName("link")[0]; +if (stylesheet == undefined) { + head = document.getElementsByTagName('head')[0]; + link = document.createElement('link'); + link.rel="stylesheet"; + link.type="text/css"; + link.href="vendor/bullframe.min.css"; + head.appendChild(link); +} + function switch_css(css) { document.getElementsByTagName("link")[0].href = "vendor/" + css + ".min.css"; }