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

@soltana-ui/mermaid

v0.1.0

Published

Mermaid theme bridge for Soltana UI.

Readme

@soltana-ui/mermaid

npm version License: MIT


Mermaid theme bridge for Soltana UI — synchronizes diagram colors with the active theme tier.

DocumentationMain Package


Features

  • Automatic theme sync — Diagrams update when Soltana theme changes
  • Runtime + static modes — Live CSS synchronization or precompiled JSON themes
  • soltana:change listener — Responds to tier change events
  • Minimal footprint — ~7KB compiled

Installation

npm install @soltana-ui/mermaid soltana-ui mermaid

Peer dependencies: soltana-ui, mermaid@^11.0.0

Quick Start

Runtime Sync (Recommended)

Reads live CSS custom properties and auto-syncs diagrams with theme changes:

import mermaid from 'mermaid';
import { initMermaidSync } from '@soltana-ui/mermaid';

mermaid.initialize({ startOnLoad: true });
initMermaidSync(); // Auto-sync on theme change

When the user changes the theme (e.g., via setTheme('light')), all Mermaid diagrams automatically update.

Static JSON Themes

Use precompiled theme JSON for non-Soltana environments:

import mermaid from 'mermaid';
import darkTheme from '@soltana-ui/mermaid/mermaid/dark.json';

mermaid.initialize({
  startOnLoad: true,
  theme: 'base',
  themeVariables: darkTheme.themeVariables,
});

Available themes: dark.json, light.json, sepia.json

API

initMermaidSync()

Initializes automatic theme synchronization.

initMermaidSync();

Behavior:

  • Reads CSS custom properties from :root
  • Maps to Mermaid's theme variables
  • Listens for soltana:change events on document.documentElement
  • Re-initializes Mermaid when theme changes

Note: Only the theme tier affects Mermaid. Relief and finish tiers are CSS-layer effects that don't apply to SVG rendering.

getMermaidTheme()

Manually extract current theme variables from CSS:

import { getMermaidTheme } from '@soltana-ui/mermaid';

const theme = getMermaidTheme();
console.log(theme);
// {
//   primaryColor: '#d4a843',
//   primaryTextColor: '#f5f0e6',
//   ...
// }

How It Works

%%{init: {'theme': 'dark'}}%%
flowchart LR
    User[User Changes Theme] --> Event[soltana:change event]
    Event --> Sync[initMermaidSync]
    Sync --> CSS[Read CSS Variables]
    CSS --> Map[Map to Mermaid Theme]
    Map --> Reinit[mermaid.initialize]
    Reinit --> Render[Re-render Diagrams]

    style User fill:#44475a,stroke:#8be9fd
    style Event fill:#44475a,stroke:#ff79c6
    style Sync fill:#44475a,stroke:#ffb86c
    style Render fill:#44475a,stroke:#50fa7b

The bridge:

  1. Listens for soltana:change events dispatched by Soltana UI
  2. Reads CSS custom properties (--text-default, --surface-default, --primary, etc.)
  3. Maps them to Mermaid's theme variables
  4. Calls mermaid.initialize() with new theme
  5. Triggers re-render of all diagrams

Static Theme Files

Precompiled JSON themes are available in dist/mermaid/:

dist/
└── mermaid/
    ├── dark.json
    ├── light.json
    └── sepia.json

Import via package exports:

import darkTheme from '@soltana-ui/mermaid/mermaid/dark.json';
import lightTheme from '@soltana-ui/mermaid/mermaid/light.json';
import sepiaTheme from '@soltana-ui/mermaid/mermaid/sepia.json';

These files are generated by @soltana-ui/tokens during the build process.

Ecosystem

| Package | Purpose | | --------------------------------- | --------------------------------------- | | soltana-ui | Core CSS + JS enhancers | | @soltana-ui/tokens | Token compiler (generates Mermaid JSON) | | @soltana-ui/react | React bindings |

Documentation

License

MIT License - see LICENSE file for details.