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

backpack.css

v3.0.0

Published

A lightweight and somewhat opinionated CSS foundation that is best suited to applications 🎒.

Readme

NPM
version GitHub
license Dependencies Dev
dependencies Contributor Covenant PRs
Welcome Downloads

🎒 backpack.css

A lightweight and somewhat opinionated CSS foundation that is best suited to applications.

Table of contents

Installation

npm

Run the following command using npm:

npm install backpack.css --save-dev

If you prefer Yarn, use this command instead:

yarn add backpack.css --dev

Download

CDN

cdnjs coming soon (see here).

How to use

backpack.css is pretty easy to use. The one strict rule is that it must come before your project's CSS to ensure correct ordering of your styles and to be able to override any of backpack.css styles.

With a bundler (e.g., webpack, Parcel, etc.)

JS

import 'backpack.css';
import '[path(s)-to-your-project-css]';

CSS

If you're using webpack, then use the tilde (~) prefix at the start of the path, e.g.:

@import '~backpack.css';
@import '[path(s)-to-your-project-css]';

No bundler

Link to backpack.css using a <link> element in your HTML Head, e.g.:

<head>
  […]
  <link rel="stylesheet" href="https://unpkg.com/backpack.css" />
  <link rel="stylesheet" href="[path-to-your-project-css]" />
</head>

Overriding

backpack.css is just CSS so you can easily override any of its styles just as you would override any CSS, as in, via the rules of the cascade and specificity.

For example, if you don't want to use the global system font-stack defined by sanitize.css then override it in your project CSS like so:

html {
  font-family: serif;
}

Bundle size

Bundle size minified Bundle size minified

Motivation

Nowadays, I'm building React applications that have highly componentised User Interfaces (UI) making use of native CSS layout mechanisms such as Flexbox and Grid. I'm no longer finding the need for heavy-handed CSS frameworks that handle most of my UI concerns, especially layout and utilities. Instead, I build components with a smidgen of global styles.

What I do need, however, are a bunch of smart and sensible foundational styles suited for applications that I would typically forget project to project—think sanitize.css and then some. Something lightweight, super easy to integrate, and can easily be overridden or allow for modular use, thus giving birth to backpack.css 🙂🎒.

What it does

  • Apply sensible form element resets, normalisations, and fixes.
  • Apply a system font, including monospace fonts.
  • Apply the more agreeable border-box value for the box-sizing property to all elements.
  • Apply sensible OpenType features (see OpenType features below).
  • Make embeddable elements responsive.
  • Remove margins, paddings, and borders from all elements that come with those styles.
  • Remove markers from lists.
  • Remove all user-agent styles from heading elements and reset them to have the same styles as the body copy.
  • Where applicable, use CSS logical properties and values.

And more…

All of the CSS is very well documented if you want to dig deeper.

OpenType features

As mentioned above, backpack.css applies sensible OpenType features. However, due to the poor support of the font-variant- properties, backpack.css has to declare their equivalents via the better supported, but harder to maintain, font-feature-settings property (the font-feature-settings properties should always come first).

Here are some resources on this:

Browser support

backpack.css uses Browserslist to manage its browser support.

backpack.css does not support IE. To see the Browserslist queries backpack.css uses, see the .browserslistrc file.

Browserslist is used for Autoprefixer. Autoprefixer only adds a tiny amount of vendor prefixes, the main properties being prefixed are:

  • font-feature-settings
  • font-variant-ligatures

This doesn't mean that backpack.css cannot be used in browsers outside of the above Browserslist query, just that compatibility is ensured with the ones within the query.

Contributing

Please see our Contributing Guidelines.

Versioning

backpack.css is maintained under the Semantic Versioning guidelines. We'll do our best to adhere to those guidelines and strive to maintain backwards compatibility.

See the Changelog.

Credits

And anyone else who's been so kind to share their work out in the open.

❤️ Open source.

License

The code is available under the MIT license.