Skip to content

Conversation

@wooter
Copy link
Contributor

@wooter wooter commented Dec 8, 2025

This PR adds an optional dark mode to TeslaMate with three appearance options:

  • Light: Always use light theme
  • System (default): Automatically match OS/browser dark mode preference
  • Dark: Always use dark theme

Key features:

  • Database-persisted theme preference in GlobalSettings
  • Comprehensive dark mode styling for all UI components
  • Monochrome map tiles in dark mode (Tesla-inspired aesthetic)
  • Instant theme switching without page reload
  • No flash of wrong theme on page load
  • Defaults to system preference for best UX

Technical implementation:

  • New theme_mode field in settings table (migration included, defaults to "system")
  • CSS custom properties for theme colors
  • JavaScript theme detection and system preference monitoring
  • LiveView hook for instant theme changes
  • Inverted OSM map tiles with grayscale filter for dark mode
  • Sticky footer positioning for consistent layout
  • Test coverage for theme settings

Maintains backward compatibility - the migration sets the default to "system", providing the best out-of-box experience by respecting user preferences.

This PR adds an optional dark mode to TeslaMate with three appearance options:
- Light (default): Always use light theme
- Follow System: Automatically match OS/browser dark mode preference
- Dark: Always use dark theme

Key features:
- Database-persisted theme preference in GlobalSettings
- Comprehensive dark mode styling for all UI components
- Monochrome map tiles in dark mode (Tesla-inspired aesthetic)
- Instant theme switching without page reload
- No flash of wrong theme on page load
- Defaults to light mode for existing users

Technical implementation:
- New theme_mode field in settings table (migration included)
- CSS custom properties for theme colors
- JavaScript theme detection and system preference monitoring
- LiveView hook for instant theme changes
- Inverted OSM map tiles with grayscale filter for dark mode

Maintains backward compatibility - existing installations will
default to light mode and users can opt-in to dark mode.
@netlify
Copy link

netlify bot commented Dec 8, 2025

Deploy Preview for teslamate ready!

Name Link
🔨 Latest commit 3e4c83d
🔍 Latest deploy log https://app.netlify.com/projects/teslamate/deploys/694f99281c6234000844088f
😎 Deploy Preview https://deploy-preview-5065--teslamate.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

- Dutch: Thema, Weergave, Licht, Donker, Volg systeem
- French: Thème, Apparence, Clair, Sombre, Suivre le système
- German: Design, Darstellung, Hell, Dunkel, Systemeinstellung folgen
@JakobLichterfeld JakobLichterfeld changed the title Add optional dark mode feature feat: add optional dark mode feature Dec 10, 2025
Copy link
Member

@JakobLichterfeld JakobLichterfeld left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! It is very much appreciated, as #461 and #2729 /#2730 were never finished.
Currently, we only have the status bar sync to system; see #2840.

From my point of view:

  • We should default to system, as this is the best and default state-of-the-art UX
  • Add a test for the new setting
  • Add it to the README and docs and Screenshots

@JakobLichterfeld JakobLichterfeld added enhancement New feature or request area:teslamate Related to TeslaMate core labels Dec 10, 2025
@JakobLichterfeld JakobLichterfeld added this to the v2.3.0 milestone Dec 10, 2025
Copy link
Member

@JakobLichterfeld JakobLichterfeld left a comment

Choose a reason for hiding this comment

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

Thanks for processing the findings.

Beside of the small .gitignore finding, this PR is near perfect, thanks so much!

Copy link
Member

@JakobLichterfeld JakobLichterfeld left a comment

Choose a reason for hiding this comment

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

Perfect, ty!
After some tests on my side, it will be merged.

@JakobLichterfeld
Copy link
Member

JakobLichterfeld commented Jan 6, 2026

I did find one thing during testing:

In Geo-Fence view, the buttons on the right are not superb visible in dark mode:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:teslamate Related to TeslaMate core enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants