Skip to content

Instantly share code, notes, and snippets.

@giuseppeg
Last active August 26, 2018 07: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 giuseppeg/5e8f78774a9bbb2c1a1250ea4a762306 to your computer and use it in GitHub Desktop.
Save giuseppeg/5e8f78774a9bbb2c1a1250ea4a762306 to your computer and use it in GitHub Desktop.
const span = getComputedStyle(document.querySelector('span'))
const button = getComputedStyle(document.querySelector('button'))
const diff = Object.keys(span).reduce((diff, p) => {
if (span[p] != button[p]) {
diff[p] = span[p]
}
return diff
}, {})
console.log(diff)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment