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

Map color mode preference #5362

Merged

Conversation

AntonKhorev
Copy link
Collaborator

Includes #5339. Implements step 5 from #5324 (comment).

image
image

@mixin dark-map-color-scheme {
.leaflet-tile-container .leaflet-tile,
.mapkey-table-entry td:first-child > * {
filter: brightness(.8);
Copy link
Contributor

@hlfan hlfan Dec 3, 2024

Choose a reason for hiding this comment

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

Doesn't the mentioned step 5 include the need for the filters to be set individually to give the cartographers a choice?
I don't see that as a necessity for this PR, but already setting the filter through a custom property defined on the layer could ease the transition to that being implemented and also act as default and fallback:

here {
    filter: var(--dark-mode-map-filter);
}
somewhere else {
    .leaflet-layer {
        --dark-mode-map-filter: brightness(.8);
    }
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Step 5 has an impossible requirement of "make it dark but don't pick any filter". The closest possible thing is "don't touch existing filters".

@hlfan hlfan mentioned this pull request Dec 5, 2024
@omcnoe
Copy link

omcnoe commented Dec 6, 2024

This will only be configurable for logged in users, meaning that non-logged in will still be stuck on the dark UI + dimmed tiles.

@gravitystorm gravitystorm merged commit 83043d6 into openstreetmap:master Dec 11, 2024
22 checks passed
@gravitystorm
Copy link
Collaborator

Thanks @AntonKhorev , I think this works well.

@AntonKhorev AntonKhorev deleted the color-mode-preference-map branch December 11, 2024 18:44
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.

4 participants