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

@stealthscale/pandacss-compiler

v0.2.0

Published

Renames a compiled Panda CSS stylesheet and its generated runtime into the readable scheme.

Downloads

200

Readme

@stealthscale/pandacss-compiler

@stealthscale/pandacss-compiler renames a compiled Panda CSS stylesheet and its generated runtime into the readable scheme of @stealthscale/pandacss-naming. The compiler is a native binary that offers no hook into the names it writes, so the two are rewritten after it ran: every class selector in the stylesheet through one parse, and the template lines of the runtime that write a class.

Install

pnpm add @stealthscale/pandacss-compiler

The package the generated runtime is written into depends on @stealthscale/pandacss-naming, which the rewritten runtime imports.

Usage

A build step runs codegen, rewrites the runtime it wrote, and renames the stylesheet it compiled:

import { createNodeDriver } from "@pandacss/compiler";
import { compilerConfig, renameSelectors, rewriteRuntime } from "@stealthscale/pandacss-compiler";

const driver = await createNodeDriver({ configPath: "panda.config.ts", cwd: root });

driver.parseFiles();
driver.codegen({ cwd: root, outdir: generated });

const config = compilerConfig(driver.config);

rewriteRuntime(generated, config.separator);

const { css, diagnostics } = renameSelectors(driver.cssgen().css, config);

diagnostics lists an error for each set of classes that renamed to one name, one warning for the classes whose rules were removed because no element carries them, and one warning for the classes kept under a raw selector or at-rule condition.

Reference

compilerConfig(config)

Reads what the scheme needs out of driver.config, the configuration the compiler received with every preset merged: every recipe under theme.recipes and theme.slotRecipes with its className, or its key where it names none, the keys of its variants as its axes, and its slots, together with separator, which is _ where the configuration sets none.

rewriteRuntime(dir, separator)

Rewrites two files under dir, the directory codegen wrote the runtime into, prepends an import of the naming package to each, and writes separator, the one the compiler was configured with, as a literal where the scheme reads it:

| File | Line | Rewritten as | | ----------------- | -------------------------------------------------------- | -------------------------------------------------------------------------- | | helpers | parts.join(":") | atomicClass(parts.join(":"), "_") | | helpers | set.add(name) | if (name !== "") set.add(name) | | recipes/runtime | `${className}--${prop}_${withoutSpace(value)}` | variantClass(className, prop, value) | | recipes/runtime | return classPrefix ? `${classPrefix}-${next}` : next | return atomicClass(classPrefix ? `${classPrefix}-${next}` : next, "_") |

Each line is matched once, as @pandacss/compiler 2.0.0-beta.17 writes it. A compiler release that moves a line throws here, which is the version pin. The files are read under the mjs extension, or under js where the compiler was configured for that. A second run changes nothing.

renameSelectors(css, config)

| Step | Does | | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Rename | Each class in each selector goes through rename of the naming package, with config.recipes and config.separator, once per class | | Remove | A selector that needs the class of a boolean axis at false is removed, since no element carries it. Inside :is(), :where() or :has() only that entry is removed. :not() of it is kept as written, because it matches everything at the specificity of the class | | Prune | A rule or a block the removal leaves empty is removed too | | Collision | Classes that renamed to one name are reported as naming/collision, an error naming each | | Unreachable | The classes whose rules were removed are reported once as naming/unreachable, a warning listing them, since a styled false branch is authored CSS that reaches no element | | Raw | The classes kept under a raw selector or at-rule condition, at any depth, are reported once as naming/raw-condition, a warning listing them | | Leave alone | A keyframe step, a rule that names no class, and a layer order statement |

The diagnostics take the compiler's own Diagnostic shape, so a reporter written for the compiler prints them unchanged.

The scheme reads a class as the compiler writes it with hash off and no prefix. A hashed class has no structure to read, and a prefix is not read from a recipe's class.

Licence

MIT. See LICENSE.