]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man/custom-html: support dark mode
authorDaniel Foster <daniel@amesite.me>
Sun, 25 Jan 2026 05:14:11 +0000 (15:14 +1000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 27 Feb 2026 20:05:57 +0000 (20:05 +0000)
Use the browser's default style and opt in for dark mode.

Has the bonus of removing some
[deprecated attributes](https://developer.mozilla.org/docs/Web/HTML/Reference/Elements/body#deprecated_attributes).

(cherry picked from commit 49811c6715ecd10e133c90ca53685a7ceea37797)
(cherry picked from commit 2f6e779fda7c25fd73daa0c9f4815675622f84b7)
(cherry picked from commit 319febaace646683efa47d8763956c6d6babf5e4)

man/custom-html.xsl

index 45cd1f922d639787bde2d169226e2456ac9d259d..39f490e5f839046ba6dff56fe54850a1e16412ff 100644 (file)
 <!-- add Index link at top of page -->
 <xsl:template name="user.header.content">
   <style>
+    :root {
+      color-scheme: light dark;
+    }
+
     a.headerlink {
       color: #c60f0f;
       font-size: 0.8em;
   <xsl:text>"</xsl:text>
 </xsl:template>
 
+<!-- copied from docbook to remove the static color declarations -->
+<xsl:template name="body.attributes">
+  <xsl:if test="starts-with($writing.mode, 'rl')">
+    <xsl:attribute name="dir">rtl</xsl:attribute>
+  </xsl:if>
+</xsl:template>
+
 <!-- Switch things to UTF-8, ISO-8859-1 is soo yesteryear -->
 <xsl:output method="html" encoding="UTF-8" indent="no"/>