Comparing version 0.0.1 to 0.0.2
43
index.js
@@ -17,42 +17,17 @@ function Createcss () { | ||
var mediaType | ||
if (document.styleSheets.length > 0) { | ||
for( i = 0; i < document.styleSheets.length; i++) { | ||
if (document.styleSheets[i].disabled) { | ||
continue | ||
} | ||
var media = document.styleSheets[i].media | ||
mediaType = typeof media | ||
if (mediaType == "string") { | ||
if (media == "" || (media.indexOf("screen") != -1)) { | ||
styleSheet = document.styleSheets[i] | ||
} | ||
} else if (mediaType == "object") { | ||
if (media.mediaText == "" || (media.mediaText.indexOf("screen") != -1)) { | ||
styleSheet = document.styleSheets[i] | ||
} | ||
} | ||
var styleSheetElement = document.createElement("style") | ||
styleSheetElement.type = "text/css" | ||
if ( typeof styleSheet != "undefined") { | ||
break | ||
} | ||
document.getElementsByTagName("head")[0].appendChild(styleSheetElement) | ||
for( i = 0; i < document.styleSheets.length; i++) { | ||
if (document.styleSheets[i].disabled) { | ||
continue | ||
} | ||
styleSheet = document.styleSheets[i] | ||
} | ||
if ( typeof styleSheet == "undefined") { | ||
var styleSheetElement = document.createElement("style") | ||
styleSheetElement.type = "text/css" | ||
document.getElementsByTagName("head")[0].appendChild(styleSheetElement) | ||
for( i = 0; i < document.styleSheets.length; i++) { | ||
if (document.styleSheets[i].disabled) { | ||
continue | ||
} | ||
styleSheet = document.styleSheets[i] | ||
} | ||
var media = styleSheet.media | ||
var media = styleSheet.media | ||
mediaType = typeof media | ||
} | ||
@@ -59,0 +34,0 @@ if (mediaType == "string") { |
{ | ||
"name": "createcss", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "createcss =========", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,2 +6,4 @@ createcss | ||
[![NPM](https://nodei.co/npm/createcss.png?global=true)](https://nodei.co/npm/createcss/) | ||
```javascript | ||
@@ -8,0 +10,0 @@ var createcss = require('createcss') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12
5388
114