Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add env variable to stop fonts from loading #300

Merged
merged 1 commit into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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