function fontFace(_ref) {
    var fontFamily = _ref.fontFamily,
      fontFilePath = _ref.fontFilePath,
      fontStretch = _ref.fontStretch,
      fontStyle = _ref.fontStyle,
      fontVariant = _ref.fontVariant,
      fontWeight = _ref.fontWeight,
      _ref$fileFormats = _ref.fileFormats,
      fileFormats = _ref$fileFormats === void 0 ? ['eot', 'woff2', 'woff', 'ttf', 'svg'] : _ref$fileFormats,
      _ref$formatHint = _ref.formatHint,
      formatHint = _ref$formatHint === void 0 ? false : _ref$formatHint,
      _ref$localFonts = _ref.localFonts,
      localFonts = _ref$localFonts === void 0 ? [fontFamily] : _ref$localFonts,
      unicodeRange = _ref.unicodeRange,
      fontDisplay = _ref.fontDisplay,
      fontVariationSettings = _ref.fontVariationSettings,
      fontFeatureSettings = _ref.fontFeatureSettings;
    // Error Handling
    if (!fontFamily) throw new PolishedError(55);
    if (!fontFilePath && !localFonts) {
      throw new PolishedError(52);
    }
    if (localFonts && !Array.isArray(localFonts)) {
      throw new PolishedError(53);
    }
    if (!Array.isArray(fileFormats)) {
      throw new PolishedError(54);
    }
    var fontFaceDeclaration = {
      '@font-face': {
        fontFamily: fontFamily,
        src: generateSources(fontFilePath, localFonts, fileFormats, formatHint),
        unicodeRange: unicodeRange,
        fontStretch: fontStretch,
        fontStyle: fontStyle,
        fontVariant: fontVariant,
        fontWeight: fontWeight,
        fontDisplay: fontDisplay,
        fontVariationSettings: fontVariationSettings,
        fontFeatureSettings: fontFeatureSettings
      }
    };

    // Removes undefined fields for cleaner css object.
    return JSON.parse(JSON.stringify(fontFaceDeclaration));
  }
CSS for a @font-face declaration. Defaults to check for local copies of the font on the user's machine. You can disable this by passing `null` to localFonts.

@example
// Styles as object basic usage
const styles = {
   ...fontFace({
     'fontFamily': 'Sans-Pro',
     'fontFilePath': 'path/to/file'
   })
}

// styled-components basic usage
const GlobalStyle = createGlobalStyle`${
  fontFace({
    'fontFamily': 'Sans-Pro',
    'fontFilePath': 'path/to/file'
  }
)}`

// CSS as JS Output

'@font-face': {
  'fontFamily': 'Sans-Pro',
  'src': 'url("path/to/file.eot"), url("path/to/file.woff2"), url("path/to/file.woff"), url("path/to/file.ttf"), url("path/to/file.svg")',
}