Skip to content

Map color mode preference#5362

Merged
gravitystorm merged 9 commits intoopenstreetmap:masterfrom
AntonKhorev:color-mode-preference-map
Dec 11, 2024
Merged

Map color mode preference#5362
gravitystorm merged 9 commits intoopenstreetmap:masterfrom
AntonKhorev:color-mode-preference-map

Conversation

@AntonKhorev
Copy link
Copy Markdown
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
Copy Markdown
Collaborator

@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
Copy Markdown
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
Copy Markdown

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
@gravitystorm
Copy link
Copy Markdown
Collaborator

Thanks @AntonKhorev , I think this works well.

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