import Code from 'components/Code'
import Table, { Row, Column } from 'components/Table'

### `injectGlobal`

> The `injectGlobal` API was removed and replaced by `createGlobalStyle` in styled-components v4.

A helper method to write global CSS. It does not return a component, but adds the styles to
the stylesheet directly.

<Table head={['Arguments', 'Description']}>
  <Row>
    <Column>
      1. <Code>TaggedTemplateLiteral</Code>
    </Column>
    <Column>A tagged template literal with your global styles inside.</Column>
  </Row>
</Table>

```tsx
import { injectGlobal } from 'styled-components'

injectGlobal`
  @font-face {
    font-family: "Operator Mono";
    src: url("../fonts/Operator-Mono.ttf");
  }

  body {
    margin: 0;
  }
`
```

We do not encourage the use of this. Try to use it once per app at most, if you
must, contained in a single file. This is an escape hatch. Only use it for the
rare `@font-face` definition or body styling.