Skip to content

Instantly share code, notes, and snippets.

@reimertz
Last active March 30, 2017 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reimertz/eeccf5743210ce907b19919f46bbbddb to your computer and use it in GitHub Desktop.
Save reimertz/eeccf5743210ce907b19919f46bbbddb to your computer and use it in GitHub Desktop.
importantAllTheThings.js
Array.from(document.querySelectorAll('*')).map(node => {
Object.keys(getComputedStyle(node)).map(styleKey => {
if (node[styleKey] === '') return
try {
node[styleKey] = node.style[styleKey].replace(';', ' !important;')
} catch(e) {}
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment