Skip to content

Instantly share code, notes, and snippets.

@ourmaninamsterdam
Created March 24, 2013 13:37
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 ourmaninamsterdam/5232000 to your computer and use it in GitHub Desktop.
Save ourmaninamsterdam/5232000 to your computer and use it in GitHub Desktop.
Get computed style of elements and pseudo elements
function getComputedStyle(elem, property, pseudoelem){
return window.getComputedStyle(elem, (pseudoelem || null)).getPropertyValue(property);
};
getComputedStyle(myElem, "height").width;
getComputedStyle(myElem, "height", ":after").width;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment