man/custom-html: support dark mode

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).
This commit is contained in:
Daniel Foster
2026-01-27 13:43:33 +01:00
committed by Zbigniew Jędrzejewski-Szmek
parent bee663e22a
commit 49811c6715
+11
View File
@@ -268,6 +268,10 @@
<!-- 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;
@@ -312,6 +316,13 @@
<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"/>