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

@mochi-css/stitches

v2.0.0

Published

This package is part of the [Mochi-CSS project](https://github.com/Niikelion/mochi-css). It provides a [Stitches](https://stitches.dev)-compatible API for Mochi-CSS, allowing you to migrate from Stitches or use the familiar `createStitches` authoring styl

Readme

🧁 Mochi-CSS/stitches

This package is part of the Mochi-CSS project. It provides a Stitches-compatible API for Mochi-CSS, allowing you to migrate from Stitches or use the familiar createStitches authoring style with compile-time extraction.


Installation

npm i @mochi-css/stitches

Add the builder plugin to your mochi.config.ts:

// mochi.config.ts
import { defineConfig } from "@mochi-css/config";
import { stitchesPlugin } from "@mochi-css/stitches/config";

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

createStitches(config)

Creates a bound set of styling functions configured with your design tokens, media queries, and utilities.

import { createStitches } from "@mochi-css/stitches";

const { css, styled, keyframes, globalCss, createTheme, theme, config } =
    createStitches({
        prefix: "app",
        media: {
            sm: "(min-width: 640px)",
            md: "(min-width: 768px)",
            lg: "(min-width: 1024px)",
        },
        theme: {
            colors: {
                primary: "#3b82f6",
                danger: "#ef4444",
            },
            space: {
                1: "4px",
                2: "8px",
                4: "16px",
            },
        },
        utils: {
            mx: (value: unknown) => ({ marginLeft: value, marginRight: value }),
            px: (value: unknown) => ({
                paddingLeft: value,
                paddingRight: value,
            }),
        },
    });

Returned functions

| Property | Description | | --------------------------- | ---------------------------------------------------------------------- | | css(...styles) | Creates a MochiCSS class, same as @mochi-css/vanilla css() | | styled(target, ...styles) | Creates a typed React component, same as @mochi-css/react styled() | | keyframes(stops) | Defines a CSS animation | | globalCss(styles) | Injects global CSS (returns a no-op function) | | createTheme(tokens) | Creates an additional theme class overriding design tokens | | theme | Token reference object — use theme.colors.primary in style values | | config | The resolved config object passed to createStitches |


Design tokens

Token values are referenced in styles using the $ prefix:

const { css, theme } = createStitches({
    theme: {
        colors: { blue: "#3b82f6" },
        space: { 4: "16px" },
    },
});

const button = css({
    color: "$blue", // → var(--colors-blue)
    padding: "$4", // → var(--space-4)
});

Token references are automatically mapped to CSS custom properties at build time.


Locally scoped tokens ($$)

Use $$name to define a component-local CSS variable:

const button = css({
    $$shadowColor: "rgba(0,0,0,0.2)",
    boxShadow: "0 2px 4px $$shadowColor",
});

Named media queries

Use the keys from media as responsive variant keys:

const { css } = createStitches({
    media: { sm: "(min-width: 640px)" },
});

const box = css({
    variants: {
        size: {
            small: { padding: 8 },
            large: { padding: 16 },
        },
    },
});

// <Box size={{ "@sm": "large" }} />

createTheme

Creates an additional theme by overriding token values. Returns a class name to apply to a container element.

const { createTheme, theme } = createStitches({
    theme: { colors: { primary: "blue" } },
});

const darkTheme = createTheme({
    colors: { primary: "navy" },
});

// <div className={darkTheme.className}>...</div>

StitchesConfig

| Field | Type | Description | | ---------- | ------------------------ | ------------------------------------------------------------------ | | prefix | string | Optional prefix for generated class names and CSS variables | | media | Record<string, string> | Named media query breakpoints | | theme | StitchesTheme | Design token scales (colors, space, sizes, etc.) | | themeMap | Record<string, string> | Maps CSS properties to token scales. Defaults to defaultThemeMap | | utils | StitchesUtils | Custom CSS property shorthands |