Skip to content

feat: add dark mode theme - #14

Merged
MathiasVDA merged 10 commits into
mainfrom
copilot/add-dark-mode-theme
Dec 7, 2025
Merged

MathiasVDA merged 10 commits into
mainfrom
copilot/add-dark-mode-theme

Conversation

Copilot AI commented Dec 7, 2025 •

Copy link
Copy Markdown

Implements light/dark theme switching for Yasgui with persistent user preferences and system theme detection.

Implementation

  • ThemeManager: Handles theme state, localStorage persistence (1-year expiry), and system preference detection via prefers-color-scheme
  • Theme toggle button: Positioned in control bar between Settings icon and PREFIX button with sun/moon icons for instant switching
  • Styling: CSS custom properties (~30 variables) applied across all components - editor (Material Palenight for dark mode), results, tables, tabs, modals, endpoint textbox, buttons, and hints
  • Configuration: theme?: 'light' | 'dark' and showThemeToggle?: boolean (default: true)

Themed Components

  • ✅ Yasqe editor with Material Palenight theme for dark mode
  • ✅ Yasr results viewer (Table and Response plugins)
  • ✅ Endpoint textbox (dark background with white text)
  • ✅ All buttons (share, query execute, maximize)
  • ✅ Tab labels and navigation
  • ✅ Notification hints (e.g., "Press CTRL - ")
  • ✅ CodeMirror autocomplete popup
  • ✅ Modals and dialogs

API

import Yasgui, { Theme } from '@matdata/yasgui';

const yasgui = new Yasgui(element, {
  theme: 'dark',
  showThemeToggle: true
});

yasgui.getTheme();        // Returns current theme
yasgui.setTheme('dark');  // Sets theme programmatically
yasgui.toggleTheme();     // Toggles between themes

Screenshots

Light Mode:
Light Mode

Dark Mode:
Dark Mode

See THEME_GUIDE.md for detailed configuration options.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add different themes (dark mode)</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits December 7, 2025 17:02
Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>
Copilot AI changed the title [WIP] Add different themes including dark mode Add dark mode theme support with toggle button Dec 7, 2025
Copilot AI requested a review from MathiasVDA December 7, 2025 17:11

@MathiasVDA MathiasVDA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the endpoint textbox also needs to be dark (with white text)
the colors of the share, query execute and maximise buttons in yasq dark mode are not changed
did you also adapt the plugin interface so that plug ins can also change mode?
did you adapt the default plugins 'table' and 'response' ? Also create a screenshot of these. Use a dummy yasqe query response if you can't access the internet

Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>

@MathiasVDA MathiasVDA left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The themeToggleIcon pushes the list of the queries to the right side. It would be better to put this icon next to the settings icon, between the settings icon and the 'prefix' button.

I notice the following three elements that do not change with a theme toggle:

  • the "Query" tab labels
  • the hint 'press CTRL - '
  • the settings modal dialog

please implement changes

- Move theme toggle button from tab bar to control bar (between Settings and PREFIX button)
- Fix "Query" tab label color to use theme variables
- Add theming for notification hints and CodeMirror autocomplete hints
- Update TabSettingsModal to handle theme toggle button creation

Co-authored-by: MathiasVDA <15101339+MathiasVDA@users.noreply.github.com>

Copilot AI commented Dec 7, 2025

Copy link
Copy Markdown
Author

The themeToggleIcon pushes the list of the queries to the right side. It would be better to put this icon next to the settings icon, between the settings icon and the 'prefix' button.

I notice the f...

Fixed in commit a92b25e:

  1. Theme toggle button relocated: Moved from tab bar to control bar, now positioned between the Settings icon and PREFIX button
  2. "Query" tab labels: Now properly themed with correct text colors in both light and dark modes
  3. Notification hints: Added theming for hint text (e.g., "press CTRL - ") - text now uses theme-aware colors

Light Mode:
Light Mode

Dark Mode:
Dark Mode

@MathiasVDA
MathiasVDA marked this pull request as ready for review December 7, 2025 21:47
@MathiasVDA
MathiasVDA marked this pull request as draft December 7, 2025 21:47
@MathiasVDA
MathiasVDA marked this pull request as ready for review December 7, 2025 21:47
@MathiasVDA MathiasVDA changed the title Add dark mode theme support with toggle button feat: add dark mode theme Dec 7, 2025
@MathiasVDA
MathiasVDA merged commit ef82cd9 into main Dec 7, 2025
3 checks passed
@MathiasVDA
MathiasVDA deleted the copilot/add-dark-mode-theme branch December 10, 2025 10:35

This branch was previously deployed

1 inactive deployment
github-pages — ecfd695e Deployed Dec 7, 2025 by MathiasVDA via deploy #15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add different themes (dark mode)

2 participants