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 🙏

© 2026 – Pkg Stats / Ryan Hefner

postcss-rarely-font

v1.0.4

Published

A PostCSS plugin to add rarelyFont as a fallback font-family and provide static assets for rarely used characters.

Readme

PostCSS Rarely Font Plugin

A PostCSS plugin designed to add a fallback font family (rarelyFont) to handle rare Chinese characters (生僻字) automatically. This package also provides static assets, including a pre-defined CSS file and a font file (SourceHanSerifSC-Regular.otf), to make it easy to use in your projects.


Features

  • Automatically appends rarelyFont as a fallback font family in all CSS font-family and font declarations.
  • Ensures body has a default font-family that includes rarelyFont.
  • Includes a pre-defined global CSS file (rarelyFont.css) to make adding rare character font support simple.
  • Provides the SourceHanSerifSC-Regular.otf file for easy deployment.

Installation

Install the package via NPM or Yarn:

npm install postcss-rarely-font

or

yarn add postcss-rarely-font

Usage

1. PostCSS Plugin

To use the plugin in your PostCSS workflow, add it to your PostCSS configuration file (e.g., postcss.config.js):

const postcssRarelyFont = require('postcss-rarely-font');

module.exports = {
    plugins: [
        postcssRarelyFont({
            fontName: 'rarelyFont', // The fallback font family name
            defaultFont: 'Arial, sans-serif', // The default fallback font
        }),
    ],
};

2. Global CSS Import

Include the pre-defined rarelyFont.css file in your global styles to automatically load the font and define the fallback font family:

CSS Import:

@import "postcss-rarely-font/css/rarelyFont.css";

HTML <link>:

<link rel="stylesheet" href="postcss-rarely-font/css/rarelyFont.css">

Static Assets

This package includes the following static files:

  1. CSS file: css/rarelyFont.css
    This file defines the rarelyFont font-family and sets it as the fallback font for the body element.

  2. Font file: fonts/SourceHanSerifSC-Regular.otf
    The font file supports rare Chinese characters (生僻字) and should be served with the CSS file.


Example

Input CSS:

body {
    margin: 0;
}

h1 {
    font-family: 'Roboto', sans-serif;
}

p {
    font: italic 16px/1.5 'Times New Roman', serif;
}

Output CSS (after using the plugin):

body {
    margin: 0;
    font-family: Arial, sans-serif, rarelyFont;
}

h1 {
    font-family: 'Roboto', sans-serif, rarelyFont;
}

p {
    font: italic 16px/1.5 'Times New Roman', serif, rarelyFont;
}

Font Usage

The rarelyFont family is included in this package to support rare Chinese characters. If you want to customize the font file, replace the fonts/SourceHanSerifSC-Regular.otf with your desired font file and update the css/rarelyFont.css file accordingly.


Contributing

Contributions are welcome! If you encounter issues or have suggestions for improvements, feel free to open an issue or submit a pull request on GitHub.


License

This project is licensed under the MIT License.


Acknowledgments