Skip to content

Get all computed font-size definitions of each and every element.

License

Notifications You must be signed in to change notification settings

theZieger/allComputedFontSizes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

#Get all computed font-sizes of the current web-page you are looking at.

Just use this small bookmarklet or adopt the code for your own purposes.

javascript:(function(){
    'use strict'

    var aComputedFontSizes = [],
        aFontSizeList = [];

    document.querySelectorAll('*').forEach(function(oElement) {
        var sFontSize = window.getComputedStyle(oElement, null).getPropertyValue('font-size'),
            nIndex = aFontSizeList.indexOf(sFontSize);

        if (nIndex == -1) {
            aFontSizeList.push(sFontSize);
            aComputedFontSizes.push([sFontSize, 1]);
        } else {
            aComputedFontSizes[nIndex] = [sFontSize, ++aComputedFontSizes[nIndex][1]];
        }
    });

    console.log('All computed FontSizes on each and every DOM-ELement:');
    console.table(aComputedFontSizes);

}());

About

Get all computed font-size definitions of each and every element.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published