# Why Your App Should Have Both Dark And Light Themes

DevFeed: [Why Your App Should Have Both Dark And Light Themes](<https://devfeed.tech/articles/why-your-app-should-have-both-dark-and-light-themes-38476.md>)

Original publisher: [Read original article](<https://eevis.codes/blog/2024-03-07/why-your-app-should-have-both-dark-and-light-themes/>)

Author: Eevis Panula

Published: 2024-03-07T04:11:46.439000Z

Content type: tutorial

Language: en

Sources: [Eevis Blog](<https://devfeed.tech/sources/eevis-blog.md>)

Topics: [Accessibility](<https://devfeed.tech/topics/accessibility.md>), [Dark Mode](<https://devfeed.tech/topics/dark-mode.md>), [Android](<https://devfeed.tech/topics/android.md>), [Jetpack Compose](<https://devfeed.tech/topics/jetpack-compose.md>), [XML](<https://devfeed.tech/topics/xml.md>), [Material Design](<https://devfeed.tech/topics/material-design.md>), [Flutter](<https://devfeed.tech/topics/flutter.md>)

Tags: [accessibility](<https://devfeed.tech/tags/accessibility.md>), [android](<https://devfeed.tech/tags/android.md>), [android-development](<https://devfeed.tech/tags/android-development.md>), [dark-mode](<https://devfeed.tech/tags/dark-mode.md>), [flutter](<https://devfeed.tech/tags/flutter.md>), [jetpack-compose](<https://devfeed.tech/tags/jetpack-compose.md>), [material-design](<https://devfeed.tech/tags/material-design.md>), [xml](<https://devfeed.tech/tags/xml.md>)

## AI overview

This article explains why apps should support both dark and light themes for accessibility. It discusses how different visual conditions and preferences can make either theme more suitable, then outlines Android support for system theme switching and references implementation guidance for XML themes, Jetpack Compose, Material Design 3, and Flutter.

## Source excerpt

You might have heard that your app should have a dark theme available. Some say it's because of preference, but it's actually also an accessibility thing. This blog post itself doesn't have the code to enable dark and light themes for the user. Instead, it explains why having both of them is essential and provides further reading on the topic -- yes, with links to some code and instructions as well. Accessibility of Dark and Light Themes Many people use everything they can in a dark theme. After all, staring at screens for a long time might be easier if the user interface uses darker colors. Using a dark theme instead of a light one also saves some battery. However, many people choose to use the dark theme because it is more accessible for them. For example, some vision issues might cause discomfort because of light or even wash out the rest of the person's vision. A white (or similar) background behind the text can cause these issues. Another reason is that dark themes often have better contrast (if they're designed properly). Now, if the dark theme is so great, why not just have the dark theme for the app and forget about the light theme? While dark theme is more accessible for many, some people benefit from light theme. For example, people with astigmatism may find light theme more accessible, and people with dyslexia might prefer light mode for readability. For reference, see, for example, this article: Dark mode: How accessible design raises the bar - Layth Sihan Luckily, defining light and dark themes in modern Android development is straightforward. Let's discuss the technical considerations of light and dark themes next. Technical Considerations Starting from Android 10 (SDK 29), there is a system setting for switching between dark and light modes. If you define your themes correctly, your app will respect that system-wide setting by default. To define a dark theme for your app using themes from XML files, follow the instructions in Android documentation: Imp