emotion#injectGlobal TypeScript Examples

The following examples show how to use emotion#injectGlobal. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: app.styles.tsx    From master-frontend-lemoncode with MIT License 6 votes vote down vote up
injectGlobal`
  @font-face {
    font-family: "Anton";
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src:
      local('Anton'),
      local('Anton-Regular'),
      url(${AntonFont}) format('truetype');
  }

  body {
    margin: 0;
    padding: 0;
  }
`;
Example #2
Source File: microapp.styles.tsx    From master-frontend-lemoncode with MIT License 6 votes vote down vote up
injectGlobal`
  @font-face {
    font-family: "Poppins";
    font-style: normal;
    font-display: swap;
    font-weight: 400;
    src:
      local('Poppins'),
      local('Poppins-Regular'),
      url(${PoppinsFont}) format('truetype');
  }
`;
Example #3
Source File: globals.ts    From test with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
injectGlobalStyles = () => {
  injectFontFaces(fontFaces)

  injectGlobal({
    html: {},
    body: {
      WebkitFontSmoothing: 'antialiased',
      WebkitOverflowScrolling: 'touch',
      height: '100%',
      margin: 0,
    },
  })
}
Example #4
Source File: utils.ts    From test with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
injectFontFaces = (fontFaces = []) =>
  fontFaces.forEach(({ family, type, weight }) => {
    try {
      injectGlobal(fontFace(family, type, weight))
    } catch (error) {
      console.log(error) // eslint-disable-line
    }
  })
Example #5
Source File: standalone.styles.tsx    From master-frontend-lemoncode with MIT License 5 votes vote down vote up
injectGlobal`
  body {
    margin: 0;
    padding: 0;
  }
`;