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

pixel-bit

v2.2.0

Published

Retro pixel-art UI framework in plain CSS. Buttons, panels, dialogue balloons, HP bars, key prompts and icons for games and 8-bit style sites. Zero dependencies, themeable with CSS variables.

Downloads

118

Readme

pixel-bit

A pixel-art CSS framework for game interfaces. It styles semantic HTML — no classes on every element, no JavaScript, no dependencies.

npm license

2.83 KB gzipped. Zero dependencies. Works with any framework, or none.

Install

<link rel="stylesheet" href="https://unpkg.com/pixel-bit" />

Or via npm:

npm install pixel-bit
import "pixel-bit";

Use

Add class="pb" to a container. Everything inside is styled — plain HTML, no extra classes:

<body class="pb">
  <button>Continue</button>
  <input type="text" placeholder="Name" />
  <select>
    <option>Warrior</option>
  </select>

  <label><input type="checkbox" checked /> Sound</label>
</body>

Only the subtree you mark is affected. The rest of your app is untouched.

Semantic modifiers

<button class="pb-accent">Save</button>
<button class="pb-danger">Delete</button>
<button class="pb-success">Confirm</button>
<button class="pb-warning">Careful</button>

Validation

Style follows the ARIA attribute, so the error state is announced to screen readers, not just colored:

<input type="text" aria-invalid="true" />

Every rule has zero specificity

Selectors are wrapped in :where(), so any rule you write overrides the framework — no !important, no specificity fights:

button { background: rebeccapurple; }  /* just works */

Theming

Everything configurable is a CSS custom property. Redefine what you need:

:root {
  --pb-accent: #c0392b;
  --pb-unit: 6px;      /* rescales the whole pixel grid */
  --pb-bg: #1b2b1b;
}

| Token | Purpose | | --- | --- | | --pb-unit | Base pixel grid. All sizes derive from it. | | --pb-edge-width | Thickness of the notched outline | | --pb-bevel-width | Depth of the inner bevel | | --pb-drop-depth | Offset of the solid drop shadow | | --pb-font-family --pb-font-size --pb-line-height --pb-letter-spacing | Typography | | --pb-bg --pb-surface --pb-surface-raised | Surfaces | | --pb-ink --pb-ink-muted --pb-edge | Text and edges | | --pb-accent --pb-danger --pb-success --pb-warning | Semantic colors | | --pb-accent-ink --pb-danger-ink --pb-success-ink --pb-warning-ink | Text on top of each semantic color | | --pb-tint-light --pb-tint-dark | What every bevel mixes toward. Keep them close to white and black or colored controls go muddy. | | --pb-hover-veil | Overlay that darkens a control on hover | | --pb-fill | Fill of a single control. Set it and the bevel re-derives itself. | | --pb-transition | Animation duration. Set to 0ms to disable. |

Variables starting with --_pb- are internal. They hold composed shadow recipes that the components depend on, and redefining one breaks every component at once.

Themes

Four themes ship with the framework. Set data-pb-theme on any element and everything inside it changes:

<body class="pb" data-pb-theme="dark">

| Theme | Look | | --- | --- | | (none) | Light ground, white controls, saturated accents | | dark | Dark slate | | mono | Four-tone green, like an early handheld screen | | amber | Amber phosphor terminal |

A theme only redefines the surface and semantic colors. The pixel grid, the bevels and the shadow recipes are shared, so a theme is about twenty lines.

Fonts

pixel-bit ships no font files and makes no network requests — it will not block your render or break under a strict CSP. To use a pixel typeface, load it yourself and point the token at it:

<link href="https://fonts.googleapis.com/css2?family=Press+Start+2P" rel="stylesheet" />
<style>
  :root {
    --pb-font-family: "Press Start 2P", monospace;
    --pb-font-size: 10px;
  }
</style>

Components

Forms — button input select textarea checkbox radio fieldset legend label

Layout — panel with notched title, table, badge, modal dialog on <dialog>

Text — links, lists, horizontal rules and semantic text colors

Game — dialogue balloon, HP/MP/XP bars, key prompts for keyboard and gamepad, heart icons

Buttons, fields and bars need no classes at all: write plain HTML inside a .pb container and it is styled.

Roadmap

Shipped:

  • [x] Buttons, fields, checkboxes and radios
  • [x] Panels, badges and tables
  • [x] Dialogue balloons
  • [x] Stat bars for HP, MP and XP
  • [x] Key prompts for keyboard and gamepad
  • [x] Full theming through CSS variables
  • [x] Links, lists and horizontal rules
  • [x] Modal dialogs built on <dialog>
  • [x] Four swappable themes

Coming next:

  • [ ] A wider icon set
  • [ ] pixel-bit/react, an optional typed component layer

Releases ship every one to two weeks. Open an issue if you want something moved up the list.

Accessibility

  • Focus is always visible; the outline is never removed without a replacement.
  • Error states pair color with aria-invalid, never color alone.
  • Animation respects prefers-reduced-motion.
  • Disabled controls keep readable contrast.

Browser support

Chrome, Edge, Firefox and Safari — current versions. Uses :where(), color-mix() and custom properties.

Contributing

Issues and pull requests are welcome. npm test runs the linter and the build.

License

MIT © Luis Navarrete