Skip to content

Instantly share code, notes, and snippets.

@w3guy
Forked from kadamwhite/blokkit.js
Created June 19, 2017 15:59
Show Gist options
  • Save w3guy/6bd2a7d2165fdbef1d36359c1c89235b to your computer and use it in GitHub Desktop.
Save w3guy/6bd2a7d2165fdbef1d36359c1c89235b 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.
(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 );
})();
// 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)})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment