<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="https://sandfox.me/assets/xml/atom.xsl" type="text/xsl media="all"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom">
  <title>Sand Fox (Posts about dark theme)</title>
  <id>https://sandfox.me/tags/dark-theme.xml</id>
  <updated>2026-01-05T10:06:08Z</updated>
  <author>
    <name>Anton Smirnov</name>
  </author>
  <link rel="self" type="application/atom+xml" href="https://sandfox.me/tags/dark-theme.xml"/>
  <link rel="alternate" type="text/html" href="https://sandfox.me/tags/dark-theme.html"/>
  <generator uri="https://getnikola.com/">Nikola</generator>
  <entry>
    <title>Dark Theme for the Blog</title>
    <id>https://sandfox.me/misc/dark-theme.html</id>
    <updated>2019-10-26T15:40:00+03:00</updated>
    <published>2019-10-26T15:40:00+03:00</published>
    <author>
      <name>Anton Smirnov</name>
    </author>
    <link rel="alternate" type="text/html" href="https://sandfox.me/misc/dark-theme.html"/>
    <summary type="html">&lt;figure&gt;&lt;img src="https://sandfox.me/images/misc/dark-theme/dark.png"&gt;&lt;/figure&gt; &lt;div&gt;&lt;p&gt;Just finalized the dark theme for the blog.
The idea is simple, use &lt;code class="docutils literal"&gt;&lt;span class="pre"&gt;prefers-color-scheme&lt;/span&gt;&lt;/code&gt; media query and wrap dark style elements with it:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code css"&gt;&lt;a id="rest_code_56e17ad5a6eb4f55a61ed1315f222004-1" name="rest_code_56e17ad5a6eb4f55a61ed1315f222004-1" href="https://sandfox.me/misc/dark-theme.html#rest_code_56e17ad5a6eb4f55a61ed1315f222004-1"&gt;&lt;/a&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="k"&gt;media&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;prefers-color-scheme&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;dark&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_56e17ad5a6eb4f55a61ed1315f222004-2" name="rest_code_56e17ad5a6eb4f55a61ed1315f222004-2" href="https://sandfox.me/misc/dark-theme.html#rest_code_56e17ad5a6eb4f55a61ed1315f222004-2"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
&lt;a id="rest_code_56e17ad5a6eb4f55a61ed1315f222004-3" name="rest_code_56e17ad5a6eb4f55a61ed1315f222004-3" href="https://sandfox.me/misc/dark-theme.html#rest_code_56e17ad5a6eb4f55a61ed1315f222004-3"&gt;&lt;/a&gt;&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="k"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mh"&gt;#4be&lt;/span&gt;
&lt;a id="rest_code_56e17ad5a6eb4f55a61ed1315f222004-4" name="rest_code_56e17ad5a6eb4f55a61ed1315f222004-4" href="https://sandfox.me/misc/dark-theme.html#rest_code_56e17ad5a6eb4f55a61ed1315f222004-4"&gt;&lt;/a&gt;&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;a id="rest_code_56e17ad5a6eb4f55a61ed1315f222004-5" name="rest_code_56e17ad5a6eb4f55a61ed1315f222004-5" href="https://sandfox.me/misc/dark-theme.html#rest_code_56e17ad5a6eb4f55a61ed1315f222004-5"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/misc/dark-theme.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
    <category term="blog" label="blog"/>
    <category term="css" label="css"/>
    <category term="dark-theme" label="dark theme"/>
    <category term="night-mode" label="night mode"/>
    <category term="prefers-color-scheme" label="prefers-color-scheme"/>
  </entry>
</feed>
