Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dark mode #135

Merged
merged 20 commits into from
Dec 8, 2024
Merged

Dark mode #135

merged 20 commits into from
Dec 8, 2024

Conversation

hiddewie
Copy link
Owner

@hiddewie hiddewie commented Nov 2, 2024

Fixes #125

Add support for Dark mode.

By default the system mode is used, which auto-selects the light or dark mode based on system preferences. The user can select light or dark mode explicitly in the settings.

Uses Bootstrap's dark mode support. https://getbootstrap.com/docs/5.3/customize/color-modes/#enable-dark-mode

Requires patching some icons / colors in the MapLibre GL JS UI.

Hardcoded colors have been put into the colors map and are now theme-dependenent.

The style generation outputs a JSON style file per theme, and the UI selects the style based on the user's preferences.

The resulting contrast between text and the background is a bit lower than using light mode.

The colors can be tweaked more in separate PRs if needed.

@hiddewie
Copy link
Owner Author

hiddewie commented Nov 2, 2024

current view

image

@hiddewie
Copy link
Owner Author

A workaround until a solution is implemented in the MapLibre style specification, is to generate two variants of each style to the JSON: one for light and one for dark mode.

@hiddewie
Copy link
Owner Author

hiddewie commented Dec 8, 2024

Infrastructure

image

image

image

Speed

image

Train protection

image

image

Electrification

image

image

Gauge

image

Loading gauge

image

Track class

image

@hiddewie hiddewie marked this pull request as ready for review December 8, 2024 15:07
@hiddewie hiddewie merged commit 34da93e into master Dec 8, 2024
6 checks passed
@hiddewie hiddewie deleted the dark-mode branch December 8, 2024 15:14
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.

Dark mode
1 participant