Last active
January 23, 2019 10:54
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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