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

@imsus/tailwind-plugin-font-inter

v0.3.0

Published

TailwindCSS Plugin to integrate with Inter UI Typeface.

Downloads

104

Readme

⭐️ Features

  • Auto add @font-face with display: swap
  • Dynamic Metrics utilities based on https://rsms.me/inter/dynmetrics/

⬇️ Installation

  • npm install --save-dev tailwind-plugin-font-inter OR
  • yarn add --dev tailwind-plugin-font-inter

✅ Usage

  1. Go to your TailwindCSS Configuration usually named tailwind.js
  2. In your tailwind.js file, uncomment the line with this code let defaultConfig = require('tailwindcss/defaultConfig')();
  3. Go to plugins keyword. Then add require('@imsus/tailwind-plugin-font-inter')(defaultConfig.textSizes) inside the array.

🖥 Output

This package will generate CSS on components section and utilities section.

On components Section

This will add some @font-face declaration and adding .font-inter class.

/* Will be generated on @tailwind components; */

@font-face {
  font-family: Inter UI;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://rsms.me/inter/font-files/Inter-UI-Regular.woff2?v=3.1") format("woff2"), url("https://rsms.me/inter/font-files/Inter-UI-Regular.woff?v=3.1") format("woff");
}

@font-face {
  font-family: Inter UI;
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("https://rsms.me/inter/font-files/Inter-UI-Italic.woff2?v=3.1") format("woff2"), url("https://rsms.me/inter/font-files/Inter-UI-Italic.woff?v=3.1") format("woff");
}

@font-face {
  font-family: Inter UI;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("https://rsms.me/inter/font-files/Inter-UI-Medium.woff2?v=3.1") format("woff2"), url("https://rsms.me/inter/font-files/Inter-UI-Medium.woff?v=3.1") format("woff");
}

@font-face {
  font-family: Inter UI;
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("https://rsms.me/inter/font-files/Inter-UI-MediumItalic.woff2?v=3.1") format("woff2"), url("https://rsms.me/inter/font-files/Inter-UI-MediumItalic.woff?v=3.1") format("woff");
}

@font-face {
  font-family: Inter UI;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("https://rsms.me/inter/font-files/Inter-UI-SemiBold.woff2?v=3.1") format("woff2"), url("https://rsms.me/inter/font-files/Inter-UI-SemiBold.woff?v=3.1") format("woff");
}

@font-face {
  font-family: Inter UI;
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("https://rsms.me/inter/font-files/Inter-UI-SemiBoldItalic.woff2?v=3.1") format("woff2"), url("https://rsms.me/inter/font-files/Inter-UI-SemiBoldItalic.woff?v=3.1") format("woff");
}

@font-face {
  font-family: Inter UI;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://rsms.me/inter/font-files/Inter-UI-Bold.woff2?v=3.1") format("woff2"), url("https://rsms.me/inter/font-files/Inter-UI-Bold.woff?v=3.1") format("woff");
}

@font-face {
  font-family: Inter UI;
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url("https://rsms.me/inter/font-files/Inter-UI-BoldItalic.woff2?v=3.1") format("woff2"), url("https://rsms.me/inter/font-files/Inter-UI-BoldItalic.woff?v=3.1") format("woff");
}

@font-face {
  font-family: Inter UI;
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("https://rsms.me/inter/font-files/Inter-UI-ExtraBold.woff2?v=3.1") format("woff2"), url("https://rsms.me/inter/font-files/Inter-UI-ExtraBold.woff?v=3.1") format("woff");
}

@font-face {
  font-family: Inter UI;
  font-style: italic;
  font-weight: 800;
  font-display: swap;
  src: url("https://rsms.me/inter/font-files/Inter-UI-ExtraBoldItalic.woff2?v=3.1") format("woff2"), url("https://rsms.me/inter/font-files/Inter-UI-ExtraBoldItalic.woff?v=3.1") format("woff");
}

@font-face {
  font-family: Inter UI;
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("https://rsms.me/inter/font-files/Inter-UI-Black.woff2?v=3.1") format("woff2"), url("https://rsms.me/inter/font-files/Inter-UI-Black.woff?v=3.1") format("woff");
}

@font-face {
  font-family: Inter UI;
  font-style: italic;
  font-weight: 900;
  font-display: swap;
  src: url("https://rsms.me/inter/font-files/Inter-UI-BlackItalic.woff2?v=3.1") format("woff2"), url("https://rsms.me/inter/font-files/Inter-UI-BlackItalic.woff?v=3.1") format("woff");
}

@font-face {
  font-family: Inter UI var;
  font-style: oblique 0deg 10deg;
  font-weight: 400 900;
  font-display: swap;
  src: url("https://rsms.me/inter/font-files/Inter-UI.var.woff2?v=3.1") format("woff2-variations"), url("https://rsms.me/inter/font-files/Inter-UI.var.woff2?v=3.1") format("woff2");
}

.font-inter {
  font-family: "Inter UI", sans-serif;
}

@supports(font-variation-settings:normal) {
  .font-inter {
    font-family: "Inter UI var", sans-serif;
  }
}

On utilities section

Replace standard text-lg into text-inter-lg to get Dynamic Metrics applied to your text class.

/* Will be generated on @tailwind utilities; */

.text-inter-xs {
  font-size: .75rem;
  letter-spacing: .16rem;
  line-height: 1.05rem;
}

.text-inter-sm {
  font-size: .875rem;
  letter-spacing: .16rem;
  line-height: 1.225rem;
}

.text-inter-base {
  font-size: 1rem;
  letter-spacing: .15rem;
  line-height: 1.4rem;
}

.text-inter-lg {
  font-size: 1.125rem;
  letter-spacing: .15rem;
  line-height: 1.575rem;
}

.text-inter-xl {
  font-size: 1.25rem;
  letter-spacing: .15rem;
  line-height: 1.75rem;
}

.text-inter-2xl {
  font-size: 1.5rem;
  letter-spacing: .14rem;
  line-height: 2.1rem;
}

.text-inter-3xl {
  font-size: 1.875rem;
  letter-spacing: .13rem;
  line-height: 2.625rem;
}

.text-inter-4xl {
  font-size: 2.25rem;
  letter-spacing: .12rem;
  line-height: 3.15rem;
}

.text-inter-5xl {
  font-size: 3rem;
  letter-spacing: .1rem;
  line-height: 4.2rem;
}