Created
March 20, 2015 23:47
-
-
Save z3bbster/4c24c36c54a5af6b1ca5 to your computer and use it in GitHub Desktop.
parseCssMinimal CSS parser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Minimal CSS parser | |
* @param {string} content [css style for to be parse into current document] | |
* @return {cssRules} [description] | |
*/ | |
function parseCss (content) { | |
var styleElement = document.createElement('style'); | |
styleElement.textContent = content; | |
document.implenmentation.createHTMLDocument('') | |
.body.appendChild(styleElement); | |
console.log('styleElement.sheet.cssRules '+styleElement.sheet.cssRules); | |
return styleElement.sheet.cssRules; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment