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

@peace_node/core

v1.0.0

Published

Core design system with Tailwind CSS tokens, typography, and semantic styling

Readme

@styledoc/design-system

A comprehensive design system with Tailwind CSS tokens, typography, and semantic styling for modern web applications.

Features

  • 🎨 Custom Color Tokens - OKLCH-based color system with semantic tokens
  • 📝 Typography System - Sans, serif, and mono font tokens with proper spacing
  • 🏷️ Semantic HTML Styling - Pre-styled headings, paragraphs, lists, and more
  • 🌙 Dark Mode Support - Built-in light and dark theme variables
  • Framework Agnostic - Works with Next.js, Vite, and other build tools
  • 🔧 Easy Setup - One-command installation and configuration

Quick Start

Installation

npm install @styledoc/design-system

Automatic Setup

Run the setup script to automatically configure your project:

npx styledoc-setup

This will:

  • Install required dependencies (Tailwind CSS, PostCSS, Autoprefixer)
  • Create CSS files with design tokens
  • Setup Tailwind and PostCSS configuration files
  • Configure for your chosen framework (Next.js or Vite)

Manual Setup

If you prefer manual setup:

  1. Install dependencies:
npm install tailwindcss autoprefixer postcss tailwindcss-animate
  1. Create your Tailwind config:
// tailwind.config.js
const { createStyledocConfig } = require('@styledoc/design-system');

module.exports = createStyledocConfig({
  content: [
    './src/**/*.{js,ts,jsx,tsx}', // Adjust paths as needed
  ],
});
  1. Create your CSS file:
/* src/styles/globals.css or src/index.css */
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    /* Light mode semantic tokens */
    --background: 0 0% 100%;
    --foreground: 240 10% 3.9%;
    --primary: 250 64% 50%;
    --primary-foreground: 0 0% 98%;
    /* ... more tokens */
  }

  :root.dark {
    /* Dark mode tokens */
    --background: 240 10% 3.9%;
    --foreground: 0 0% 98%;
    /* ... more tokens */
  }
}
  1. Import the CSS in your app:
// Next.js: pages/_app.js or app/layout.js
import '../styles/globals.css'

// Vite: src/main.jsx
import './index.css'

Usage

Typography Tokens

The design system provides three font families with consistent sizing:

// Sans serif (default)
<h1 className="text-sans-4xl">Large Heading</h1>
<p className="text-sans-base">Body text</p>

// Serif
<h2 className="text-serif-3xl">Elegant Heading</h2>

// Monospace
<code className="text-mono-sm">Code snippet</code>

Available sizes: xs, sm, base, lg, xl, 2xl, 3xl, 4xl, 5xl, 6xl, 7xl, 8xl, 9xl

Color Tokens

Semantic Colors

<div className="bg-primary text-primary-foreground">Primary button</div>
<div className="bg-secondary text-secondary-foreground">Secondary content</div>
<div className="bg-muted text-muted-foreground">Muted text</div>
<div className="bg-destructive text-destructive-foreground">Error state</div>

Custom Color Palettes

// Dodger blue palette
<div className="bg-dodger-500 text-white">Dodger blue</div>
<div className="bg-dodger-100 text-dodger-900">Light dodger</div>

// Hydrant red palette  
<div className="bg-hydrant-500 text-white">Hydrant red</div>
<div className="bg-hydrant-100 text-hydrant-900">Light hydrant</div>

Semantic HTML Styling

HTML elements are automatically styled when you include the design system:

// These work out of the box with no classes needed
<h1>Automatically styled heading</h1>
<p>Automatically styled paragraph with proper spacing</p>
<ul>
  <li>List items with consistent styling</li>
  <li>Proper spacing and typography</li>
</ul>
<blockquote>Styled blockquotes</blockquote>
<code>Inline code styling</code>

Dark Mode

Toggle dark mode by adding the dark class to your root element:

// Toggle dark mode
document.documentElement.classList.toggle('dark');

Or use a library like next-themes:

import { ThemeProvider } from 'next-themes'

function App({ children }) {
  return (
    <ThemeProvider attribute="class" defaultTheme="system">
      {children}
    </ThemeProvider>
  )
}

Advanced Usage

Custom Configuration

You can extend the design system with your own tokens:

// tailwind.config.js
const { createStyledocConfig } = require('@styledoc/design-system');

module.exports = createStyledocConfig({
  theme: {
    extend: {
      colors: {
        brand: {
          50: '#f0f9ff',
          500: '#3b82f6',
          900: '#1e3a8a',
        }
      }
    }
  }
});

Individual Plugin Usage

Import specific plugins if you only need certain features:

// tailwind.config.js
const { styledocTypographyPlugin, styledocSemanticPlugin } = require('@styledoc/design-system');

module.exports = {
  plugins: [
    styledocTypographyPlugin, // Only typography tokens
    styledocSemanticPlugin,   // Only semantic HTML styling
  ]
}

Framework-Specific Notes

Next.js

  • CSS file should be in src/styles/globals.css
  • Import in pages/_app.js or app/layout.js
  • Supports both Pages Router and App Router

Vite

  • CSS file should be in src/index.css
  • Import in src/main.jsx
  • Works with React, Vue, and other Vite-supported frameworks

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - see the LICENSE file for details.

Support