joey@designkit:~$ npm i @joeykwispel/design-kit

One design kit, every subdomain.

The colours, type, components and header of joeyoosenbrug.nl as one npm package. Every app installs it, so they all look and behave the same. This site is built with it too.

~/designkit/install.sh

Install

One package, plus the two fonts it is designed around. The fonts are self-hosted, so no visitor is sent to Google.

terminal
npm i @joeykwispel/design-kit @fontsource-variable/inter @fontsource-variable/jetbrains-mono

~/designkit/quick-start.md

QuickStart

From an empty app to the right colours, fonts and header. Pick the stack you are on.

  1. Install the kit and the fonts.

    terminal
    npm i @joeykwispel/design-kit @fontsource-variable/inter @fontsource-variable/jetbrains-mono
  2. Load the fonts and the two stylesheets once, in the root layout.

    src/routes/+layout.svelte
    <script lang="ts">
      import '@fontsource-variable/inter';
      import '@fontsource-variable/jetbrains-mono';
      import '@joeykwispel/design-kit/kit.css';
      import '@joeykwispel/design-kit/header.css';
      import Header from '$lib/components/Header.svelte';
    
      let { children } = $props();
    </script>
    
    <Header locale="en" />
    <main id="main">{@render children()}</main>
  3. Write a small header of your own that hands your links and languages to the kit’s header.

    src/lib/components/Header.svelte
    <script lang="ts">
      import { page } from '$app/state';
      import { Header, headerLabels } from '@joeykwispel/design-kit/svelte';
    
      // 'en' | 'nl', from wherever your app keeps it
      let { locale } = $props();
    
      const links = $derived([
        { label: 'Play', href: '/play/', current: page.url.pathname === '/play/' },
        { label: 'Scores', href: '/scores/', current: page.url.pathname === '/scores/' }
      ]);
      const languages = $derived([
        { code: 'en', href: '/', current: locale === 'en' },
        { code: 'nl', href: '/nl/', current: locale === 'nl' }
      ]);
    </script>
    
    <Header {links} {languages} labels={headerLabels[locale]} />
  4. Set the theme before the first paint. app.html is a static file, so a server hook fills the script in.

    src/app.html
    <html lang="en" data-theme="dark">
      <head>
        <meta name="theme-color" content="#0a0e17" />
        <script>
          %jo.theme%
        </script>
        %sveltekit.head%
      </head>
    src/hooks.server.ts
    import { themeScript } from '@joeykwispel/design-kit/theme-script';
    
    export const handle = ({ event, resolve }) =>
      resolve(event, {
        transformPageChunk: ({ html }) => html.replace(/<script>\s*%jo\.theme%\s*<\/script>/, () => '<script>' + themeScript + '</script>')
      });

~/designkit/package.json

Contents

Each part is its own import, so an app takes only what it uses.

  • @joeykwispel/design-kit/kit.css

    Tokens for both themes, base styles, the backdrop, buttons, tags and cards.

  • @joeykwispel/design-kit/header.css

    The styles of the header. Classes start with jo-nav, so nothing clashes.

  • @joeykwispel/design-kit/header

    What the header does: scroll bar, mobile menu, theme switch, Ctrl K.

  • @joeykwispel/design-kit/svelte

    The header as a Svelte 5 component.

  • @joeykwispel/design-kit/react

    The header as a React component, for Next.js and friends.

  • @joeykwispel/design-kit/header.html

    The header as plain markup, for anything else.

  • @joeykwispel/design-kit/tokens

    Every token value as typed JavaScript, for canvas and generated images.

  • @joeykwispel/design-kit/tailwind.css

    The tokens as Tailwind 4 theme variables: bg-bg, text-muted, font-mono.

  • @joeykwispel/design-kit/theme-script

    The script that sets the theme before the first paint, and its CSP hash.