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

@cassida/plugin-global-css

v0.7.0

Published

Vite plugin for Cassida: serves arbitrary global CSS (preflight, resets, body/tag-selector rules) via a virtual module, wrapped in a configurable `@layer` so it cooperates with Cassida's single-class output.

Readme

@cassida/plugin-global-css

Vite plugin that serves arbitrary global CSS — preflight, resets, body or tag-selector rules — to a Cassida-powered app through a virtual module, wrapped in a configurable @layer so it composes cleanly with Cassida's single-class output.

Cassida's chains always emit exactly one class per element; there is no built-in escape hatch for rules like body { ... } or *, ::before, ::after { ... }. This plugin fills that gap without introducing a second styling system.

Install

pnpm add -D @cassida/plugin-global-css

The plugin declares Vite as a peer dependency (vite ^5 || ^6 || ^7).

Use

// vite.config.ts
import { defineConfig } from 'vite';
import { cassida } from '@cassida/vite-plugin';
import { cassidaGlobalCss } from '@cassida/plugin-global-css';
import { recommended } from '@cassida/recommended';
import preflight from './preflight.css?raw';

export default defineConfig({
  plugins: [
    cassida(recommended()),
    cassidaGlobalCss({ css: preflight, layer: 'base' }),
  ],
});
// main.tsx
import 'virtual:cassida-global.css';

The default @layer base wrap pairs with the cascade declaration

@layer base, cas;

(emit this once near the top of your entry file, or rely on the order Vite generates) so Cassida's single-class rules in @layer cas always beat preflight without !important or specificity bumps.

Options

| Option | Type | Default | | ----------- | ----------------------------- | ------------------------------------ | | css | string | (required) | | layer | string \| null | 'base' | | virtualId | string | 'virtual:cassida-global.css' |

  • layer: null skips the @layer wrap. The CSS then lives at the document-default layer, which ranks above any layered rules — almost always not what you want against Cassida. Use it only when you understand the cascade consequences.
  • virtualId lets you mount multiple instances of the plugin (e.g. one for preflight, one for print). Each instance must have a distinct id; import each id explicitly from your entry.

Companion: @cassida/plugin-print

If you want CSS-mania-grade print styling for free, pair this plugin with @cassida/plugin-print:

import { cassidaGlobalCss } from '@cassida/plugin-global-css';
import { printPreflight } from '@cassida/plugin-print';

cassidaGlobalCss({
  css: printPreflight(),
  layer: 'base',
  virtualId: 'virtual:cassida-print.css',
});

License

MIT © pishio