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

@vobs/theme

v1.9.1

Published

Token-based theming with light/dark/system modes, CSS variable output, and scoped theme boundaries.

Readme

@vobs/theme

Token-based theming with light/dark/system modes, CSS variable output, and scoped theme boundaries.

Install

npm install @vobs/theme

Quick start

import { createTheme } from '@vobs/theme'

const theme = createTheme({
  defaultMode: 'system',
  themes: {
    light: { brand: { primary: '#2563eb' } },
    dark: { brand: { primary: '#60a5fa' } }
  }
})

theme.resolvedMode.value // 'light' or 'dark', follows prefers-color-scheme
theme.setMode('dark')
theme.theme.value.brand.primary // '#60a5fa'

const unregister = theme.registerTheme('dark', { density: 'compact' })
theme.setBrand({ secondary: '#0f766e' })
unregister()

API

| Signature | Description | | --- | --- | | createTheme(options?: ThemeOptions): ThemeContext | Creates a theme context; defaultMode defaults to 'light', themes merge over the built-in defaults. | | defaultLightTheme / defaultDarkTheme | Built-in token sets covering brand, semantic, neutral, spacing, and radius tokens. | | theme.theme: Signal<ThemeTokens> | Merged tokens for the resolved mode plus overrides. | | theme.brand: Signal<BrandTokens> | The brand branch of the current theme. | | theme.mode: Signal<ThemeMode> | 'light', 'dark', or 'system'. | | theme.resolvedMode: Signal<ResolvedThemeMode> | Concrete 'light' or 'dark'; follows the OS when mode is 'system'. | | theme.setMode(mode: ThemeMode): void | Switches the mode. | | theme.setTheme(tokens: ThemeTokens): void | Replaces the user override tokens. | | theme.setBrand(brand: Partial<BrandTokens>): void | Merges brand overrides into the current tokens. | | theme.registerTheme(mode: ResolvedThemeMode, tokens: ThemeTokens): () => void | Extends a mode's tokens at runtime; returns a restore function. | | theme.dehydrate() / theme.hydrate(snapshot) | Serializes and restores mode and overrides for SSR. | | theme.dispose(): void | Stops the system preference listener and disposes signals. | | themePlugin(options?): VobsPlugin | Provides the context through THEME_KEY. | | useTheme(): ThemeContext | Injects the theme context inside components. | | ThemeBoundary(props?: ThemeBoundaryProps): VobsNode | Renders a scoped element, writes its CSS variables, and overrides tokens for its subtree. | | flattenTheme(theme: ThemeTokens): Record<string, string> | Flattens nested tokens into CSS variable names. |

With mode set to 'system', resolvedMode tracks the OS prefers-color-scheme through a live matchMedia listener. Nested tokens flatten to --vobs-* CSS variables (brand.primary becomes --vobs-brand-primary); keys that already start with -- are kept as-is. A ThemeBoundary merges the parent theme with its own theme, tokens, and brand props, so overrides stay local to its subtree.

Types

ThemeMode, ResolvedThemeMode, ThemePrimitive, ThemeTokenValue, ThemeTokens, BrandTokens, ThemeOptions, ThemeContext, ThemePluginOptions, ThemeBoundaryProps, ThemeDehydratedState