<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Css on Liftoff</title><link>https://hugo-liftoff.kevinhorst.de/en/tags/css/</link><description>Recent content in Css on Liftoff</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 15 May 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://hugo-liftoff.kevinhorst.de/en/tags/css/index.xml" rel="self" type="application/rss+xml"/><item><title>A performance budget you can actually keep</title><link>https://hugo-liftoff.kevinhorst.de/en/articles/a-performance-budget/</link><pubDate>Fri, 15 May 2026 00:00:00 +0000</pubDate><guid>https://hugo-liftoff.kevinhorst.de/en/articles/a-performance-budget/</guid><description>&lt;p&gt;A performance budget only works if it is short enough to remember.
Three numbers are enough for a content site.&lt;/p&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Budget&lt;/th&gt;
					&lt;th&gt;Target&lt;/th&gt;
					&lt;th&gt;What breaks it&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;Requests per page&lt;/td&gt;
					&lt;td&gt;Under 10&lt;/td&gt;
					&lt;td&gt;Web fonts, analytics&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;CSS&lt;/td&gt;
					&lt;td&gt;Under 30 kB&lt;/td&gt;
					&lt;td&gt;Utility frameworks&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;JavaScript&lt;/td&gt;
					&lt;td&gt;Under 10 kB&lt;/td&gt;
					&lt;td&gt;Anything with a build&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Liftoff spends its JavaScript on three things: the theme toggle, the
copy buttons on code blocks, and the blueprint filter. All three
degrade to something usable when scripting is off, which is the only
reason they are allowed to exist at all.&lt;/p&gt;</description></item><item><title>Dark mode that respects the system</title><link>https://hugo-liftoff.kevinhorst.de/en/articles/dark-mode-defaults/</link><pubDate>Fri, 08 May 2026 00:00:00 +0000</pubDate><guid>https://hugo-liftoff.kevinhorst.de/en/articles/dark-mode-defaults/</guid><description>&lt;p&gt;A theme toggle that defaults to dark for everyone is a preference
disguised as a feature. Liftoff reads &lt;code&gt;prefers-color-scheme&lt;/code&gt; first, and
only writes to &lt;code&gt;localStorage&lt;/code&gt; once someone actually picks a scheme.&lt;/p&gt;
&lt;div class="codeblock"&gt;
 &lt;div class="codeblock__head"&gt;
 &lt;span class="codeblock__lang"&gt;js&lt;/span&gt;
 &lt;button type="button" class="codeblock__copy" data-action="copy-code" aria-label="Copy"&gt;Copy&lt;/button&gt;
 &lt;/div&gt;
 &lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-js" data-lang="js"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;stored&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;liftoff.theme&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;system&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;matchMedia&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;(prefers-color-scheme: light)&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;That ordering matters. A visitor whose system is light gets a light
page on first load, without a flash of dark. A visitor who then picks
dark keeps dark, even if their system changes later, because an
explicit choice outranks an inferred one.&lt;/p&gt;</description></item><item><title>On design tokens</title><link>https://hugo-liftoff.kevinhorst.de/en/articles/design-tokens/</link><pubDate>Sat, 02 May 2026 00:00:00 +0000</pubDate><guid>https://hugo-liftoff.kevinhorst.de/en/articles/design-tokens/</guid><description>&lt;p&gt;Liftoff exposes its palette, spacing scale, and typography as CSS
custom properties on &lt;code&gt;:root&lt;/code&gt;. Consumers can theme the site without
forking the theme.&lt;/p&gt;
&lt;h2 id="override-pattern"&gt;Override pattern&lt;/h2&gt;
&lt;p&gt;Drop a small CSS file into your site&amp;rsquo;s &lt;code&gt;assets/css/&lt;/code&gt; and import it
after the theme&amp;rsquo;s bundle.&lt;/p&gt;
&lt;div class="codeblock"&gt;
 &lt;div class="codeblock__head"&gt;
 &lt;span class="codeblock__lang"&gt;css&lt;/span&gt;
 &lt;button type="button" class="codeblock__copy" data-action="copy-code" aria-label="Copy"&gt;Copy&lt;/button&gt;
 &lt;/div&gt;
 &lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-css" data-lang="css"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="nd"&gt;root&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;--color-accent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#ff7a59&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nv"&gt;--color-bg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#0d0a0a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Light mode is opt-in by setting &lt;code&gt;data-theme=&amp;quot;light&amp;quot;&lt;/code&gt; on &lt;code&gt;&amp;lt;html&amp;gt;&lt;/code&gt;. The
built-in toggle remembers the user&amp;rsquo;s choice in &lt;code&gt;localStorage&lt;/code&gt; with
&lt;code&gt;prefers-color-scheme&lt;/code&gt; as the fallback.&lt;/p&gt;</description></item></channel></rss>