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 🙏

© 2025 – Pkg Stats / Ryan Hefner

en-vogue

v0.0.2

Published

Zero-runtime CSS-in-JS with static CSS extraction

Readme

En Vogue

Zero-runtime CSS-in-JS with static CSS extraction. Currently a proof of concept, implemented as a Vite plugin.

Try on StackBlitz

Features

  • Convenience of CSS-in-JS with zero runtime overhead (unlike Emotion or Styled Components)
  • Colocation of styles with components (unlike Vanilla Extract)
  • Same performance characteristics as static CSS
  • Hot reloading, code splitting, and other Vite features
  • Supports all frameworks and vanilla JS

Installation

Install the en-vogue package as a development dependency:

npm install -D en-vogue

Then import enVogue from "en-vogue/vite" and add it to your Vite config:

import { defineConfig } from "vite";
import { enVogue } from "en-vogue/vite";

export default defineConfig({
	plugins: [enVogue()],
});

Usage

The css function takes a CSS object and returns a class name. It supports nested selectors.

import { css } from "en-vogue";

const className = css({
	color: "red",
	"&:hover": {
		color: "blue",
	},
});

The above example will generate the following CSS and return the class name "ev-sadlkj" (or something like that):

.ev-sadlkj {
	color: red;
}

.ev-sadlkj:hover {
	color: blue;
}

The css function can't do everything a runtime CSS-in-JS solution can do. In particular, all property values have to be literal constants. You can achieve coarse-grained dynamic behavior by using class name concatenation, maybe via libraries like classnames, clsx, or cva.

If you need fine-grained dynamic property values, use the dynamicCss function. Dynamic values will be replaced with CSS variables and returned as the style property, ready to be passed to a React element, for examples. The class name will be returned as the className property.

import { dynamicCss } from "en-vogue";
import { hoverColor } from "./theme";

const { style, className } = dynamicCss({
	color: "red",
	"&:hover": {
		color: hoverColor,
	},
});

This will generate the following CSS:

.ev-sadlkj {
	color: red;
}
.ev-sadlkj:hover {
	color: var(--ev-qwerty);
}

And the className property will contain "ev-sadlkj" while the style property will contain { "--ev-qwerty": hoverColor }.

TODO

  • Missing functionality (keyframes, media queries, etc.)
  • Better typings
  • Automatic atomic CSS extraction

License

MIT