Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ebay-font

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ebay-font

A module to load ebay font

  • 1.0.5
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ebay-font Build Status

ebay-font is the module used at eBay to load custom web fonts. It uses a strategy to avoid both FOUT and FOIT. This can be considered equivalent to the new CSS @font-face descriptor font-display: optional. Unfortunately, font-display is relatively new and hence its adoption among browsers is not widespread. So for now, this module leverages localStorage, FontFaceSet API and the Font Face Observer utility (as a backup if FontFaceSet API is not present) to provide the same functionality as font-display: optional.

ebay-font is paired along with eBay's custom font 'Market Sans'. But feel free to change it to any custom font URL of your choice.

Please refer to the detailed blog post "eBay’s Font Loading Strategy" for a full overview of how this module works.

Usage

ebay-font can be used along with other eBay open source modules Skin, Marko & Lasso, as well as in standalone mode. If you are in the eBay workflow environment, please follow the below steps

  1. Install and save the module
npm install ebay-font --save
  1. Add dependency in your page browser.json
"ebay-font/browser.json"
  1. The module exposes a tag <ebay-font> to embed in the <head> tag of page HTML
<html>
<head>
    <font-ebay>
    ... 
</head>
...
</html>

Standalone

  1. Copy paste this CSS and JavaScript tag snippet in the <head> tag of your page

  2. Include this generated JavaScript file fontloader.js in the footer

<script async src="fontloader.js"></script>

Browser support

  • Chrome (desktop & Android)
  • Firefox
  • Opera
  • Safari (desktop & iOS)
  • IE8+
  • Android WebKit

Issues

Have a bug or a feature request? Please open a new issue

License

Copyright (c) 2017 eBay Inc.

Released under the MIT License

FAQs

Package last updated on 18 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc