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

@mehdashti/tokens

v0.2.1

Published

Design tokens for Smart Platform - colors, spacing, typography, and themes

Downloads

386

Readme

@smart/tokens

Design system tokens for Smart Platform - Colors, spacing, typography, and more

Enterprise-grade design tokens built with the Industrial Petrol Palette. Provides consistent styling across all Smart Platform applications.

Features

  • Industrial Petrol Palette - Professional color scheme aligned with APISmith
  • HSL Color Format - Easy to manipulate and customize
  • Dark/Light Themes - Automatic theme switching support
  • Semantic Colors - Success, warning, error, info with backgrounds and borders
  • Spacing Scale - 4px base scale from 0 to 384px
  • Typography System - Font sizes, weights, and line heights
  • Border Radius - Consistent corner rounding
  • Shadows - Elevation system
  • Z-Index - Layering scale

Installation

# Using pnpm (recommended)
pnpm add @smart/tokens

# Using npm
npm install @smart/tokens

# Using yarn
yarn add @smart/tokens

Usage

Import CSS Theme

// In your main entry file (e.g., main.tsx or App.tsx)
import '@smart/tokens/theme.css'

This imports the complete theme with:

  • Base design tokens (spacing, typography, etc.)
  • Light theme (default)
  • Dark theme ([data-theme="dark"])

Theme Switching

// Set theme via data attribute
document.documentElement.setAttribute('data-theme', 'dark')  // Dark mode
document.documentElement.setAttribute('data-theme', 'light') // Light mode

// Or use a theme store (recommended)
import { create } from 'zustand'

interface ThemeStore {
  theme: 'light' | 'dark' | 'system'
  setTheme: (theme: 'light' | 'dark' | 'system') => void
}

export const useThemeStore = create<ThemeStore>((set) => ({
  theme: 'system',
  setTheme: (theme) => {
    const effectiveTheme = theme === 'system'
      ? window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
      : theme

    document.documentElement.setAttribute('data-theme', effectiveTheme)
    set({ theme })
  }
}))

Using Tokens in CSS

All tokens are available as CSS custom properties:

.my-component {
  /* Colors (use with hsl()) */
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));

  /* Primary color */
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));

  /* Spacing */
  padding: var(--spacing-4);      /* 16px */
  margin: var(--spacing-2);       /* 8px */
  gap: var(--spacing-0-5);        /* 2px */

  /* Typography */
  font-size: var(--font-size-base);   /* 1rem */

  /* Border radius */
  border-radius: var(--radius-md);    /* 3px */

  /* Shadows */
  box-shadow: var(--shadow-md);

  /* Z-index */
  z-index: var(--z-modal);
}

Color Palette

Light Theme

| Token | HSL | Hex | Usage | |-------|-----|-----|-------| | --background | 220 14% 96% | #F3F4F6 | Page background | | --foreground | 221 39% 11% | #1F2937 | Text color | | --primary | 195 100% 28% | #006D8F | Primary actions, links | | --primary-foreground | 0 0% 100% | #FFFFFF | Text on primary | | --border | 220 13% 91% | #E5E7EB | Borders |

Dark Theme

| Token | HSL | Hex | Usage | |-------|-----|-----|-------| | --background | 221 39% 11% | #111827 | Page background | | --foreground | 220 14% 96% | #F3F4F6 | Text color | | --primary | 195 45% 38% | #35778C | Primary actions (matte) | | --border | 217 19% 27% | #374151 | Borders |

Semantic Colors

Success (Green)

  • Light: --success: 142 64% 24% (#166534)
  • Dark: --success: 156 72% 67% (#6EE7B7)
  • Background: --success-bg
  • Border: --success-border

Warning (Orange)

  • Light: --warning: 26 83% 31% (#92400E)
  • Dark: --warning: 43 96% 65% (#FCD34D)

Error (Red)

  • Light: --error: 0 74% 35% (#991B1B)
  • Dark: --error: 0 94% 82% (#FCA5A5)

Info (Blue)

  • Light: --info: 224 76% 40% (#1E40AF)
  • Dark: --info: 213 93% 78% (#93C5FD)

Spacing Scale

| Token | Value | Pixels | |-------|-------|--------| | --spacing-0-5 | 0.125rem | 2px | | --spacing-1 | 0.25rem | 4px | | --spacing-2 | 0.5rem | 8px | | --spacing-4 | 1rem | 16px | | --spacing-8 | 2rem | 32px |

[See full table in docs]


Examples

Button with Primary Color

function PrimaryButton() {
  return (
    <button
      style={{
        backgroundColor: 'hsl(var(--primary))',
        color: 'hsl(var(--primary-foreground))',
        padding: 'var(--spacing-2) var(--spacing-4)',
        borderRadius: 'var(--radius-md)',
      }}
    >
      Click me
    </button>
  )
}

Alert with Semantic Colors

<div
  style={{
    backgroundColor: 'hsl(var(--success-bg))',
    color: 'hsl(var(--success))',
    border: '1px solid hsl(var(--success-border))',
    padding: 'var(--spacing-3)',
    borderRadius: 'var(--radius-md)',
  }}
>
  Success message
</div>

Related Packages


Version: 0.1.1