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

@sometic/theme

v1.1.3

Published

Runtime design-token and theme management for framework-independent JavaScript applications.

Readme

@sometic/theme

Runtime design-token and theme management for framework-independent JavaScript apps.

@sometic/theme provides createThemeController and applyThemeToElement so you can register themes, resolve light/dark/system modes, density and direction, high-contrast and reduced-motion preferences, and apply CSS variables plus data attributes to a host element. Contrast helpers and semantic token definitions live on dedicated subpaths.

Sometic separates behavior from visuals. Theme exists so portable engines can respect user and system preferences without shipping a locked visual language or depending on Tailwind/Bootstrap at runtime. Controllers are disposable, hydratable with optional persistence via @sometic/store, and safe to use from any adapter that can set attributes and CSS custom properties.

Standout features include multi-theme registration, system color scheme with preference subscriptions, scoped controllers (createScopedThemeController), defineSemanticTokens with required paths, contrast audit helpers (auditThemeContrast, assertThemeContrast), and snapshots that expose tokens, CSS variables, and attributes together. Subpaths cover tokens, css-variables, contrast, system, and presets.

In the ecosystem, theme depends on @sometic/core, @sometic/store, and @sometic/styling. Pair it with component packages and docs theming pages. Introduction: https://sometic.dev/guide/introduction.

Install

pnpm add @sometic/theme
npm install @sometic/theme
yarn add @sometic/theme

Usage

Create a controller and apply a snapshot to the document element:

import { applyThemeToElement, createThemeController, defineSemanticTokens } from "@sometic/theme";

const lightTokens = defineSemanticTokens({
    color: {
        bg: "#ffffff",
        fg: "#111111",
        brand: "#0b6bcb",
        danger: "#c62828",
    },
});

const theme = createThemeController({
    themes: [{ id: "light", tokens: lightTokens, colorScheme: "light" }],
    defaultThemeId: "light",
    mode: "system",
    persist: false,
});

const unsubscribe = theme.subscribe((snapshot) => {
    applyThemeToElement(document.documentElement, snapshot);
});

theme.setMode("dark");

Audit contrast against WCAG levels:

import { auditThemeContrast } from "@sometic/theme";

const result = auditThemeContrast({
    color: {
        bg: "#ffffff",
        fg: "#111111",
        brand: "#0b6bcb",
        danger: "#c62828",
    },
});

if (!result.ok) {
    console.warn(result.violations);
}

CDN

Docs: https://sometic.dev/stores/theme.

Simple script

<script src="https://cdn.jsdelivr.net/npm/@sometic/[email protected]/dist/cdn/sometic-theme.iife.js"></script>
<script>
    const theme = SometicTheme.createThemeController({ themes: [], defaultThemeId: "light" });
</script>

Module script

<script type="module">
    import { createThemeController } from "https://cdn.jsdelivr.net/npm/@sometic/[email protected]/dist/cdn/sometic-theme.esm.js";

    const theme = createThemeController({ themes: [], defaultThemeId: "light" });
</script>

Peers / when not to use

Runtime dependencies: @sometic/core, @sometic/store, @sometic/styling. No framework peers. Do not use theme as a CSS-in-JS library or as a replacement for static design-token pipelines when you only need build-time CSS. Prefer class/slot resolvers in @sometic/styling when you are only merging classes without runtime mode switching.

Docs

License

MIT