Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var css = [];
- for (var i=0; i<document.styleSheets.length; i++)
- {
- var sheet = document.styleSheets[i];
- var rules = ('cssRules' in sheet)? sheet.cssRules : sheet.rules;
- if (rules)
- {
- css.push('\n/* Stylesheet : '+(sheet.href||'[inline styles]')+' */');
- for (var j=0; j<rules.length; j++)
- {
- var rule = rules[j];
- if ('cssText' in rule)
- css.push(rule.cssText);
- else
- css.push(rule.selectorText+' {\n'+rule.style.cssText+'\n}\n');
- }
- }
- }
- var cssInline = css.join('\n')+'\n';
- cssInline;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement