Skip to content

Commit

Permalink
add env variable to stop fonts from loading
Browse files Browse the repository at this point in the history
  • Loading branch information
giannif committed Jun 23, 2022
1 parent 9d1a8ab commit 25ce316
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
4 changes: 3 additions & 1 deletion packages/brand/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# @giphy/js-brand

Colors, fonts - WIP
Colors, fonts

To stop fonts from loading set the environment variable `GIPHY_SDK_NO_FONTS=true`, this is not recommended as it could cause inconsistencies in the ui components
6 changes: 4 additions & 2 deletions packages/brand/src/typography.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { css, cx, injectGlobal } from 'emotion'

// eslint-disable-next-line
injectGlobal`
export const addFonts = () => injectGlobal`
@font-face {
font-family: 'interface';
font-style: normal;
Expand Down Expand Up @@ -43,6 +42,9 @@ injectGlobal`
src: url('https://s3.amazonaws.com/giphyscripts/react-giphy-brand/fonts/ss-social.woff') format('woff');
}
`
if (!process.env.GIPHY_SDK_NO_FONTS) {
addFonts()
}

export const fontFamily = {
title: "'nexablack', sans-serif",
Expand Down
2 changes: 2 additions & 0 deletions packages/components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,5 @@ If a GIF has an associated user, an overlay with their avatar and display name w
```
```

To stop fonts from loading set the environment variable `GIPHY_SDK_NO_FONTS=true`, this is not recommended as it could cause inconsistencies in the ui components
3 changes: 3 additions & 0 deletions packages/react-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -324,3 +324,6 @@ If you want to prefetch network requests before the loader appears in Grids and
| onGifClick | `(gif: IGif, e: SyntheticEvent<HTMLElement, Event>) => void` | fired when the gif is clicked |
| onGifRightClick | `(gif: IGif, e: SyntheticEvent<HTMLElement, Event>) => void` | fired when the gif is right clicked |
| onGifKeyPress | `(gif: IGif, e: SyntheticEvent<HTMLElement, Event>) => void` | fired when the a key is pressed on the gif |


To stop fonts from loading set the environment variable `GIPHY_SDK_NO_FONTS=true`, this is not recommended as it could cause inconsistencies in the ui components

0 comments on commit 25ce316

Please sign in to comment.