Skip to content

Commit

Permalink
Read dark mode filter from custom css property
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKhorev committed Dec 9, 2024
1 parent b6e06af commit 7a70881
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ $(document).ready(function () {
// See https://turbo.hotwired.dev/reference/drive#turbo.session.drive
Turbo.session.drive = false;

$("body").css("--dark-mode-map-filter", "invert(.9) hue-rotate(180deg)");

var headerWidth = 0,
compactWidth = 0;

Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ body.small-nav {
@include color-mode(dark) {
.leaflet-tile-container .leaflet-tile,
.mapkey-table-entry td:first-child > * {
filter: brightness(.8);
filter: var(--dark-mode-map-filter);
}

.leaflet-container .leaflet-control-attribution a {
Expand Down

0 comments on commit 7a70881

Please sign in to comment.