Skip to content

Instantly share code, notes, and snippets.

@geoffreycrofte
Last active January 23, 2019 10:54
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 geoffreycrofte/65dff83b1442a2fc72ec06461943c6e5 to your computer and use it in GitHub Desktop.
Save geoffreycrofte/65dff83b1442a2fc72ec06461943c6e5 to your computer and use it in GitHub Desktop.
Get and mark elements on a page regarding their color or any other style.
// Paste that in your Browser console
let allBodyElements = document.querySelectorAll('body *'),
thePropertyName = 'color',
theExpectedValue = 'rgb(0, 82, 204)';
allBodyElements.forEach(function(el){
let style = window.getComputedStyle(el);
if ( style.getPropertyValue(thePropertyName) == theExpectedValue ) {
console.log(el);
el.style.boxShadow = '0 0 0 2px red';
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment