Theming

Customize SQL Workbench Embedded to match your website's design

Built-in Themes

SQL Workbench Embedded comes with three built-in themes that you can use out of the box.

Using Built-in Themes

built-in-themes.js

Light Theme

Ideal for websites with light backgrounds. Features clean, bright colors optimized for readability.

Dark Theme

Perfect for dark mode websites. Reduces eye strain with carefully chosen dark colors.

Auto Theme

Automatically adapts to the user's system preference (prefers-color-scheme).

Creating Custom Themes

Extend built-in themes or create completely custom themes to match your brand.

Basic Custom Theme

custom-theme.js

Live Preview - myBrand Theme

DuckDB-inspired theme with warm yellow and amber accents.

Advanced Custom Theme

For complete control, define all theme properties including typography and spacing.

advanced-theme.js

Live Preview - Ocean Theme

Experience the dark ocean theme with this interactive example.

Theme Properties Reference

Complete list of all available theme properties you can customize.

Color Properties

PropertyDescriptionExample
bgColorMain background color#ffffff
textColorPrimary text color#1e293b
borderColorBorder and divider color#e2e8f0
editorBgSQL editor background#f8fafc
editorTextSQL editor text color#0f172a
editorFocusBgEditor background when focused#f1f5f9
controlsBgControls background#ffffff
primaryBgPrimary button background#3b82f6
primaryTextPrimary button text color#ffffff
primaryHoverPrimary button hover state#2563eb
secondaryBgSecondary button background#f1f5f9
secondaryTextSecondary button text color#1e293b
secondaryHoverSecondary button hover state#e2e8f0
mutedTextMuted/secondary text color#64748b
errorTextError message text color#dc2626
errorBgError message background#fee2e2
errorBorderError message border color#fca5a5
tableHeaderBgResult table header background#f1f5f9
tableHeaderTextResult table header text color#0f172a
tableHoverTable row hover background#f8fafc

Syntax Highlighting (Optional)

These properties control SQL syntax highlighting colors in the editor.

PropertyDescriptionExample
syntaxKeywordSQL keywords (SELECT, FROM, WHERE, etc.)#7c3aed
syntaxStringString literals#059669
syntaxNumberNumeric values#dc2626
syntaxCommentComment text#64748b

Typography Properties

Customize fonts and sizes for different UI components to match your design system or improve accessibility.

PropertyDescriptionExample
fontFamilyFont family for container and UI elementsInter, system-ui, sans-serif
editorFontFamilyFont family for the SQL editor (monospace)JetBrains Mono, monospace
fontSizeBase font size for UI elements14px
editorFontSizeFont size for the SQL editor13px
buttonFontSizeFont size for buttons14px
metadataFontSizeFont size for metadata text12px

Note: All color properties accept hexadecimal color values (e.g., '#0ea5e9'). Font sizes can be specified in px, rem, or em units. You can extend existing themes and only override the properties you need.

Best Practices

Extend Existing Themes

Use the extends property to build on top of 'light' or 'dark' themes. Only override the properties you need to change.

Maintain Contrast

Ensure sufficient contrast between text and backgrounds for readability. Use tools like WebAIM's contrast checker.

Test Both Light and Dark

If your site supports dark mode, create custom themes for both light and dark variants to maintain consistency.

Use CSS Variables

Consider using CSS custom properties from your design system for consistent theming across your entire site.

Avoid Over-Styling

Don't customize every property. Keep your theme focused on brand colors and key visual elements.

Example Themes

Get inspired by these pre-built custom theme examples.

Dracula

Popular dark theme with vibrant colors. Inspired by the CodeMirror Dracula theme.

Solarized Light

Precision colors for readability. Based on the acclaimed Solarized color scheme.

Solarized Dark

Dark variant of Solarized with carefully chosen contrasts for extended coding.

Ambiance

Warm dark theme with earthy tones. Inspired by the CodeMirror Ambiance theme.

Dracula Theme Configuration

dracula-theme.js

Live Preview - Dracula Theme

Solarized Light Theme Configuration

solarized-light-theme.js

Live Preview - Solarized Light Theme

Solarized Dark Theme Configuration

solarized-dark-theme.js

Live Preview - Solarized Dark Theme

Ambiance Theme Configuration

ambiance-theme.js
Live Preview - Ambiance Theme