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

@f12io/maple

v2.0.17

Published

<div align="center">

Readme

TL;DR

Maple is a runtime CSS engine that generates atomic styles from utility classes only when they appear in the DOM.

Instead of shipping pre-compiled stylesheets, Maple ships a small JavaScript file that observes the DOM and constructs CSSOM incrementally as your application renders. If a class is never used, its style is never generated.

This shifts styling cost from upfront network transfer to demand-driven runtime generation. It eliminates build steps, complex configuration, and unused CSS, while keeping styles encapsulated.

Quick Start

Add Maple to your project by including the script below in the document <head> and start styling with utility classes.

<!doctype html>
<html lang="en">
  <head>
    <!-- Include Maple in the head -->
    <script src="https://cdn.jsdelivr.net/npm/@f12io/maple/dist/maple.js"></script>
  </head>
  <body>
    <!-- Start styling -->
    <div class="bgc-blue-500 c-white p-4 rad-2">Hello World</div>
  </body>
</html>

[!IMPORTANT] Load Maple as a blocking script in the document head.

Maple replaces a render-blocking stylesheet with a small render-blocking runtime. Loading it with async, defer, type="module", or at the end of the body allows the browser to paint elements before Maple has generated their styles, which can cause a Flash of Unstyled Content.

[!TIP] For production, pin Maple to a specific version:

<script src="https://cdn.jsdelivr.net/npm/@f12io/[email protected]/dist/maple.js"></script>

Why Maple?

Instead of generating or optimizing CSS files ahead of time, Maple generates styles on-demand as the browser encounters classes.

That model creates benefits across delivery, developer experience, and styling power.

Delivery & Performance

Developer Experience

Styling Power

Syntax

Every Maple class name follows a colon-separated structure:

media-query:selector:utility

The first two parts are optional, so Maple scales from simple utilities to advanced state management.

<div class="bgc-red"></div>
<div class="&:hover:bgc-red"></div>
<div class="@md:^.active:bgc-red"></div>

Learn the full syntax in the Syntax Reference.

Examples

Variable-first Utilities

Maple maps utility classes to cascading CSS variables rather than hardcoded values. You can also define variables directly in HTML using class syntax.

<div class="--primary=blue bgc-primary-200 c-primary-700">I am blue.</div>

When you want to bypass the variable system, use = to inject a literal value directly:

<div class="w=86% c=#ff0000"></div>

Read more in Variable-first Architecture and Variable Utilities.

Dynamic Classes

Because Maple observes the DOM directly, dynamically generated class names work naturally.

<div className={`md:bg-${userColor} w=${progress}%`}></div>

Read more in Dynamic Data as CSS.

Dynamic Colors

Maple color utilities resolve through CSS variables in the OKLCH color space, making lightness, chroma, hue, and alpha adjustable at runtime.

<div class="bgc-primary-320/70 c-white/80"></div>
<div class="c-coral-600"></div>
<div class="bg-teal/70"></div>
<div class="c-slateblue-500/20"></div>

Read more in Dynamic Color Manipulation and try the Native Palette.

Inline Selectors

Maple supports selector logic inside utility classes.

<button class="c-red ^.card:c-green ^.nav:c-blue">
  Text is green when in a card and blue when in a navigation bar.
</button>

<button class="&:hover:c-black">The text becomes black on hover</button>

<div class="/>span:fw=700">
  <span>This text is bold</span>
</div>

Read more in True Encapsulation and Selectors.

Limitations & Trade-offs

Maple's architecture offers unique benefits but also introduces constraints you should understand before adoption.

  • JavaScript is Required. Maple runs entirely in the browser and does not generate static CSS. If JavaScript is disabled, the page will render without styles.
  • Runtime Cost Scaling. Maple's generation work scales with the number of unique utility classes that appear in the DOM.
  • Not all CSS fits in Utilities. Certain patterns, such as keyframes, font-face declarations, and global resets, are often better expressed in traditional CSS.
  • Relative OKLCH Colors. As of May 2026, global support for relative color syntax is about 89%, with broader support for plain OKLab and OKLCH colors. Browsers that do not support relative color syntax ignore those generated color declarations.

Documentation

Contributing

If you're interested in contributing to Maple, please read our contributing docs before submitting a pull request.

License

Released under the Root Source License (ROOT), an MIT-style permissive license with an additional distribution condition for systems that can recreate the source on demand. © f12.io