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

@goobits/themes

v1.3.2

Published

A reusable theme system for SvelteKit projects with Svelte 5 runes support

Readme

@goobits/themes

Theme management for SvelteKit applications with Svelte 5 runes support.

Features

  • Light, dark, and system theme modes with zero-flash SSR
  • Custom color schemes with extensible configuration
  • Reactive theme state using Svelte 5 runes
  • Cookie-based preference persistence
  • Route-specific theme overrides

Quick Start

1. Install

npm install @goobits/themes

2. Create configsrc/lib/config/theme.ts

import { createThemeConfig } from '@goobits/themes/core';

export const themeConfig = createThemeConfig({
    schemes: {
        default: {}, // All fields optional!
        dark: { displayName: 'Dark Mode' },
    },
});

3. Add server hookssrc/hooks.server.ts

import { createThemeHooks } from '@goobits/themes/server';
import { themeConfig } from '$lib/config/theme';

export const handle = createThemeHooks(themeConfig, {
    blockingScript: true
}).transform;

4. Add layout loadersrc/routes/+layout.server.ts

export function load({ locals }) {
    return { preferences: locals.themePreferences };
}

5. Update HTMLsrc/app.html

<html lang="en" class="%sveltekit.theme%"></html>

6. Wrap your appsrc/routes/+layout.svelte

<script>
    import { ThemeProvider } from '@goobits/themes/svelte';
    import { themeConfig } from '$lib/config/theme';
    import '@goobits/themes/themes/bundle.css';

    const { children } = $props();
</script>

<ThemeProvider config={themeConfig}>
    {@render children?.()}
</ThemeProvider>

Optional: Goo presets + SSR helpers

<script>
    import '@goobits/themes/themes/goo/bundle.css';
</script>
import { generateBlockingThemeScript } from '@goobits/themes/server/goo';

7. Add controls (optional)

<script>
    import { ThemeToggle, SchemeSelector } from '@goobits/themes/svelte';
</script>

<ThemeToggle />
<SchemeSelector />

That's it! See Getting Started for FOUC prevention and custom themes.

Documentation

| Guide | Description | | -------------------------------------------- | ------------------------------- | | Getting Started | Full setup with FOUC prevention | | API Reference | Complete API documentation | | Components | Built-in components and hooks | | Custom Themes | Create your own color schemes | | Troubleshooting | Common issues and solutions |

CSS Structure

The theme engine applies classes and attributes to <html>:

/* Target by attribute (recommended) */
[data-theme='dark'] {
    --bg: #000;
}
[data-theme='light'] {
    --bg: #fff;
}

/* Target by class (for system vs explicit) */
.theme-dark {
    /* explicit dark */
}
.theme-system-dark {
    /* system detected dark */
}

/* Scheme-specific */
.scheme-spells {
    --accent: #7c3aed;
}

License

MIT