Skip to content

Instantly share code, notes, and snippets.

@zachleat zachleat/font-sizes.js
Last active Jan 11, 2019

Embed
What would you like to do?
Returns a unique sorted array of font-size values on a page.
(function() {
let fontSizes = new Set();
document.querySelectorAll("*").forEach(function(node) {
fontSizes.add(window.getComputedStyle(node).getPropertyValue("font-size"));
});
return Array.from(fontSizes).sort();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.