Last active
June 19, 2017 15:59
-
-
Save kadamwhite/4723443 to your computer and use it in GitHub Desktop.
Bookmarklet to convert all text on a webpage to the Blokk font, for use when working on mockups in your browser.
This file contains hidden or 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
(function() { | |
var css = "*{font-family:\"Blokk Regular\", blokk !important;}", | |
head = document.getElementsByTagName("head")[0], | |
style = document.createElement("style"); | |
style.type = "text/css"; | |
if ( style.styleSheet ) { | |
style.styleSheet.cssText = css; | |
} else { | |
style.appendChild( document.createTextNode( css ) ); | |
} | |
head.appendChild( style ); | |
})(); |
This file contains hidden or 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
// Copy into a bookmarklet by prepending the below with "javascript:" | |
javascript:(function(){var e='*{font-family:"Blokk Regular", blokk !important;}',t=document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e)),t.appendChild(n)})(); |
Updated to reflect the change of the font's name from "Blokk" to "BLOKK Regular"
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Blokk font: http://blokkfont.com/
Hat tip to Stack Overflow for the style insertion technique.