Skip to content

Instantly share code, notes, and snippets.

@codegino
Last active April 23, 2019 13:46
Show Gist options
  • Save codegino/2b9d6957cc757eef9eeb516347377b12 to your computer and use it in GitHub Desktop.
Save codegino/2b9d6957cc757eef9eeb516347377b12 to your computer and use it in GitHub Desktop.
const css: any = [];
for (let i = 0; i < document.styleSheets.length; i += 1) {
try {
const sheet: any = document.styleSheets[i];
const rules = ('cssRules' in sheet) ? sheet.cssRules : sheet.rules;
for (let j = 0; j < rules.length; j += 1) {
const rule: any = rules[j];
if ('cssText' in rule) { css.push(rule.cssText); } else { css.push(`${rule.selectorText} {\n${rule.style.cssText}\n}\n`); }
}
} catch (error) {
console.log(error);
}
}
const a = css.join('\n').replace(/\s/g, '');
console.log('CSS', a);
return a;
https://www.developerdrive.com/2017/07/creating-a-data-table-in-vue-js/
{
"editor.tabSize": 2,
"window.zoomLevel": 0,
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"eslint.validate": [
{
"language": "vue",
"autoFix": true
},
{
"language": "javascript",
"autoFix": true
},
],
"eslint.autoFixOnSave": true,
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment