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

@cssxio/babel-plugin

v0.6.0

Published

Babel compiler transform for CSSX.

Readme

@cssxio/babel-plugin

This plugin compiles CSSX calls imported from @cssxio/cssx. That is the default importSource.

// babel.config.js
export default {
  plugins: ['@cssxio/babel-plugin'],
};

It supports namespace, default, and named create, props, and sx imports. Named imports are called directly. Namespace and default imports must use dot notation, such as cssx.create(...); computed API calls such as cssx['create'](...) are rejected.

create must be declared at module scope. It needs one plain object with non-computed keys. Values must be string literals or unchanged local constants initialized with string literals. Spreads, changed values, and other dynamic values produce an error at the source location.

The plugin replaces create with compiled styles. It folds a props call only when every input is a local compiled style, a nested array of supported inputs, false, or null. Static props folding does not accept undefined. Other props calls stay at runtime.

The plugin also compiles static strings in sx calls. It supports static strings, false, null, nested arrays without spreads, logical-and expressions, and conditional expressions. Unsupported nested input leaves the sx call at runtime.

The plugin removes unused CSSX imports. It writes CSS data to Babel file metadata as cssx. cssx.candidates maps each reachable source candidate to its atomic class, cssx.composites maps each emitted composite class to its winning atomic classes, and cssx.atomicClasses identifies atoms still needed for dynamic runtime composition. cssx.origins stores the first source location for each reachable candidate. Origin lines and columns are zero-based. A direct style-key reference keeps that key's candidates; dynamic or non-member style use keeps every candidate from that style map.

Use importSource to target a custom runtime re-export:

export default {
  plugins: [['@cssxio/babel-plugin', { importSource: '@app/cssx' }]],
};

The plugin accepts an optional theme string containing CSS text with CSSX @theme input. Use themeFile in the CSSX adapter when the build tool should read theme CSS text from a file.

Set stableClassNames: true when development builds need composite class names to remain stable across CSS-only edits, or when a framework transforms server and client modules in separate compiler processes. The generated names are derived from the source file and call site, so use the same setting consistently for a given build.