<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <id>https://web.dev/</id>
  <title>Guilherme Moser de Souza on web.dev</title>
  <updated>2026-04-15T23:21:06Z</updated>
  <author>
    <name>Guilherme Moser de Souza</name>
  </author>
  <link href="https://web.dev/authors/mobtec/feed.xml" rel="self"/>
  <link href="https://web.dev/"/>
  <icon>https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/wYWiAqwJid6lXBpotD6h.jpeg?auto=format</icon>
  <logo>https://web.dev/images/shared/rss-banner.png</logo>
  <subtitle>Web Developer</subtitle>
  
  
  <entry>
    <title>How Terra improved user engagement thanks to Dark Mode</title>
    <link href="https://web.dev/terra-dark-mode/"/>
    <updated>2021-12-18T00:00:00Z</updated>
    <id>https://web.dev/terra-dark-mode/</id>
    <content type="html" mode="escaped">&lt;p&gt;Terra, one of Brazil&#39;s largest media companies with 75 million monthly users, reduced the bounce rate by 60% and increased the pages read per session by 170% on desktop for users that prefer dark mode by providing a custom dark theme.&lt;/p&gt;
&lt;p&gt;In this article, we&#39;ll analyze Terra&#39;s journey from identifying the size of the &amp;quot;dark mode&amp;quot; cohort, to applying a custom dark theme, and finally measuring the impact of this implementation on their main KPIs.&lt;/p&gt;
&lt;ul class=&quot;stats&quot;&gt;
  &lt;div class=&quot;stats__item&quot;&gt;
    &lt;p class=&quot;stats__figure&quot;&gt;60&lt;sub&gt;%&lt;/sub&gt;&lt;/p&gt;
    &lt;p&gt;Reduction in Bounce Rates&lt;/p&gt;
  &lt;/div&gt;
  &lt;div class=&quot;stats__item&quot;&gt;
    &lt;p class=&quot;stats__figure&quot;&gt;170&lt;sub&gt;%&lt;/sub&gt;&lt;/p&gt;
    &lt;p&gt;More pages per session&lt;/p&gt;
  &lt;/div&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;what-is-dark-mode&quot;&gt;What is dark mode? &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/terra-dark-mode/#what-is-dark-mode&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Historically user interfaces in devices are displayed in &amp;quot;light mode&amp;quot;, which usually means displaying black text on top of light interfaces. The alternative is &amp;quot;dark mode&amp;quot;, with light text on a dark background, such as gray or black.&lt;/p&gt;
&lt;p&gt;Dark Mode has &lt;a href=&quot;https://web.dev/prefers-color-scheme/#why-dark-mode&quot;&gt;benefits&lt;/a&gt; for user experience. Some people prefer it for aesthetic or accessibility reasons. It has  other advantages, such as preserving battery life in devices. Users can express that they prefer dark mode via a setting in their devices, &lt;a href=&quot;https://web.dev/prefers-color-scheme/#activating-dark-mode-in-the-operating-system&quot;&gt;which depends on the operating system&lt;/a&gt;. For example, the following screenshot shows what the &lt;strong&gt;Dark Theme&lt;/strong&gt; configuration option looks like in devices that run &lt;strong&gt;Android Q&lt;/strong&gt;:&lt;/p&gt;
&lt;figure&gt;
  &lt;img alt=&quot;Android Q dark mode settings.&quot; decoding=&quot;async&quot; height=&quot;250&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 218px) 218px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/admin/Yh6SEoWDK1SbqcGjlL6d.png?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/admin/Yh6SEoWDK1SbqcGjlL6d.png?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/admin/Yh6SEoWDK1SbqcGjlL6d.png?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/admin/Yh6SEoWDK1SbqcGjlL6d.png?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/admin/Yh6SEoWDK1SbqcGjlL6d.png?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/admin/Yh6SEoWDK1SbqcGjlL6d.png?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/admin/Yh6SEoWDK1SbqcGjlL6d.png?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/admin/Yh6SEoWDK1SbqcGjlL6d.png?auto=format&amp;w=436 436w&quot; style=&quot;max-width: 218px; margin: 0 auto;&quot; width=&quot;218&quot; /&gt;
  &lt;figcaption&gt;Android&amp;nbsp;Q dark theme settings.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;To offer a better experience to users who prefer &amp;quot;dark mode&amp;quot;, you can use the &lt;a href=&quot;https://developer.mozilla.org/docs/Web/CSS/@media/prefers-color-scheme&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;prefers-color-scheme&lt;/code&gt;&lt;/a&gt; media query, with a value of &lt;code&gt;light&lt;/code&gt; or &lt;code&gt;dark&lt;/code&gt;. This media query reflects the user&#39;s choice in their device. You can then load a &lt;a href=&quot;https://web.dev/prefers-color-scheme/#dark-mode-in-practice&quot;&gt;custom dark theme&lt;/a&gt; for those that prefer dark. For example, by loading a &amp;quot;dark&amp;quot; CSS file, and changing values such as font and background colors. The following code shows an example of that:&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-css&quot;&gt;&lt;code class=&quot;language-css&quot;&gt;&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token property&quot;&gt;prefers-color-scheme&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; dark&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;   // apply a dark theme&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;token atrule&quot;&gt;&lt;span class=&quot;token rule&quot;&gt;@media&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token property&quot;&gt;prefers-color-scheme&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;:&lt;/span&gt; light&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;  // apply a light theme&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div class=&quot;wdi-browser-compat&quot;&gt;
  &lt;span class=&quot;wdi-browser-compat__label&quot;&gt;Browser support&lt;/span&gt;
  &lt;ul class=&quot;wdi-browser-compat__items&quot;&gt;
    &lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;chrome&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Chrome 76, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      76
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;firefox&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Firefox 67, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      67
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;edge&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Edge 79, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      79
    &lt;/span&gt;
    &lt;/li&gt;&lt;li class=&quot;wdi-browser-compat__item&quot;&gt;
    &lt;span class=&quot;wdi-browser-compat__icon&quot; data-browser=&quot;safari&quot;&gt;
      &lt;span class=&quot;visually-hidden&quot;&gt;Safari 12.1, Supported&lt;/span&gt;
    &lt;/span&gt;
    &lt;span class=&quot;wdi-browser-compat__version&quot; data-compat=&quot;yes&quot; title=&quot;Supported&quot; aria-label=&quot;Supported&quot;&gt;
      12.1
    &lt;/span&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  &lt;a class=&quot;wdi-browser-compat__link&quot; href=&quot;https://developer.mozilla.org/docs/Web/CSS/@media/prefers-color-scheme#browser_compatibility&quot; target=&quot;_blank&quot;&gt;Source&lt;/a&gt;
&lt;/div&gt;
&lt;aside class=&quot;aside flow bg-state-info-bg color-state-info-text&quot;&gt;&lt;div class=&quot; flow&quot;&gt; This article will only cover the technique of applying a custom dark theme, provided by the developer. Chrome 96 has introduced an &lt;a href=&quot;https://developer.chrome.com/blog/auto-dark-theme/#sign-up-for-the-origin-trial&quot;&gt;origin trial&lt;/a&gt; for &amp;quot;Auto Dark Themes&amp;quot; on Android, for which the browser applies an automatically generated dark theme to light themed sites, when the user has opted into dark themes in the operating system, without requiring the developer to provide styles for it. For more information about &amp;quot;Chrome Auto Dark Mode&amp;quot;, check out &lt;a href=&quot;https://developer.chrome.com/blog/auto-dark-theme/&quot;&gt;this article&lt;/a&gt;. &lt;/div&gt;&lt;/aside&gt;
&lt;h2 id=&quot;identifying-the-prefers-light-vs-dark-user-cohorts&quot;&gt;Identifying the &amp;quot;prefers light&amp;quot; vs &amp;quot;dark&amp;quot; user cohorts &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/terra-dark-mode/#identifying-the-prefers-light-vs-dark-user-cohorts&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;At the time of writing (December 2021), &lt;a href=&quot;https://chromestatus.com/features&quot; rel=&quot;noopener&quot;&gt;Chrome Platform Status&lt;/a&gt; determines that approximately &lt;a href=&quot;https://chromestatus.com/metrics/feature/timeline/popularity/3581&quot; rel=&quot;noopener&quot;&gt;22% of the web traffic&lt;/a&gt; comes from users with the &amp;quot;prefer dark&amp;quot; setting.&lt;/p&gt;
&lt;p&gt;This is aggregated data, so the real percentage of users who prefer dark that come to a site can vary. For that reason, to understand the size of this group it is advisable to run in house measurement.&lt;/p&gt;
&lt;p&gt;The following code creates an analytics dimension, to measure the performance of users that prefer &lt;code&gt;light&lt;/code&gt; vs. &lt;code&gt;dark&lt;/code&gt;:&lt;/p&gt;
&lt;div&gt;&lt;pre class=&quot;language-javascript&quot;&gt;&lt;code class=&quot;language-javascript&quot;&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;getColorScheme&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;let&lt;/span&gt; colorScheme &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;Unknown&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;matchMedia&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;matchMedia&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;(prefers-color-scheme: dark)&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;matches&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;            colorScheme &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;Dark&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;token keyword&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;matchMedia&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;(prefers-color-scheme: light)&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;matches&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;br /&gt;            colorScheme &lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;Light&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;        &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;    &lt;span class=&quot;token keyword&quot;&gt;return&lt;/span&gt; colorScheme&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ga&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;window&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;ga&lt;span class=&quot;token operator&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;ga&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;q&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;ga&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;q&lt;span class=&quot;token operator&quot;&gt;||&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;token function&quot;&gt;push&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;arguments&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;ga&lt;span class=&quot;token punctuation&quot;&gt;.&lt;/span&gt;l&lt;span class=&quot;token operator&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;token operator&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;token keyword&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;token class-name&quot;&gt;Date&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;ga&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;create&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;UA-ID&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;auto&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token function&quot;&gt;ga&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;set&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;color-scheme-preference&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token function&quot;&gt;getColorScheme&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;token function&quot;&gt;ga&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;token string&quot;&gt;&#39;send&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;token string&quot;&gt;&#39;pageview&#39;&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;token punctuation&quot;&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Terra implemented this code in their site and compared the behavior of both groups in mobile (Android) and desktop (Windows) devices. At that moment Terra wasn&#39;t providing a custom dark theme, so the goals of this experiment were:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Determining the size of the group of users who prefer dark.&lt;/li&gt;
&lt;li&gt;Identifying patterns: for example, do users that prefer dark leave the site more quickly compared to those that prefer light?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Knowing this can inform decisions, for example: if it&#39;s necessary to provide a custom dark theme.
These are the results Terra obtained after testing for 14 days:&lt;/p&gt;
&lt;h3 id=&quot;mobile-android&quot;&gt;Mobile (Android) &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/terra-dark-mode/#mobile-android&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In the case of mobile (Android) the numbers for bounce rate and pages per session didn&#39;t show big differences between the users that prefer &amp;quot;light&amp;quot;, compared to those that prefer &amp;quot;dark&amp;quot;:&lt;/p&gt;
&lt;div class=&quot;table-wrapper scrollbar&quot;&gt;
  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Display Mode&lt;/th&gt;
        &lt;th&gt;Bounce Rate&lt;/th&gt;
        &lt;th&gt;Pages Per Session&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;Prefers Light&lt;/td&gt;
        &lt;td&gt;25.84%&lt;/td&gt;
        &lt;td&gt;3.96&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Prefers Dark&lt;/td&gt;
        &lt;td&gt;26.10%&lt;/td&gt;
        &lt;td&gt;3.75&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;h3 id=&quot;desktop-windows&quot;&gt;Desktop (Windows) &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/terra-dark-mode/#desktop-windows&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;In the case of desktop (Windows), the group of users that preferred &amp;quot;dark&amp;quot; stayed much less on the site: they had almost &lt;strong&gt;twice the bounce rate and read a little more than half of the pages&lt;/strong&gt; than those users that preferred &amp;quot;light&amp;quot;:&lt;/p&gt;
&lt;div class=&quot;table-wrapper scrollbar&quot;&gt;
  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Display Mode&lt;/th&gt;
        &lt;th&gt;Bounce Rate&lt;/th&gt;
        &lt;th&gt;Pages Per Session&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;Prefers Light&lt;/td&gt;
        &lt;td&gt;13.20%&lt;/td&gt;
        &lt;td&gt;7.42&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Prefers Dark&lt;/td&gt;
        &lt;td&gt;24.12%&lt;/td&gt;
        &lt;td&gt;4.68&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;Based on this data, Terra hypothesized that users who prefer &amp;quot;dark&amp;quot; stay less in desktop devices, due to the lack of support of a dark theme in their site.&lt;/p&gt;
&lt;p&gt;As a next step Terra decided to work on a &amp;quot;dark theme&amp;quot; strategy to see if they could improve the engagement for the group of users that preferred dark.&lt;/p&gt;
&lt;h2 id=&quot;implementing-a-dark-theme&quot;&gt;Implementing a dark theme &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/terra-dark-mode/#implementing-a-dark-theme&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Most websites implement a dark theme by using the simple strategy shown previously of listening to user&#39;s configuration changes via the &lt;a href=&quot;https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme&quot; rel=&quot;noopener&quot;&gt;&lt;code&gt;prefers-color-scheme&lt;/code&gt;&lt;/a&gt; media query and changing styles based on that.&lt;/p&gt;
&lt;p&gt;Terra decided to give more control to the user: when they detect that they have the &amp;quot;prefer dark&amp;quot; setting turned on in their devices (via the media query), they show them a prompt to ask them if they want to navigate in &amp;quot;night mode&amp;quot;. As long as the user doesn&#39;t deny the prompt (by clicking on the &amp;quot;Ignore&amp;quot; button), they honor the user&#39;s OS-setting, and apply a custom dark theme:&lt;/p&gt;
&lt;figure&gt;
  &lt;img alt=&quot;Screenshot of Terra&amp;#x27;s light theme prompting the user to accept dark mode.&quot; decoding=&quot;async&quot; height=&quot;146&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 266px) 266px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/TRqfCAmBe025456JyX1b.png?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/TRqfCAmBe025456JyX1b.png?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/TRqfCAmBe025456JyX1b.png?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/TRqfCAmBe025456JyX1b.png?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/TRqfCAmBe025456JyX1b.png?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/TRqfCAmBe025456JyX1b.png?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/TRqfCAmBe025456JyX1b.png?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/TRqfCAmBe025456JyX1b.png?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/TRqfCAmBe025456JyX1b.png?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/TRqfCAmBe025456JyX1b.png?auto=format&amp;w=532 532w&quot; style=&quot;max-width: 266px; margin: 0 auto;&quot; width=&quot;266&quot; /&gt;
  &lt;figcaption&gt;Terra shows a prompt to the user asking if they want to navigate in dark mode after detecting that they prefer dark in their devices.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;As a complement of this strategy they provide additional configuration options in the &amp;quot;settings&amp;quot; screen, where the user can decide if they explicitly prefer &amp;quot;light&amp;quot;, &amp;quot;dark&amp;quot;, or want to rely on the underlying device settings.&lt;/p&gt;
&lt;figure&gt;
  &lt;img alt=&quot;Screenshots of Terra&amp;#x27;s configuration screen to opt in and out of dark mode.&quot; decoding=&quot;async&quot; height=&quot;417&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 480px) 480px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&amp;w=650 650w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&amp;w=741 741w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&amp;w=845 845w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/B7g0uvq2QB0eWVjnuMAl.png?auto=format&amp;w=960 960w&quot; style=&quot;max-width: 480px; margin: 0 auto;&quot; width=&quot;480&quot; /&gt;
  &lt;figcaption&gt;Terra&#39;s themes configurations allow users to choose between &quot;Dark&quot; and &quot;Light&quot; themes or rely on the device&#39;s settings.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;This is how Terra&#39;s &amp;quot;Night Mode&amp;quot; looks like:&lt;/p&gt;
&lt;figure&gt;
  &lt;img alt=&quot;Screenshot of Terra&amp;#x27;s dark theme.&quot; decoding=&quot;async&quot; height=&quot;468&quot; loading=&quot;lazy&quot; sizes=&quot;(min-width: 286px) 286px, calc(100vw - 48px)&quot; src=&quot;https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/QRW06FYeMghUI8obAQWC.png?auto=format&quot; srcset=&quot;https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/QRW06FYeMghUI8obAQWC.png?auto=format&amp;w=200 200w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/QRW06FYeMghUI8obAQWC.png?auto=format&amp;w=228 228w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/QRW06FYeMghUI8obAQWC.png?auto=format&amp;w=260 260w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/QRW06FYeMghUI8obAQWC.png?auto=format&amp;w=296 296w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/QRW06FYeMghUI8obAQWC.png?auto=format&amp;w=338 338w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/QRW06FYeMghUI8obAQWC.png?auto=format&amp;w=385 385w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/QRW06FYeMghUI8obAQWC.png?auto=format&amp;w=439 439w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/QRW06FYeMghUI8obAQWC.png?auto=format&amp;w=500 500w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/QRW06FYeMghUI8obAQWC.png?auto=format&amp;w=571 571w, https://web-dev.imgix.net/image/26V1DWN36MZr3mUo8ChSBlCpzp43/QRW06FYeMghUI8obAQWC.png?auto=format&amp;w=572 572w&quot; style=&quot;max-width: 286px; margin: 0 auto;&quot; width=&quot;286&quot; /&gt;
  &lt;figcaption&gt;Terra&#39;s dark theme, &quot;Night Mode&quot;.&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;aside class=&quot;aside flow bg-state-info-bg color-state-info-text&quot;&gt;&lt;div class=&quot; flow&quot;&gt; We have used mobile screenshots for simplicity, but Terra has applied the same strategy across mobile and desktop devices. &lt;/div&gt;&lt;/aside&gt;
&lt;h2 id=&quot;measuring-the-impact-of-terras-dark-theme&quot;&gt;Measuring the impact of Terra&#39;s dark theme &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/terra-dark-mode/#measuring-the-impact-of-terras-dark-theme&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;To measure the impact of the dark theme, Terra took the group of users that have the &amp;quot;Prefer Dark&amp;quot; setting turned on in their devices and compared engagement metrics when showing a &amp;quot;Light&amp;quot; vs. a &amp;quot;DarK&amp;quot; theme.
Here are the results for mobile (Android) and desktop (Windows):&lt;/p&gt;
&lt;h3 id=&quot;mobile-android-2&quot;&gt;Mobile (Android) &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/terra-dark-mode/#mobile-android-2&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;While bounce rates remained similar, pages and sessions almost doubled (from 2.47 to 5.24) when users were exposed to a dark theme:&lt;/p&gt;
&lt;div class=&quot;table-wrapper scrollbar&quot;&gt;
  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Display Mode&lt;/th&gt;
        &lt;th&gt;Bounce Rate&lt;/th&gt;
        &lt;th&gt;Pages Per Session&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;Prefers Light&lt;/td&gt;
        &lt;td&gt;26.91%&lt;/td&gt;
        &lt;td&gt;2.47&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Prefers Dark&lt;/td&gt;
        &lt;td&gt;23.91%&lt;/td&gt;
        &lt;td&gt;5.24&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;ul class=&quot;stats&quot;&gt;
  &lt;div class=&quot;stats__item&quot;&gt;
    &lt;p class=&quot;stats__figure&quot;&gt;2&lt;sub&gt;X&lt;/sub&gt;&lt;/p&gt;
    &lt;p&gt;More pages per session&lt;/p&gt;
  &lt;/div&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;desktop-windows-2&quot;&gt;Desktop (Windows) &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/terra-dark-mode/#desktop-windows-2&quot;&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Both metrics improved when showing a dark theme: bounce rates went from 27.25% to 10.82% and pages per session almost tripled (from 3.7 to 9.99).&lt;/p&gt;
&lt;div class=&quot;table-wrapper scrollbar&quot;&gt;
  &lt;table&gt;
    &lt;thead&gt;
      &lt;tr&gt;
        &lt;th&gt;Display Mode&lt;/th&gt;
        &lt;th&gt;Bounce Rate&lt;/th&gt;
        &lt;th&gt;Pages Per Session&lt;/th&gt;
      &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;td&gt;Prefers Light&lt;/td&gt;
        &lt;td&gt;27.5%&lt;/td&gt;
        &lt;td&gt;3.7&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td&gt;Prefers Dark&lt;/td&gt;
        &lt;td&gt;10.82%&lt;/td&gt;
        &lt;td&gt;9.99&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;
&lt;/div&gt;
&lt;ul class=&quot;stats&quot;&gt;
  &lt;div class=&quot;stats__item&quot;&gt;
    &lt;p class=&quot;stats__figure&quot;&gt;60&lt;sub&gt;%&lt;/sub&gt;&lt;/p&gt;
    &lt;p&gt;Reduction in Bounce Rates&lt;/p&gt;
  &lt;/div&gt;
  &lt;div class=&quot;stats__item&quot;&gt;
    &lt;p class=&quot;stats__figure&quot;&gt;170&lt;sub&gt;%&lt;/sub&gt;&lt;/p&gt;
    &lt;p&gt;More pages per session&lt;/p&gt;
  &lt;/div&gt;
&lt;/ul&gt;
&lt;p&gt;Based on this data, Terra could confirm the benefits for the users from implementing a dark theme, and has decided to continue maintaining it as a core feature of the site.&lt;/p&gt;
&lt;h2 id=&quot;conclusion&quot;&gt;Conclusion &lt;a class=&quot;headline-link&quot; href=&quot;https://web.dev/terra-dark-mode/#conclusion&quot;&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Dark Mode is a preference that users can turn on in their devices  to change the style of the screens into dark themes. This technique has reported benefits from the user experience and for different aspects of the user&#39;s devices such as saving  battery life.&lt;/p&gt;
&lt;p&gt;In this article we saw how providing a custom dark theme improved engagement metrics for the group of Terra&#39;s users that have the preferred dark mode setting turned on in their devices.&lt;/p&gt;
&lt;p&gt;For companies with the resources to implement an alternative dark theme this is the recommended approach. For those that don&#39;t have the time to invest in such a feature, Chrome is starting to roll out an &lt;a href=&quot;https://developer.chrome.com/blog/auto-dark-theme/&quot; rel=&quot;noopener&quot;&gt;Auto Dark Mode feature&lt;/a&gt;.&lt;/p&gt;
</content>
    <author>
      <name>Demian Renzulli</name>
    </author><author>
      <name>André Cipriani Bandarra</name>
    </author><author>
      <name>Guilherme Moser de Souza</name>
    </author>
  </entry>
</feed>
