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

@bootstrapp/theme

v0.2.0

Published

Standalone theming system with dynamic CSS variable generation and color utilities

Downloads

106

Readme

@bootstrapp/theme

Standalone theming system with dynamic CSS variable generation, color utilities, and HSL-based shade generation.

Features

  • 🎨 Color Utilities: Parse HEX, RGB, HSL formats
  • 🌈 Automatic Shade Generation: Creates lighter/light/dark/darker variants
  • 📦 CSS Variable Management: Generate and inject theme variables dynamically
  • 🔄 Runtime Theme Switching: Load themes on-the-fly
  • 🎯 Zero Dependencies: Pure JavaScript

Installation

Via npm

npm install @bootstrapp/theme

Via CDN

<script type="importmap">
{
  "imports": {
    "@bootstrapp/theme": "https://esm.sh/@bootstrapp/[email protected]"
  }
}
</script>

Quick Start

import Theme from '@bootstrapp/theme';

// Load a built-in theme
await Theme.loadTheme('gruvbox-dark');

// Or apply a custom theme
Theme.applyTheme({
  color: {
    primary: '#fabd2f',
    secondary: '#83a598',
  },
  spacing: {
    sm: '0.5rem',
    md: '0.75rem',
  }
});

API Reference

Core Functions

loadTheme(themeName: string): Promise<void>

Load and apply a registered theme.

applyTheme(themeData: object): void

Apply a theme object directly without registration.

registerTheme(name: string, loader: Function): void

Register a new theme with dynamic import.

generateShades(baseHSL: object, config?: object): object

Generate color shade variations from a base HSL color.

parseColor(colorString: string): object | null

Parse HEX, RGB, or HSL color strings into HSL format.

Built-in Themes

  • gruvbox-dark - Warm, retro dark theme
  • gruvbox-light - Warm, retro light theme

Theme Structure

export default {
  color: {
    primary: '#fabd2f',      // Auto-generates: lighter, light, dark, darker
    secondary: '#83a598',
    success: '#b8bb26',
    danger: '#fb4934',
  },
  spacing: {
    xs: '0.25rem',
    sm: '0.5rem',
    md: '0.75rem',
    lg: '1rem',
  },
  typography: {
    fontSize: {
      base: '1rem',
      lg: '1.125rem',
    }
  },
  radius: {
    sm: '0.25rem',
    md: '0.375rem',
  }
}

CSS Variables Generated

:root {
  --color-primary: hsl(45 99% 60%);
  --color-primary-lighter: hsl(45 99% 80%);
  --color-primary-light: hsl(45 99% 70%);
  --color-primary-dark: hsl(45 99% 50%);
  --color-primary-darker: hsl(45 99% 40%);
  --spacing-sm: 0.5rem;
  --spacing-md: 0.75rem;
  /* ... etc */
}

License

AGPL-3.0