npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

inter-ui

v4.0.2

Published

Font files for the Inter font family.

Downloads

242,359

Readme

The Inter Typeface (a npm distribution)

The CSS and web font files to easily self-host the Inter font family created by Rasmus Andersson.

This repository is just a means of more easily distributing the font. It tracks the releases of the main Inter repository as best as I am able. Note that this repository only contains the woff2 format but does generate and include latin-extended subsets for each font.

SCSS files are also available for use with the Sass preprocessor. The font-display property can be overridden by setting $inter-font-display to a valid font-display value before importing the desired .scss file.

Quick start

npm install --save inter-ui

SCSS

Add the following to your SCSS to use the variable font with a non-variable fallback:

@use "~inter-ui/default" with (
  $inter-font-display: swap,
  $inter-font-path: '~inter-ui/web'
);

@use "~inter-ui/variable" with (
  $inter-font-display: swap,
  $inter-font-path: '~inter-ui/variable'
);

@include default.all;
@include variable.all;

html { font-family: "Inter", "system-ui"; }

@supports (font-variation-settings: normal) {
  html { font-family: "InterVariable", "system-ui"; }
}

Note that this @use syntax is not currently supported in the node-sass or ruby sass implementations. We recommend using the primary sass implementation: dart sass.

JS/CSS

We have pre-built CSS files that you can include directly (with font-display being swap).

Add the following to your script:

import "inter-ui/inter.css";
// Or use one of those versions:
// import "inter-ui/inter-latin.css"; // A subset of only English alphabet characters
// import "inter-ui/inter-display.css"; // The display font is optimised for XL text
// import "inter-ui/inter-display-latin.css";
// import "inter-ui/inter-variable.css";
// import "inter-ui/inter-variable-latin.css";

Add the following to your stylesheet:

html { font-family: "Inter", "system-ui"; }

@supports (font-variation-settings: normal) {
  html { font-family: "InterVariable", "system-ui"; } /* If using the variable font */
}

Quirks

If you're using the Apache web server to serve the font files, you will probably encounter a 500 Internal Server Error by default. This is because the font files contain .var. in their name, which causes Apache to interpret those files in a special way.

There are two ways to solve this:

Either adapt its configuration to make it serve variable fonts as expected.

Alternatively you can copy/rename the font files removing the .var in their name and use the SCSS variable $inter-font-variable-suffix to change the filename in the CSS:

@use "~inter-ui/variable" with (
  $inter-font-variable-suffix: ''
);

Modular imports

To avoid having to import all "font faces". You can also use only some of them via SCSS.

If you only want 400 and 700 you can specify exactly this.

@use "~inter-ui/default" as inter-ui with (
  $inter-font-path: "~inter-ui/web-latin"
);
@include inter-ui.weight-400;
@include inter-ui.weight-700;

Versions

There are several versions you can choose from. To use them with the modules, just change the $inter-font-path to e.g. Inter (web hinted) or use the other pre-built CSS files.

Hinted vs Unhinted

As detailed in the main repo:

Inter font files comes in two versions:

  1. "unhinted" -- Without TrueType hints (the default)
  2. "hinted" -- With TrueType hints

The TrueType hints are used by ClearType on Windows machines where ClearType is enabled. This usually changes the appearance of the fonts and can in some cases increase the legibility of text.

Additionally, hints are little computer programs that takes up considerable disk space, meaning that font files with hints are larger than those without hints. This might be a consideration when using web fonts.

  • SCSS use: set $inter-font-path to Inter (web hinted) or Inter (web hinted latin)
  • JS/CSS use: import inter-ui/inter-hinted.css or inter-ui/inter-hinted-latin.css

Latin

If you only need support for Latin characters, you can use this version. The normal Inter (web) version average filesize is between 150kb and 100kb, the reduced Latin version is on average 30kb per font.

This was generated using glyphhanger. See package.json for the build script.

  • SCSS use: set $inter-font-path to Inter (web latin) or Inter (web hinted latin)
  • JS/CSS use: import inter-ui/inter-latin.css or inter-ui/inter-hinted-latin.css