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

rawstyle

v0.6.0

Published

🪶 Ultra‑light Compile‑time CSS‑in‑JS

Downloads

455

Readme

šŸ”„ Features

  • ⚔ True Zero Runtime:Ā styles are extracted at compile-time, no JS in production
  • šŸ’Ž Native CSS:Ā write regular CSS with all modern features
  • šŸ“¦ Modern Bundlers: built-in support for Next.js (Turbopack) and Vite (Rolldown)
  • šŸ”„ Hot Reload: instant CSS updates during development
  • 🌐 Global Types: eliminate the need to import css in every module
  • 🧩 VS Code Extension: syntax highlighting, validation, autocompletion, tooltips, and more
  • 🧹 ESLint Plugin: auto-fixable formatting rules for CSS inside templates

šŸš€ Quick Start

No need to read further, just try it out:

pnpm create rawstyle  # scaffold a demo project for your chosen platform

āš™ļø Setup

  1. Install the сore and the appropriate bundler plugin:
pnpm add -D rawstyle @rawstyle/next  # for Next.js
pnpm add -D rawstyle @rawstyle/vite  # for Vite
  1. Configure the bundler to use the plugin:

Next.js (Turbopack)

// next.config.ts
import { rawstyleTurboRule } from '@rawstyle/next'
import type { NextConfig } from 'next'

export default {
	turbopack: { rules: { ...rawstyleTurboRule } },
} satisfies NextConfig

The loader extracts CSS and injects it into the module as a base64-encoded CSS import.

Vite (Rolldown)

// vite.config.ts
import react from '@vitejs/plugin-react'
import rawstyle from '@rawstyle/vite'
import type { UserConfig } from 'rolldown-vite'

export default {
	plugins: [react(), rawstyle()],
} satisfies UserConfig

The plugin emits a virtual .css module containing extracted styles and imports it as a side effect.

šŸ•¹ļø Usage

Import-based

import { css, cn } from 'rawstyle'

Global types

You can make the css and cn type declarations global to avoid importing them in every module:

// via tsconfig.json:
"compilerOptions": {
	"types": ["rawstyle/globals"]
}
// or add this to your globals.d.ts:
import 'rawstyle/globals'
// or
/// <reference types="rawstyle/globals" />

🧩 API

Rawstyle provides two core primitives: css and cn:

// src/module.tsx
export const Component = ({ theme }: { theme: string }) => (
	// `cn` - class names merging utility
	<div className={cn('class', theme === 'dark' && card)}>
		Hello, World!
	</div>
)
// `css` assigned to a variable - generates scoped CSS
const card = css`
	padding: 1rem;
	color: var(--primary);
	&:hover { box-shadow: 0 4px 12px black; }
`
// `css` as a standalone expression - generates global CSS
void css`
	:root { --primary: #303030; }
	body { margin: 0; background: #ebebeb; }
`

This code compiles to:

import '\0virtual.css'

export const Component = ({ theme }: { theme: string }) => (
	<div className={['class', theme === 'dark' && card].filter(Boolean).join(' ')}>
		Hello, World!
	</div>
)

const card = 'card_hash5'

As you can see, the css template literal is replaced with a hashed class name, cn is transformed into a conditional string joiner, and the CSS is extracted into a separate virtual .css file:

/* virtual.css */
:root { --primary: #303030; }
body { margin: 0; background: #ebebeb; }

.card_hash5 {
	padding: 1rem;
	color: var(--primary);
	&:hover { box-shadow: 0 4px 12px black; }
}

🧩 Ecosystem

Rawstyle provides a suite of tools to enhance your development experience: