Skip to content

Theming

PondPilot Widget supports a powerful theming system. You can use built-in themes, auto-detection, or create your own.

  • light: The default theme. Clean, white background.
  • dark: A dark theme suitable for dark mode websites.
  • auto: Automatically switches between light and dark based on the user’s system preference (prefers-color-scheme).

Usage:

<!-- Use dark theme -->
<pre class="pondpilot-snippet" data-theme="dark">...</pre>
<!-- Use auto theme -->
<pre class="pondpilot-snippet" data-theme="auto">...</pre>

You can register custom themes using PondPilot.registerTheme(). A theme can extend an existing one (light or dark) and override specific tokens.

Tokens map to CSS custom properties.

TokenDescription
bgColorMain background color.
textColorMain text color.
primaryBgPrimary color (buttons, highlights).
editorBgBackground of the code editor area.
syntaxKeywordColor for SQL keywords.
fontFamilyFont stack for UI elements.
editorFontFamilyMonospace font stack for code.

(See full list in API docs or source).

PondPilot.registerTheme('midnight-neon', {
extends: 'dark',
config: {
bgColor: '#0c1022',
textColor: '#e7ecff',
borderColor: 'rgba(56, 189, 248, 0.18)',
editorBg: '#050814',
primaryBg: '#22d3ee',
syntaxKeyword: '#38bdf8',
syntaxString: '#fb7185',
// ... other overrides
},
});

Then apply it:

<pre class="pondpilot-snippet" data-theme="midnight-neon">
SELECT 'Glowing text' AS status;
</pre>

Under the hood, themes simply set CSS variables on the widget container. You can also override these directly in your CSS if you prefer not to use the JS API.

.pondpilot-widget[data-theme="my-custom-theme"] {
--pondpilot-bg-color: #f0f0f0;
--pondpilot-primary-bg: #ff0000;
}