Skip to content

Instantly share code, notes, and snippets.

Avatar

Dan Sajin dansajin

View GitHub Profile
@dansajin
dansajin / criticalcss.js
Last active May 3, 2019 — forked from scottjehl/criticalcss.js
critical CSS devtool snippet
View criticalcss.js
/**
* criticalCSS by @dansajin. based on @scottjehl's criticalcss.js
* run this in a browser console or create a bookmarklet.
* lists rules per css file.
* does not include cross origin css files and inline css.
*/
(function(){
var sheets = document.styleSheets,
host = window.location.host,
maxTop = 1200,