{"id":16229210,"url":"https://github.com/morris/typekit-cache","last_synced_at":"2025-04-07T08:20:53.074Z","repository":{"id":57161934,"uuid":"30899676","full_name":"morris/typekit-cache","owner":"morris","description":"Keeps a site's Typekit in localStorage and injects it on page load, eliminating the Flash Of Invisible/Unstyled Text.","archived":false,"fork":false,"pushed_at":"2020-10-31T10:52:35.000Z","size":38,"stargazers_count":251,"open_issues_count":1,"forks_count":17,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-31T07:07:56.111Z","etag":null,"topics":["typekit","ux","webfonts"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/morris.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-17T02:43:28.000Z","updated_at":"2024-08-02T02:19:41.000Z","dependencies_parsed_at":"2022-09-09T23:21:52.790Z","dependency_job_id":null,"html_url":"https://github.com/morris/typekit-cache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morris%2Ftypekit-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morris%2Ftypekit-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morris%2Ftypekit-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morris%2Ftypekit-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morris","download_url":"https://codeload.github.com/morris/typekit-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247615385,"owners_count":20967184,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["typekit","ux","webfonts"],"created_at":"2024-10-10T12:57:41.536Z","updated_at":"2025-04-07T08:20:53.038Z","avatar_url":"https://github.com/morris.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Typekit Cache\n\n_Revision 14_\n\n**Current Status:** typekit-cache only works for older Typekit installations (using JavaScript). Newer installations use a `\u003clink\u003e` tag; all resources are cached properly by the browser\nand served from disk on a revisit. This cannot be further improved so upgrading to the `\u003clink\u003e` embed and removing typekit-cache is recommended.\n\n---\n\nKeeps a site's [Typekit][tk] in `localStorage` and injects it on page load.\nEliminates the annoying Flash Of Invisible/Unstyled Text (FOUT) and provides\nbetter UX for slow or offline connections.\n\nThe same requests are sent as in loading a Typekit regularly, and the Typekit embed code is unaltered.\nHowever, using this script may still violate the [Typekit Terms Of Use][tou].\n\n## Usage\n\nCopy the contents of [typekit-cache.min.js][min] right before your Typekit (advanced) embed code.\nThat's it, your website should be caching your Typekit happily.\n\n```html\n\u003cscript\u003e\n  /* contents of typekit-cache.min.js */\n\u003c/script\u003e\n\u003cscript\u003e\n  (function(d) {\n    var config = {\n      kitId: 'abcd1234',\n      scriptTimeout: 3000\n    },\n    h=d.documentElement, // ...\n  })(document);\n\u003c/script\u003e\n```\n\n## Notes\n\nThe regular Typekit behavior is not modified at all.\nExceptions visible in the console (e.g. if the storage is not available) can be safely ignored.\nHowever, you should use separate `\u003cscript\u003e` tags to ensure the Typekit embed code is still run if an exception occurs.\n\nIn addition to the regular `wf-*` classes, the `wf-cached` class is added to the `\u003chtml\u003e` tag on cache hit.\n\nTo use `sessionStorage` instead, just replace the `localStorage` reference.\n\n## Contributing\n\nMake sure PRs contain an updated minified version.\nRun `npm run prepublish` to build it.\n\n## Contributors\n\n- [Artem Gordinsky](https://github.com/ArtemGordinsky)\n- [Dave Garwacke](https://github.com/ifyoumakeit)\n- [Michael Baldry](https://github.com/brightbits)\n- [Jan Persoons](https://github.com/janpersoons)\n- [Tristan Koch](https://github.com/trkoch)\n- [Luke Bussey](https://github.com/lukebussey)\n- [Viktor Kuliebiakin](https://github.com/kuliebiakin)\n\nThanks!\n\n[tk]: https://typekit.com/\n[tou]: https://fonts.adobe.com/\n[min]: https://raw.githubusercontent.com/morris/typekit-cache/master/typekit-cache.min.js\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorris%2Ftypekit-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorris%2Ftypekit-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorris%2Ftypekit-cache/lists"}