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

@centrodphlibs/css-modules-theme

v0.0.6

Published

CSS modules theme tokens based on @centrodphlibs/theme

Readme

@centrodphlibs/css-modules-theme

CSS modules theme tokens package based on @centrodphlibs/theme. Provides CSS custom properties (CSS variables) that can be consumed by CSS modules components.

Installation

npm install @centrodphlibs/css-modules-theme

Usage

Import Theme CSS

First, import the theme CSS file to ensure theme variables are available:

import '@centrodphlibs/css-modules-theme/style.css';

Or in your main CSS file:

@import '@centrodphlibs/css-modules-theme/style.css';

Using Theme Tokens in CSS Modules

Use CSS variables directly in your CSS modules:

/* MyComponent.module.css */
.myComponent {
  background-color: var(--color-primary);
  color: var(--color-text);
  padding: var(--spacing-m);
}

Using Theme Tokens in TypeScript

Import and use theme tokens in your TypeScript code:

import { themeTokens } from '@centrodphlibs/css-modules-theme';
import styles from './MyComponent.module.css';

function MyComponent() {
  return (
    <div
      className={styles.myComponent}
      style={{
        backgroundColor: themeTokens.colors.primary,
        padding: themeTokens.spacing.m,
      }}
    >
      Content
    </div>
  );
}

Example: Button Component

/* Button.module.css */
.button {
  background-color: var(--color-primary);
  color: var(--color-text);
  padding: var(--spacing-m) var(--spacing-l);
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

.button:hover:not(:disabled) {
  background-color: var(--color-secondary);
}

Available Theme Tokens

Colors:

  • themeTokens.colors.primary - Primary color (var(--color-primary))
  • themeTokens.colors.secondary - Secondary color (var(--color-secondary))
  • themeTokens.colors.success - Success color (var(--color-success))
  • themeTokens.colors.warning - Warning color (var(--color-warning))
  • themeTokens.colors.error - Error color (var(--color-error))
  • themeTokens.colors.info - Info color (var(--color-info))
  • themeTokens.colors.background - Background color (var(--color-background))
  • themeTokens.colors.surface - Surface color (var(--color-surface))
  • themeTokens.colors.text - Primary text color (var(--color-text))
  • themeTokens.colors.textSecondary - Secondary text color (var(--color-text-secondary))
  • themeTokens.colors.border - Border color (var(--color-border))

Spacing:

  • themeTokens.spacing.s - Small spacing (var(--spacing-s))
  • themeTokens.spacing.m - Medium spacing (var(--spacing-m))
  • themeTokens.spacing.l - Large spacing (var(--spacing-l))

CSS Variables

All theme values are available as CSS custom properties:

  • --color-primary, --color-secondary, etc.
  • --spacing-s, --spacing-m, --spacing-l

TypeScript

Full TypeScript support is included. Theme tokens are fully typed and provide autocomplete support.

Related Packages

  • @centrodphlibs/theme - Base theme data package
  • @centrodphlibs/button-css-modules - Button component using CSS modules

Running unit tests

Run nx test css-modules-theme to execute the unit tests via Vitest.