# typography-inject-fonts

> hax for c-r-a google fonts & typography

Latest version **0.0.0** (published 2019-06-04) · WTFPL license · 0 weekly downloads

## Install

```sh
npm install typography-inject-fonts
pnpm add typography-inject-fonts
yarn add typography-inject-fonts
bun add typography-inject-fonts
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.0 |
| Published | 2019-06-04 |
| First published | 2019-06-04 |
| Weekly downloads | 0 |
| License | WTFPL |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Daniel Radetsky |
| Maintainers | dradetsky |

## Links

- npm: https://www.npmjs.com/package/typography-inject-fonts
- Repository: https://github.com/dradetsky/typography-inject-fonts
- Homepage: https://github.com/dradetsky/typography-inject-fonts#readme
- Issues: https://github.com/dradetsky/typography-inject-fonts/issues
- npm.io page: https://npm.io/package/typography-inject-fonts

## Recent versions

- 0.0.0 (latest) — 2019-06-04

## README

typography-inject-fonts
=======================

If you want to use typography.js & google fonts inside of an app
created with create-react-app, you might have some difficulty, As did
the gentleman here:

https://github.com/KyleAMathews/typography.js/issues/177

Fortunately, if you're not too bothered about "clean solutions" or
"good code quality," I think I may have an answer for you.

usage
-----

SHITTY HACKS INCOMING!!!!!

```javascript
import Typography from 'typography'
import fairyGatesTheme from 'typography-theme-fairy-gates'
import injectFonts from 'typography-inject-fonts'

const theme = fairyGatesTheme
const typography = new Typography(theme)
typography.injectStyles()
injectFonts(typography)
```

implementation
--------------

I basically just ganked the code from
`packages/react-typography/src/GoogleFont.js`, stole the basic idea
used by `injectStyles()`, and so far it seems to work. By which I mean
"I have not yet been bitten by the edge case." If you're interested in
volunteering to be bitten by the edge cases, I'll put it up on npm
later.

WARNING: I am not a real frontend engineer. I don't even play one on
TV. DO NOT GET THE IDEA THAT THIS IS GOOD ENGINEERING. If you want to
get better at frontend stuff, steal your ideas from @KyleAMathews, not
me.

---
_Source: https://npm.io/package/typography-inject-fonts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
