question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support dark mode

See original GitHub issue

Add a prefers-color-scheme CSS media query for dark mode.

Something like:

.leaflet-bar a,
.leaflet-bar a:hover {
	width: 26px;
	height: 26px;
	line-height: 26px;
	display: block;
	text-align: center;
	text-decoration: none;
}

@media (prefers-color-scheme: light) {
.leaflet-bar a,
.leaflet-bar a:hover {
	background-color: #fff;
	border-bottom: 1px solid #ccc;
	color: black;
        }
}

@media (prefers-color-scheme: dark) {
.leaflet-bar a,
.leaflet-bar a:hover {
	background-color: #000;
	border-bottom: 1px solid #333;
	color: white;
	}
}

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
vanillajonathancommented, Jun 29, 2021

Something like this:

.leaflet-bar a,
.leaflet-bar a:hover {
	background-color: #fff;
	border-bottom: 1px solid #ccc;
	color: black;
	width: 26px;
	height: 26px;
	line-height: 26px;
	display: block;
	text-align: center;
	text-decoration: none;
}

@media (prefers-color-scheme: dark) {
.leaflet-bar a,
.leaflet-bar a:hover {
	background-color: #000;
	border-bottom: 1px solid #333;
	color: white;
	}
}
1reaction
Malvozcommented, Jun 29, 2021

A note on backwards compatibility:

The “light” styles (the current styles applied by default) should remain outside a prefers-color-scheme media query, otherwise nothing will apply in browsers that do not support that media feature. I.e. only a prefers-color-scheme: dark media query is necessary (to override the default light colors).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Supporting Dark Mode in Your Interface - Apple Developer
The dark appearance, known as Dark Mode, implements an interface style that many apps already adopt. Users choose the aesthetic they prefer, and...
Read more >
Browse in Dark mode or Dark theme - Google Chrome Help
When you browse in Dark mode or Dark theme in Chrome, your homepage, toolbar, settings, and some other pages will be dark. Android...
Read more >
Adapting Your App to Support Dark Mode - RayWenderlich.com
In this tutorial, you'll learn how to add support for Dark Mode in your app, making it look great in low-light environments.
Read more >
Dark Mode: Adding support to your app in Swift - SwiftLee
Dark Mode was introduced in iOS 13 and announced at WWDC 2019. It adds a darker theme to iOS and allows you to...
Read more >
Dark theme - Android Developers
Dark theme · Can reduce power usage by a significant amount (depending on the device's screen technology). · Improves visibility for users with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found