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

@pg-labs-incubator/lightningcss-plugin-cobweb

v0.0.3

Published

LightningCSS plugin providing Cobweb specific CSS extensions.

Readme

lightningcss-plugin-cobweb

LightningCSS plugin providing Cobweb specific CSS extensions. These extensions are required when using the cobweb package; however, the extensions are available for general use. The extensions are documented in the package documentation of index.ts, which is also published with the package declarations (target/tsc/index.d.ts).

| Extension | Description | | ----------------------- | --------------------------------------------------------------------- | | cw-var() | Resolve a role token to its value, or to its custom property. | | cw-scale-opacity() | Scale the alpha channel of a color. | | cw-spring-motion-of() | Generate the linear() easing function or duration of a spring. | | -cw-border-radius | Assign the corner radii of a corner group role. | | -cw-typescale | Assign the font and letter spacing of a typescale group role. | | @cw-attribute-roles | Register the role properties of an attribute. | | @cw-apply-theme | Assign the values of a theme, or the default values with default. | | @cw-apply-defaults | Assign the default values of component roles to the matched elements. |

A Cobweb module has one style sheet, so importing one of its components brings the rules of them all, and the roles of those with a design attribute of their own. Pass the components a bundle never shows as unusedComponents to newCobwebVisitor(design, opts), and check the built bundle with findUnusedComponent() and findUnusedRole(), against its scripts and any HTML it emits.

The style sheets published by cobweb are not compiled: they use these extensions. An application using cobweb must compile them with LightningCSS and this plugin, and must load the Cobweb design with cobweb-design. The plugin warns about var() fallbacks which can never apply.

Example (Vite)

import { Design } from "@pg-labs-incubator/cobweb-design";
import { COBWEB_AT_RULES, newCobwebVisitor } from "@pg-labs-incubator/lightningcss-plugin-cobweb";
import { composeVisitors } from "lightningcss";
import { defineConfig } from "vite";

export default defineConfig({
	css: {
		transformer: "lightningcss",
		lightningcss: {
			customAtRules: COBWEB_AT_RULES,
			visitor: composeVisitors([
				// Resolve the package from the directory of this configuration file:
				newCobwebVisitor(Design.load(
					"@pg-labs-incubator/cobweb",
					undefined,
					undefined,
					import.meta.dirname
				)),
				// ... additional visitors ...
			])
		}
	}
});

License

This package is licensed under the GPL-2.0 license.