Skip to content

Conversation

@andrewgazelka
Copy link
Contributor

@andrewgazelka andrewgazelka commented Nov 11, 2025

Not perfect but

image

Implement idiomatic CSS-based theme switching using prefers-color-scheme media queries. The explorer now automatically adapts between light and dark themes based on the user's system/browser preference.

Changes:

  • Add light and dark theme color schemes using @media queries
  • Update v2 colors.css with theme-aware CSS custom properties
  • Update v3 style.css with theme-aware CSS custom properties
  • Update Ace editor theme to use CSS variables for theme support
  • Convert entity tree SVG lines to use CSS classes for theming
  • Support both legacy (v2) and modern (v3) versions

The implementation uses CSS custom properties (variables) that change based on prefers-color-scheme, making it work automatically without JavaScript. All colors adapt seamlessly when users switch their OS theme preference.

Implement idiomatic CSS-based theme switching using prefers-color-scheme
media queries. The explorer now automatically adapts between light and
dark themes based on the user's system/browser preference.

Changes:
- Add light and dark theme color schemes using @media queries
- Update v2 colors.css with theme-aware CSS custom properties
- Update v3 style.css with theme-aware CSS custom properties
- Update Ace editor theme to use CSS variables for theme support
- Convert entity tree SVG lines to use CSS classes for theming
- Support both legacy (v2) and modern (v3) versions

The implementation uses CSS custom properties (variables) that change
based on prefers-color-scheme, making it work automatically without
JavaScript. All colors adapt seamlessly when users switch their OS
theme preference.
Address visibility issues where light-colored icons and UI elements
were not visible against light backgrounds in light mode.

Changes:
- Add CSS filters to invert icons in light theme (v2 and v3)
- Icons now appear dark on light backgrounds
- Add theme-aware tree selection background color
- Entity tree selection now uses --tree-select-bg variable
- Light theme uses grey-300 for selection (visible on light bg)
- Dark theme uses steel-650 for selection (visible on dark bg)
- Apply inversion to all icon types: span.icon, entity-tree-icon,
  navigation icons, status icons, etc.
- Inversion includes brightness adjustment for better contrast

Fixes issues with:
- Sidebar icons being invisible in light mode
- Expander arrows (> nav-right) being invisible
- Tree selection highlighting not visible
- Other UI icons appearing washed out
@andrewgazelka andrewgazelka marked this pull request as ready for review November 11, 2025 16:54
@SanderMertens
Copy link
Member

This is useful, but would need a light/dark button to let people switch manually if they want to.

@SanderMertens
Copy link
Member

There are also a couple of readability issues that would have to get fixed.

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.

3 participants