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

@ninna-ui/core

v0.3.0

Published

Design tokens, Tailwind CSS v4 class mappings, and 5 oklch CSS theme presets with automatic dark mode for Ninna UI

Readme

@ninna-ui/core

Design system foundation — pure TypeScript tokens, Tailwind class mappings, and 5 CSS theme presets with automatic dark mode.

npm License: MIT

📖 Full Documentation →  |  📦 npm →  |  🐙 GitHub →

@ninna-ui/core is the zero-dependency foundation of Ninna UI. It contains no React code, no JSX, and no component logic — only the shared design language that every component package consumes.

Why this matters: Unlike libraries that bundle theming into a JS runtime (Chakra UI, Mantine), Ninna UI's entire theme system lives in pure CSS. Your app ships zero theming JavaScript — just CSS custom properties that the browser resolves natively.

Installation

pnpm add @ninna-ui/core

CSS Setup

Add one of the 5 theme presets to your app's CSS entry point, then set data-theme on your root element:

@import "tailwindcss";
@import "@ninna-ui/core/theme/presets/default.css";

@variant dark (&:is(.dark *));
<html data-theme="default">

No @source needed — each theme preset automatically scans all @ninna-ui package dist files via built-in @source directives. Every preset requires a data-theme attribute to activate. This allows multiple presets to be safely imported for per-section theming without CSS conflicts.

| Preset | Colors | Character | |--------|--------|-----------| | default.css | Purple / Magenta | Vibrant, electric | | ocean.css | Blue / Cyan | Cool, professional | | sunset.css | Orange / Rose | Warm, bold | | forest.css | Green / Amber | Natural, earthy | | minimal.css | Monochrome | Clean, understated |

Switch themes by changing one line — no JavaScript configuration, no provider wrappers, no build step. All presets can be imported simultaneously for per-section theming using nested data-theme attributes.

Framework-Specific Setup

Vite / React Router — use @tailwindcss/vite:

// vite.config.ts
import tailwindcss from "@tailwindcss/vite";
export default { plugins: [tailwindcss()] };

Next.js — use @tailwindcss/postcss:

// postcss.config.mjs
export default { plugins: { "@tailwindcss/postcss": {} } };

Dark Mode

Every preset includes automatic dark mode via @media (prefers-color-scheme: dark). The selector pattern per preset is:

/* Light (default when no class set) */
[data-theme="preset"] { }

/* Explicit dark — .dark class on <html> or ancestor */
.dark [data-theme="preset"],
[data-theme="preset"].dark { }

/* System dark — no class, follows OS preference */
@media (prefers-color-scheme: dark) {
  [data-theme="preset"]:not(.light):not(.dark) { }
}

For manual toggle, add the .dark or .light class to your root element:

<!-- Forced dark -->
<html data-theme="default" class="dark">

<!-- Forced light (blocks OS preference) -->
<html data-theme="default" class="light">

<!-- System preference auto (no class) -->
<html data-theme="default">

All colors use the oklch color space — perceptually uniform, vibrant, and WCAG AA compliant.

Design Tokens

Type definitions for the design system's foundational values — consumed by every component package:

import type { Color, Size, Radius, ColorVariant } from '@ninna-ui/core';

| Token | Values | |-------|--------| | Color | neutral, primary, secondary, accent, info, success, warning, danger | | Size | xs, sm, md, lg, xl | | CompactSize | sm, md, lg | | Radius | none, sm, md, lg, xl, 2xl, full | | TextSize | base, xs, sm, md, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl | | TextWeight | light, normal, medium, semibold, bold | | TextAs | p, span, div, h1h6 | | HeadingLevel | h1, h2, h3, h4, h5, h6 | | ColorVariant | solid, soft, outline | | ButtonVariant | solid, soft, outline, ghost, text | | InputVariant | outline, filled, flushed, unstyled |

Tailwind Class Mappings

Pre-built maps from design tokens to Tailwind CSS classes — used internally by component .styles.ts files:

import { BG_COLORS, TEXT_COLORS, RADIUS_CLASSES, SOLID_VARIANTS } from '@ninna-ui/core';

BG_COLORS.primary      // "bg-primary"
TEXT_COLORS.danger      // "text-danger"
RADIUS_CLASSES.lg       // "rounded-lg"
SOLID_VARIANTS.primary  // Complete solid variant class set for primary

Available Maps

Color maps:

  • BG_COLORS, TEXT_COLORS, BORDER_COLORS — Semantic color classes
  • SOFT_BG_COLORS, MUTED_BG_COLORS, MUTED_BORDER_COLORS — Opacity-based variants
  • SOLID_VARIANTS, SOFT_VARIANTS, OUTLINE_VARIANTS, GHOST_VARIANTS, TEXT_VARIANTS — Complete variant class sets per color
  • RING_COLORS, STROKE_COLORS, MARKER_COLORS, HOVER_TEXT_COLORS — Additional utility maps

State maps:

  • FOCUS_RING_COLORS, FOCUS_BORDER_COLORS, INPUT_FOCUS_COLORS, FOCUS_VISIBLE_RING_COLORS
  • CHECKED_BG_COLORS, CHECKED_BORDER_COLORS
  • PEER_CHECKED_BG_COLORS, PEER_CHECKED_BORDER_COLORS, PEER_FOCUS_VISIBLE_RING_COLORS

Typography & radius:

  • TEXT_SIZE_CLASSES, TEXT_WEIGHT_CLASSES
  • RADIUS_CLASSES

CSS Custom Properties

Each theme preset defines ~31 CSS custom properties:

| Category | Properties | |----------|-----------| | Semantic | --color-primary, --color-secondary, --color-accent, --color-neutral | | Status | --color-success, --color-danger, --color-warning, --color-info | | Content | --color-primary-content, --color-secondary-content, --color-base-content, etc. | | Surfaces | --color-base-50 through --color-base-900 | | Borders | --color-base-200, --color-base-300 |

Package Structure

core/
├── src/
│   ├── index.ts               # Barrel: tokens + classes
│   ├── tokens/
│   │   ├── colors.ts          # Color, COLORS
│   │   ├── typography.ts      # TextSize, TextWeight, TextAs, HeadingLevel
│   │   ├── radius.ts          # Radius
│   │   ├── size.ts            # Size, CompactSize
│   │   └── variants.ts        # ColorVariant, InputVariant
│   ├── classes/
│   │   ├── colors/
│   │   │   ├── base.ts        # BG_COLORS, TEXT_COLORS, BORDER_COLORS
│   │   │   ├── variants.ts    # SOLID_VARIANTS, SOFT_VARIANTS, etc.
│   │   │   └── states.ts      # FOCUS_RING_COLORS, CHECKED_BG_COLORS, etc.
│   │   ├── typography.ts      # TEXT_SIZE_CLASSES, TEXT_WEIGHT_CLASSES
│   │   └── radius.ts          # RADIUS_CLASSES
│   └── theme/
│       ├── tailwind.css        # Shared @theme + animations + @variant dark
│       └── presets/
│           ├── default.css     # Purple / Magenta
│           ├── ocean.css       # Blue / Cyan
│           ├── sunset.css      # Orange / Rose
│           ├── forest.css      # Green / Amber
│           └── minimal.css     # Monochrome
└── package.json

Architecture Rules

  • No React, no JSX — This package must never import React
  • No component logic — Styles, behavior, and rendering belong in component packages
  • Types are the APIColor, Size, Radius are consumed by every component
  • CSS presets are complete — Each preset defines all required custom properties
  • Class maps are exhaustive — Every Color value has a corresponding entry in every map

Related Packages

License

MIT