[yelp-xsl] [theme-html.xsl] Starting to factor out common DocBook/Mallard CSS for HTML



commit 68ce43cee037b211a26f98e3a7d35b25e55175b0
Author: Shaun McCance <shaunm gnome org>
Date:   Sun Feb 28 18:31:13 2010 -0600

    [theme-html.xsl] Starting to factor out common DocBook/Mallard CSS for HTML

 test/testdocs/Makefile                      |   27 ++-
 test/testdocs/db2html.xsl                   |   10 +-
 xslt/docbook/html/db2html-bibliography.xsl  |    6 -
 xslt/docbook/html/db2html-block.xsl         |  162 +++++----------
 xslt/docbook/html/db2html-classsynopsis.xsl |    8 -
 xslt/docbook/html/db2html-cmdsynopsis.xsl   |    5 -
 xslt/docbook/html/db2html-css.xsl           |  148 +------------
 xslt/docbook/html/db2html-division.xsl      |   86 ++++----
 xslt/docbook/html/db2html-info.xsl          |   28 ++--
 xslt/docbook/html/db2html-list.xsl          |   80 +++-----
 xslt/docbook/html/db2html-title.xsl         |    2 +-
 xslt/docbook/html/db2html.xsl               |    1 +
 xslt/docbook/html/db2xhtml.xsl              |    1 +
 xslt/mallard/html/mal2html-block.xsl        |  198 +++++------------
 xslt/mallard/html/mal2html-css.xsl          |  196 ++---------------
 xslt/mallard/html/mal2html-list.xsl         |  114 +++--------
 xslt/mallard/html/mal2html-page.xsl         |   28 +--
 xslt/mallard/html/mal2html.xsl              |    2 +-
 xslt/mallard/html/mal2xhtml.xsl             |    2 +-
 xslt/theme/Makefile.am                      |    1 +
 xslt/theme/theme-html.xsl                   |  310 +++++++++++++++++++++++++++
 21 files changed, 600 insertions(+), 815 deletions(-)
---
diff --git a/test/testdocs/Makefile b/test/testdocs/Makefile
index c1e2a08..9eee46f 100644
--- a/test/testdocs/Makefile
+++ b/test/testdocs/Makefile
@@ -4,17 +4,36 @@ tests = $(filter-out template.xml,$(wildcard *.xml))
 htmls = $(patsubst %.xml,html/%,$(tests))
 
 htmlargs =							\
-	-o $@/$(patsubst html/%,%.html,$1)			\
 	--stringparam db.chunk.max_depth 0 			\
+	--stringparam theme.icons.base_url			\
+	../../../../icons/hicolor/48x48/status/			\
+	--stringparam theme.icons.watermark.code		\
+	../../../../icons/hicolor/watermarks/watermark-code.png	\
 	--param db.chunk.chunk_top 'false()'			\
-	--stringparam db.chunk.basename $(patsubst html/%,%,$1)	\
 	$(db2html)
 
-test: $(htmls)
+test: $(htmls) html/index.html
 
 $(htmls) : html/% : %.xml
 	@mkdir -p $@
-	xsltproc $(call htmlargs,$@) $<
+	xsltproc \
+	 -o $@/$(patsubst html/%,%.html,$@) \
+	 --param annotate 'false()' \
+	 --stringparam db.chunk.basename $(patsubst html/%,%,$@) \
+	 $(call htmlargs,$@) $<
+	xsltproc \
+	 -o $@/$(patsubst html/%,%-a.html,$@) \
+	 --param annotate 'true()' \
+	 --stringparam db.chunk.basename $(patsubst html/%,%-a,$@) \
+	 $(call htmlargs,$@) $<
+
+html/index.html:
+	(echo '<html><body><ul>' &&					\
+	 for html in $(htmls); do					\
+	  base=`basename $$html`;					\
+	  echo "<li><a href='$$base/$${base}.html'>$$base</a>";		\
+	  echo "(<a href='$$base/$${base}-a.html'>annotated</a>)</li>";	\
+	 done && echo '</ul></body></html>') > $@
 
 clean:
 	rm -rf html/*
diff --git a/test/testdocs/db2html.xsl b/test/testdocs/db2html.xsl
index a83a72d..53bfe21 100644
--- a/test/testdocs/db2html.xsl
+++ b/test/testdocs/db2html.xsl
@@ -5,10 +5,14 @@
 
 <xsl:import href="../../xslt/docbook/html/db2html.xsl"/>
 
+<xsl:param name="annotate" select="true()"/>
+
 <xsl:template match="/*/*[preceding-sibling::*][name(.) != 'title']">
-  <pre style="margin: 16px; padding: 0.8em; background-color: #9EB6D1; -moz-border-radius: 8px;">
-    <xsl:apply-templates mode="source.mode" select="."/>
-  </pre>
+  <xsl:if test="$annotate">
+    <pre style="margin: 16px; padding: 0.8em; background-color: #9EB6D1; -moz-border-radius: 8px;">
+      <xsl:apply-templates mode="source.mode" select="."/>
+    </pre>
+  </xsl:if>
   <xsl:apply-imports/>
 </xsl:template>
 
diff --git a/xslt/docbook/html/db2html-bibliography.xsl b/xslt/docbook/html/db2html-bibliography.xsl
index c008db6..4562640 100644
--- a/xslt/docbook/html/db2html-bibliography.xsl
+++ b/xslt/docbook/html/db2html-bibliography.xsl
@@ -603,9 +603,6 @@ a bibliography entry.
   <div>
     <xsl:attribute name="class">
       <xsl:text>bibliomixed block</xsl:text>
-      <xsl:if test="not(preceding-sibling::biblioentry | preceding-sibling::bibliomixed)">
-        <xsl:text> block-first</xsl:text>
-      </xsl:if>
     </xsl:attribute>
     <xsl:call-template name="db2html.anchor"/>
     <xsl:call-template name="db2html.biblioentry.label"/>
@@ -620,9 +617,6 @@ a bibliography entry.
   <div>
     <xsl:attribute name="class">
       <xsl:text>bibliomixed block</xsl:text>
-      <xsl:if test="not(preceding-sibling::biblioentry | preceding-sibling::bibliomixed)">
-        <xsl:text> block-first</xsl:text>
-      </xsl:if>
     </xsl:attribute>
     <xsl:call-template name="db2html.anchor"/>
     <xsl:call-template name="db2html.biblioentry.label"/>
diff --git a/xslt/docbook/html/db2html-block.xsl b/xslt/docbook/html/db2html-block.xsl
index c8ad957..d374508 100644
--- a/xslt/docbook/html/db2html-block.xsl
+++ b/xslt/docbook/html/db2html-block.xsl
@@ -38,7 +38,6 @@ db2html.block
 Renders a block-level element to an HTML #{div} tag
 $node: The block-level element to render
 $class: An extra string to insert in the #{class} attribute
-$first: Whether this is the first child block in the parent
 $indent: Whether this block should be indented
 $verbatim: Whether to maintain whitespace as written
 $formal: Whether this is a formal block element
@@ -55,11 +54,6 @@ is then used by the CSS for styling.
 <xsl:template name="db2html.block">
   <xsl:param name="node" select="."/>
   <xsl:param name="class" select="''"/>
-  <xsl:param name="first"
-             select="not($node/preceding-sibling::*
-                     [not(self::blockinfo) and not(self::title) and
-                      not(self::titleabbrev) and not(self::attribution) ])"/>
-  <xsl:param name="indent" select="false()"/>
   <xsl:param name="verbatim" select="false()"/>
   <xsl:param name="formal" select="false()"/>
   <xsl:param name="title" select="$node/title"/>
@@ -69,6 +63,12 @@ is then used by the CSS for styling.
   <xsl:param name="ltr" select="false()"/>
 
   <div>
+    <xsl:attribute name="class">
+      <xsl:value-of select="concat($class, ' ', local-name($node))"/>
+      <xsl:if test="$verbatim">
+        <xsl:text> block-verbatim</xsl:text>
+      </xsl:if>
+    </xsl:attribute>
     <xsl:choose>
       <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
         <xsl:attribute name="dir">
@@ -88,33 +88,23 @@ is then used by the CSS for styling.
         </xsl:attribute>
       </xsl:when>
     </xsl:choose>
-    <xsl:attribute name="class">
-      <xsl:value-of select="concat($class, ' block ', local-name($node))"/>
-      <xsl:if test="$first">
-        <xsl:text> block-first</xsl:text>
-      </xsl:if>
-      <xsl:if test="$indent">
-        <xsl:text> block-indent</xsl:text>
-      </xsl:if>
-      <xsl:if test="$verbatim">
-        <xsl:text> block-verbatim</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
     <xsl:call-template name="db2html.anchor">
       <xsl:with-param name="node" select="$node"/>
     </xsl:call-template>
     <xsl:choose>
       <xsl:when test="$formal">
-        <xsl:if test="$title">
-          <xsl:call-template name="db2html.block.title">
-            <xsl:with-param name="node" select="$node"/>
-            <xsl:with-param name="title" select="$title"/>
-          </xsl:call-template>
-        </xsl:if>
-        <div class="{local-name($node)}-inner">
-          <xsl:apply-templates select="$node/node()[not(set:has-same-node(., $title | $caption))]"/>
+        <div class="inner">
+          <xsl:if test="$title">
+            <xsl:call-template name="db2html.block.title">
+              <xsl:with-param name="node" select="$node"/>
+              <xsl:with-param name="title" select="$title"/>
+            </xsl:call-template>
+          </xsl:if>
+          <div class="contents">
+            <xsl:apply-templates select="$node/node()[not(set:has-same-node(., $title | $caption))]"/>
+          </div>
+          <xsl:apply-templates select="$caption"/>
         </div>
-        <xsl:apply-templates select="$caption"/>
       </xsl:when>
       <xsl:otherwise>
         <xsl:apply-templates select="$node/node()"/>
@@ -143,7 +133,7 @@ element.  It is called by *{db2html.block} for formal block elements.
   <xsl:param name="dir" select="false()"/>
   <xsl:param name="ltr" select="false()"/>
 
-  <div class="block block-first title title-formal">
+  <div class="block title title-formal">
     <xsl:choose>
       <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
         <xsl:attribute name="dir">
@@ -183,7 +173,6 @@ element.  It is called by *{db2html.block} for formal block elements.
 db2html.blockquote
 Renders a #{blockquote} element to HTML
 $node: The #{blockquote} element to render
-$first: Whether this is the first child block in the parent
 $lang: The locale of the text in ${node}
 $dir: The text direction, either #{ltr} or #{rtl}
 $ltr: Whether to default to #{ltr} if neither ${lang} nor ${dir} is specified
@@ -193,10 +182,6 @@ element.
 -->
 <xsl:template name="db2html.blockquote">
   <xsl:param name="node" select="."/>
-  <xsl:param name="first"
-             select="not($node/preceding-sibling::*
-                     [not(self::blockinfo) and not(self::title) and
-                      not(self::titleabbrev) and not(self::attribution) ])"/>
   <xsl:param name="lang" select="$node/@lang"/>
   <xsl:param name="dir" select="false()"/>
   <xsl:param name="ltr" select="false()"/>
@@ -222,20 +207,19 @@ element.
       </xsl:when>
     </xsl:choose>
     <xsl:attribute name="class">
+      <xsl:text>quote </xsl:text>
       <xsl:value-of select="local-name($node)"/>
-      <xsl:text> block block-indent</xsl:text>
-      <xsl:if test="$first">
-        <xsl:text> block-first</xsl:text>
-      </xsl:if>
     </xsl:attribute>
     <xsl:call-template name="db2html.anchor">
       <xsl:with-param name="node" select="$node"/>
     </xsl:call-template>
-    <xsl:apply-templates select="$node/title"/>
-    <blockquote class="{local-name($node)}">
-      <xsl:apply-templates select="$node/node()[not(self::title) and not(self::attribution)]"/>
-    </blockquote>
-    <xsl:apply-templates select="$node/attribution"/>
+    <div class="inner">
+      <xsl:apply-templates select="$node/title"/>
+      <blockquote class="{local-name($node)}">
+        <xsl:apply-templates select="$node/node()[not(self::title) and not(self::attribution)]"/>
+      </blockquote>
+      <xsl:apply-templates select="$node/attribution"/>
+    </div>
   </div>
 </xsl:template>
 
@@ -244,7 +228,6 @@ element.
 db2html.para
 Renders a block-level element as an HTML #{p} element
 $node: The block-level element to render
-$first: Whether this is the first child block in the parent
 $lang: The locale of the text in ${node}
 $dir: The text direction, either #{ltr} or #{rtl}
 $ltr: Whether to default to #{ltr} if neither ${lang} nor ${dir} is specified
@@ -253,15 +236,14 @@ This template creates an HTML #{p} element for the given DocBook element.
 -->
 <xsl:template name="db2html.para">
   <xsl:param name="node" select="."/>
-  <xsl:param name="first"
-             select="not($node/preceding-sibling::*
-                     [not(self::blockinfo) and not(self::title) and
-                      not(self::titleabbrev) and not(self::attribution) ])"/>
   <xsl:param name="lang" select="$node/@lang"/>
   <xsl:param name="dir" select="false()"/>
   <xsl:param name="ltr" select="false()"/>
 
   <p>
+    <xsl:attribute name="class">
+      <xsl:value-of select="local-name($node)"/>
+    </xsl:attribute>
     <xsl:choose>
       <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
         <xsl:attribute name="dir">
@@ -281,13 +263,6 @@ This template creates an HTML #{p} element for the given DocBook element.
         </xsl:attribute>
       </xsl:when>
     </xsl:choose>
-    <xsl:attribute name="class">
-      <xsl:value-of select="local-name($node)"/>
-      <xsl:text> block</xsl:text>
-      <xsl:if test="$first">
-        <xsl:text> block-first</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
     <xsl:call-template name="db2html.anchor">
       <xsl:with-param name="node" select="$node"/>
     </xsl:call-template>
@@ -301,8 +276,6 @@ db2html.pre
 Renders a block-level element as an HTML #{pre} element
 $node: The block-level element to render
 $class: An extra string to insert in the #{class} attribute
-$first: Whether this is the first child block in the parent
-$indent: Whether this block should be indented
 $children: The child elements to process
 $lang: The locale of the text in ${node}
 $dir: The text direction, either #{ltr} or #{rtl}
@@ -319,17 +292,15 @@ template.
 <xsl:template name="db2html.pre">
   <xsl:param name="node" select="."/>
   <xsl:param name="class" select="''"/>
-  <xsl:param name="first"
-             select="not($node/preceding-sibling::*
-                     [not(self::blockinfo) and not(self::title) and
-                      not(self::titleabbrev) and not(self::attribution) ])"/>
-  <xsl:param name="indent" select="false()"/>
   <xsl:param name="children" select="$node/node()"/>
   <xsl:param name="lang" select="$node/@lang"/>
   <xsl:param name="dir" select="false()"/>
   <xsl:param name="ltr" select="true()"/>
 
   <div>
+    <xsl:attribute name="class">
+      <xsl:value-of select="concat($class, ' ', local-name($node))"/>
+    </xsl:attribute>
     <xsl:choose>
       <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
         <xsl:attribute name="dir">
@@ -349,15 +320,6 @@ template.
         </xsl:attribute>
       </xsl:when>
     </xsl:choose>
-    <xsl:attribute name="class">
-      <xsl:value-of select="concat($class, ' block ', local-name($node))"/>
-      <xsl:if test="$indent">
-        <xsl:text> block-indent</xsl:text>
-      </xsl:if>
-      <xsl:if test="$first">
-        <xsl:text> block-first</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
     <xsl:call-template name="db2html.anchor">
       <xsl:with-param name="node" select="$node"/>
     </xsl:call-template>
@@ -380,7 +342,7 @@ template.
         <xsl:with-param name="number" select="$number"/>
       </xsl:call-template></pre>
     </xsl:if>
-    <pre class="{local-name($node)}">
+    <pre class="contents">
       <!-- Strip off a leading newline -->
       <xsl:if test="$children[1]/self::text()">
         <xsl:choose>
@@ -420,7 +382,7 @@ template.
 <!-- = attribution = -->
 <xsl:template match="attribution">
   <xsl:call-template name="db2html.block">
-    <xsl:with-param name="first" select="false()"/>
+    <xsl:with-param name="class" select="'cite'"/>
   </xsl:call-template>
 </xsl:template>
 
@@ -431,16 +393,16 @@ template.
 
 <!-- = caption = -->
 <xsl:template match="caption">
-  <xsl:call-template name="db2html.block"/>
+  <xsl:call-template name="db2html.block">
+    <xsl:with-param name="class" select="'desc'"/>
+  </xsl:call-template>
 </xsl:template>
 
 <!-- = caution = -->
 <xsl:template match="caution">
   <xsl:call-template name="db2html.block">
-    <xsl:with-param name="class" select="'admonition'"/>
+    <xsl:with-param name="class" select="'note note-warning'"/>
     <xsl:with-param name="formal" select="true()"/>
-    <xsl:with-param name="title" select="/false"/>
-    <xsl:with-param name="indent" select="true()"/>
   </xsl:call-template>
 </xsl:template>
 
@@ -457,15 +419,18 @@ template.
 <!-- = example = -->
 <xsl:template match="example">
   <xsl:call-template name="db2html.block">
-    <xsl:with-param name="indent" select="true()"/>
     <xsl:with-param name="formal" select="true()"/>
   </xsl:call-template>
 </xsl:template>
 
 <!-- = figure = -->
-<xsl:template match="figure">
+<xsl:template match="figure | informalfigure">
   <xsl:call-template name="db2html.block">
-    <xsl:with-param name="indent" select="true()"/>
+    <xsl:with-param name="class">
+      <xsl:if test="self::informalfigure">
+        <xsl:text>figure</xsl:text>
+      </xsl:if>
+    </xsl:with-param>
     <xsl:with-param name="formal" select="true()"/>
     <!-- When a figure contains only a single mediaobject, it eats the caption -->
     <xsl:with-param name="caption"
@@ -492,9 +457,6 @@ template.
   <dt>
     <xsl:attribute name="class">
       <xsl:text>glossterm</xsl:text>
-      <xsl:if test="not(preceding-sibling::glossentry)">
-        <xsl:text> dt-first</xsl:text>
-      </xsl:if>
     </xsl:attribute>
     <xsl:apply-templates select="glossterm"/>
     <xsl:if test="acronym or abbrev">
@@ -512,7 +474,7 @@ template.
 <!-- = glosssee(also) = -->
 <xsl:template match="glosssee | glossseealso">
   <dd class="{local-name(.)}">
-    <p class="block block-first">
+    <p class="block">
       <xsl:call-template name="l10n.gettext">
         <xsl:with-param name="msgid" select="concat(local-name(.), '.format')"/>
         <xsl:with-param name="node" select="."/>
@@ -573,10 +535,8 @@ template.
 <!-- = important = -->
 <xsl:template match="important">
   <xsl:call-template name="db2html.block">
-    <xsl:with-param name="class" select="'admonition'"/>
+    <xsl:with-param name="class" select="'note note-important'"/>
     <xsl:with-param name="formal" select="true()"/>
-    <xsl:with-param name="title" select="/false"/>
-    <xsl:with-param name="indent" select="true()"/>
   </xsl:call-template>
 </xsl:template>
 
@@ -590,18 +550,6 @@ template.
   <xsl:call-template name="db2html.block"/>
 </xsl:template>
 
-<!-- = informalfigure = -->
-<xsl:template match="informalfigure">
-  <xsl:call-template name="db2html.block">
-    <xsl:with-param name="indent" select="true()"/>
-    <xsl:with-param name="formal" select="true()"/>
-    <!-- When a figure contains only a single mediaobject, it eats the caption -->
-    <xsl:with-param name="caption"
-                    select="*[not(self::blockinfo) and not(self::title) and not(self::titleabbrev)]
-                             [last() = 1]/self::mediaobject/caption"/>
-  </xsl:call-template>
-</xsl:template>
-
 <!-- = literallayout = -->
 <xsl:template match="literallayout">
   <xsl:call-template name="db2html.block">
@@ -613,14 +561,12 @@ template.
 <xsl:template match="note">
   <xsl:call-template name="db2html.block">
     <xsl:with-param name="class">
-      <xsl:text>admonition</xsl:text>
+      <xsl:text>note</xsl:text>
       <xsl:if test="@role = 'bug'">
         <xsl:text> note-bug</xsl:text>
       </xsl:if>
     </xsl:with-param>
     <xsl:with-param name="formal" select="true()"/>
-    <xsl:with-param name="title" select="/false"/>
-    <xsl:with-param name="indent" select="true()"/>
   </xsl:call-template>
 </xsl:template>
 
@@ -632,15 +578,13 @@ template.
 <!-- = programlisting = -->
 <xsl:template match="programlisting">
   <xsl:call-template name="db2html.pre">
-    <xsl:with-param name="indent" select="true()"/>
+    <xsl:with-param name="class" select="'code'"/>
   </xsl:call-template>
 </xsl:template>
 
 <!-- = screen = -->
 <xsl:template match="screen">
-  <xsl:call-template name="db2html.pre">
-    <xsl:with-param name="indent" select="true()"/>
-  </xsl:call-template>
+  <xsl:call-template name="db2html.pre"/>
 </xsl:template>
 
 <!-- = simpara = -->
@@ -656,10 +600,8 @@ template.
 <!-- = tip = -->
 <xsl:template match="tip">
   <xsl:call-template name="db2html.block">
-    <xsl:with-param name="class" select="'admonition'"/>
+    <xsl:with-param name="class" select="'note note-tip'"/>
     <xsl:with-param name="formal" select="true()"/>
-    <xsl:with-param name="title" select="/false"/>
-    <xsl:with-param name="indent" select="true()"/>
   </xsl:call-template>
 </xsl:template>
 
@@ -674,10 +616,8 @@ template.
 <!-- = warning = -->
 <xsl:template match="warning">
   <xsl:call-template name="db2html.block">
-    <xsl:with-param name="class" select="'admonition'"/>
+    <xsl:with-param name="class" select="'note note-warning'"/>
     <xsl:with-param name="formal" select="true()"/>
-    <xsl:with-param name="title" select="/false"/>
-    <xsl:with-param name="indent" select="true()"/>
   </xsl:call-template>
 </xsl:template>
 
diff --git a/xslt/docbook/html/db2html-classsynopsis.xsl b/xslt/docbook/html/db2html-classsynopsis.xsl
index 8247a58..de2b317 100644
--- a/xslt/docbook/html/db2html-classsynopsis.xsl
+++ b/xslt/docbook/html/db2html-classsynopsis.xsl
@@ -68,11 +68,6 @@ REMARK: Describe this param
       </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
-  <xsl:variable name="first"
-                select="not(preceding-sibling::*
-                        [not(self::blockinfo) and not(self::title) and
-                         not(self::titleabbrev) and not(self::attribution) ])"/>
-
   <div>
     <xsl:choose>
       <xsl:when test="@lang">
@@ -91,9 +86,6 @@ REMARK: Describe this param
     <xsl:attribute name="class">
       <xsl:text>block synopsis </xsl:text>
       <xsl:value-of select="local-name(.)"/>
-      <xsl:if test="$first">
-        <xsl:text> block-first</xsl:text>
-      </xsl:if>
       <xsl:value-of select="concat(' watermark-code-', $language)"/>
     </xsl:attribute>
     <xsl:call-template name="db2html.anchor"/>
diff --git a/xslt/docbook/html/db2html-cmdsynopsis.xsl b/xslt/docbook/html/db2html-cmdsynopsis.xsl
index c8d2efb..7e75279 100644
--- a/xslt/docbook/html/db2html-cmdsynopsis.xsl
+++ b/xslt/docbook/html/db2html-cmdsynopsis.xsl
@@ -176,11 +176,6 @@ REMARK: Describe this param
     </xsl:choose>
     <xsl:attribute name="class">
       <xsl:text>synopsis cmdsynopsis block</xsl:text>
-      <xsl:if test="not(preceding-sibling::*
-                    [not(self::blockinfo) and not(self::title) and
-                     not(self::titleabbrev) and not(self::attribution) ])">
-        <xsl:text> block-first</xsl:text>
-      </xsl:if>
     </xsl:attribute>
     <xsl:call-template name="db2html.anchor"/>
     <pre class="cmdsynopsis">
diff --git a/xslt/docbook/html/db2html-css.xsl b/xslt/docbook/html/db2html-css.xsl
index f7874cc..0f3176d 100644
--- a/xslt/docbook/html/db2html-css.xsl
+++ b/xslt/docbook/html/db2html-css.xsl
@@ -23,7 +23,7 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
 <!--!!==========================================================================
 DocBook to HTML - CSS
-:Requires: db2html-footnote db2html-callout db2html-qanda gettext theme-colors theme-icons
+:Requires: db2html-footnote db2html-callout db2html-qanda gettext theme-colors theme-icons theme-html
 
 REMARK: Describe this module
 -->
@@ -95,17 +95,9 @@ by extension stylesheets to extend or override the CSS.
       <xsl:with-param name="direction" select="$direction"/>
     </xsl:call-template>
   </xsl:variable>
+  <xsl:call-template name="theme.html.css"/>
   <xsl:text>
 <!-- == common == -->
-html { height: 100%; }
-body {
-  margin: 0px; padding: 12px;
-  background-color: </xsl:text><xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
-  min-height: 100%;
-  direction: </xsl:text><xsl:value-of select="$direction"/><xsl:text>;
-}
-div, p, pre, blockquote { margin: 0; padding: 0; }
-p img { vertical-align: middle; }
 sub { font-size: 0.83em; }
 sub sub { font-size: 1em; }
 sup { font-size: 0.83em; }
@@ -122,32 +114,11 @@ td.td-colsep { border-</xsl:text><xsl:value-of select="$right"/><xsl:text>: soli
 td.td-rowsep { border-bottom: solid 1px; }
 thead { border-top: solid 2px; border-bottom: solid 2px; }
 tfoot { border-top: solid 2px; border-bottom: solid 2px; }
-div.body {
-  padding: 1em;
-  max-width: 60em;
-  background-color: </xsl:text><xsl:value-of select="$theme.color.background"/><xsl:text>;
-  border: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-}
-div.body-sidebar {
-  margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 13em;
-}
-div.division div.division { margin-top: 1.72em; }
-div.division div.division div.division { margin-top: 1.44em; }
-div.header {
-  margin: 0;
-  color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-  border-bottom: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-}
-h1, h2, h3, h4, h5, h6, h7 {
-  margin: 0; padding: 0;
-  color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-}
-h1.title { font-size: 1.72em; }
-h2.title { font-size: 1.44em; }
-h3.title { font-size: 1.2em; }
-h4.title, h5.title, h6.title, h7.title { font-size: 1em; }
+
+/*
 .block { margin-top: 1em; }
 .block .block-first { margin-top: 0; }
+*/
 .block-indent {
   margin-</xsl:text><xsl:value-of select="$left"/><xsl:text> left: 1.72em;
   margin-</xsl:text><xsl:value-of select="right"/><xsl:text>: 1em;
@@ -163,27 +134,6 @@ div.title {
 }
 div.title-formal { padding-left: 0.2em; padding-right: 0.2em; }
 div.title-formal .label { font-weight: normal; }
-a {
-  color: </xsl:text><xsl:value-of select="$theme.color.link"/><xsl:text>;
-  text-decoration: none;
-}
-a:hover { text-decoration: underline; }
-a:visited { color: </xsl:text><xsl:value-of select="$theme.color.link_visited"/><xsl:text>; }
-ul, ol, dl { margin: 0; padding: 0; }
-li {
-  margin-top: 1em;
-  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 2.4em;
-  padding: 0;
-}
-li.li-first { margin-top: 0; }
-dt { margin: 1em 0 0 0; }
-dt.dt-first { margin: 0; }
-dd {
-  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.72em;
-  margin-top: 0.5em;
-}
-dl.dl-compact dt { margin-top: 0; }
-dl.dl-compact dd { margin-top: 0; margin-bottom: 0; }
 
 <!-- == linktrail == -->
 ul.linktrail {
@@ -202,13 +152,13 @@ li.linktrail-first::before, li.linktrail-only::before { content: ''; }
 
 <!-- == navbar == -->
 div.navbar {
+ margin: 1em 0 1em 0;
   padding: 0.5em 1em 0.5em 1em;
-  max-width: 60em;
+  clear: both;
   background-color: </xsl:text><xsl:value-of select="$theme.color.background"/><xsl:text>;
   border: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
 }
-div.navbar-top { margin-bottom: 1em; }
-div.navbar-bottom { margin-top: 1em; clear: both; }
+div.head div.navbar:first-child { margin-top: 0; }
 div.navbar img { border: 0; vertical-align: -0.4em; }
 table.navbar { width: 100%; margin: 0; border: none; }
 table.navbar td { padding: 0; border: none; }
@@ -232,11 +182,6 @@ a.navbar-next::after {
   color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
 }
 
-<!-- == sidebar == -->
-div.sidebar {
-  float: </xsl:text><xsl:value-of select="$right"/><xsl:text>;
-  padding: 0; margin: 0; width: 12em;
-}
 div.sidenav {
   padding: 0.5em 1em 0 1em;
   background-color: </xsl:text><xsl:value-of select="$theme.color.background"/><xsl:text>;
@@ -276,78 +221,12 @@ span.bibliolabel {
 }
 
 <!-- == block == -->
-div.admonition {
-  padding: 0.5em 6px 0.5em 6px;
-  border: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-  background-color: </xsl:text><xsl:value-of select="$theme.color.yellow_background"/><xsl:text>;
-}
-div.caution-inner, div.important-inner, div.note-inner, div.tip-inner, div.warning-inner {
-  padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
-    <xsl:value-of select="$theme.icons.emblem.size + 12"/><xsl:text>px;
-  background-position: </xsl:text><xsl:value-of select="$left"/><xsl:text> top;
-  background-repeat: no-repeat;
-  min-height: </xsl:text><xsl:value-of select="$theme.icons.emblem.size"/><xsl:text>px;
-}
-div.caution-inner { background-image: url("</xsl:text>
-  <xsl:value-of select="$theme.icons.emblem.note.warning"/><xsl:text>"); }
-div.important-inner { background-image: url("</xsl:text>
-  <xsl:value-of select="$theme.icons.emblem.note.important"/><xsl:text>"); }
-div.note-inner { background-image: url("</xsl:text>
-  <xsl:value-of select="$theme.icons.emblem.note"/><xsl:text>"); }
-div.note-bug div.note-inner { background-image: url("</xsl:text>
-  <xsl:value-of select="$theme.icons.emblem.note.bug"/><xsl:text>"); }
-div.tip-inner { background-image: url("</xsl:text>
-  <xsl:value-of select="$theme.icons.emblem.note.tip"/><xsl:text>"); }
-div.warning-inner { background-image: url("</xsl:text>
-  <xsl:value-of select="$theme.icons.emblem.note.warning"/><xsl:text>"); }
-div.blockquote {
-  <!-- FIXME: i18n -->
-  background-image: url('</xsl:text>
-    <xsl:value-of select="$theme.icons.watermark.quote"/><xsl:text>');
-  background-repeat: no-repeat;
-  background-position: top </xsl:text><xsl:value-of select="$left"/><xsl:text>;
-  padding: 0.5em;
-  padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 4em;
-}
-div.attribution {
-  margin-top: 0.5em;
-  color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-}
-div.attribution::before {
-  <!-- FIXME: i18n -->
-  content: '&#x2015; ';
-}
 div.epigraph {
   text-align: </xsl:text><xsl:value-of select="$right"/><xsl:text>;
   margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 20%;
   margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 0;
   color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
 }
-div.figure, div.informalfigure {
-  <!-- FIXME: hack -->
-  display: table;
-  padding: 0.5em;
-  background-color: </xsl:text><xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
-  border: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-}
-div.figure-inner, div.informalfigure-inner {
-  padding: 0.5em;
-  background-color: </xsl:text><xsl:value-of select="$theme.color.background"/><xsl:text>;
-  border: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-}
-div.caption { margin-top: 0.5em; }
-div.programlisting {
-  padding: 0.5em;
-  <!-- FIXME: watermark -->
-  background-color: </xsl:text><xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
-  border: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-}
-div.screen {
-  padding: 0.5em;
-  <!-- FIXME: watermark -->
-  background-color: </xsl:text><xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
-  border: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-}
 div.screen .prompt {
   color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
 }
@@ -359,13 +238,6 @@ div.programlisting .userinput {
   font-weight: bold;
   color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
 }
-pre.linenumbering {
-  color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-  margin: 0;
-  padding-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 1em;
-  float: </xsl:text><xsl:value-of select="$left"/><xsl:text>;
-  text-align: </xsl:text><xsl:value-of select="$right"/><xsl:text>;
-}
 
 
 <!-- == unsorted == -->
@@ -387,10 +259,12 @@ div.simplelist td {
   border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: solid 1px </xsl:text>
     <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
 }
+/*
 div.simplelist td.td-first {
   padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0;
   border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0;
 }
+*/
 div.synopsis {
   padding: 0.5em;
   <!-- FIXME: watermarks -->
@@ -403,7 +277,9 @@ div.synopsis div.synopsis {
   border: none;
 }
 div.synopsis div.block { margin-top: 0.2em; }
+/*
 div.synopsis div.block-first { margin-top: 0; }
+*/
 div.cmdsynopsis { font-family: monospace; }
 
 span.accel { text-decoration: underline; }
diff --git a/xslt/docbook/html/db2html-division.xsl b/xslt/docbook/html/db2html-division.xsl
index 690c2af..3cefc2e 100644
--- a/xslt/docbook/html/db2html-division.xsl
+++ b/xslt/docbook/html/db2html-division.xsl
@@ -195,26 +195,17 @@ REMARK: Put in a word about the chunk flow; talk about what templates get called
         <xsl:with-param name="prev_node" select="$prev_node"/>
         <xsl:with-param name="next_node" select="$next_node"/>
       </xsl:call-template>
-      <xsl:variable name="sidebar">
-        <xsl:call-template name="db2html.division.sidebar">
-          <xsl:with-param name="node" select="$node"/>
-          <xsl:with-param name="info" select="$info"/>
-          <xsl:with-param name="template" select="$template"/>
-          <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
-          <xsl:with-param name="prev_id" select="$prev_id"/>
-          <xsl:with-param name="next_id" select="$next_id"/>
-          <xsl:with-param name="prev_node" select="$prev_node"/>
-          <xsl:with-param name="next_node" select="$next_node"/>
-        </xsl:call-template>
-      </xsl:variable>
-      <xsl:copy-of select="$sidebar"/>
-      <div>
-        <xsl:attribute name="class">
-          <xsl:text>body</xsl:text>
-          <xsl:if test="$sidebar != ''">
-            <xsl:text> body-sidebar</xsl:text>
-          </xsl:if>
-        </xsl:attribute>
+      <xsl:call-template name="db2html.division.sidebar">
+        <xsl:with-param name="node" select="$node"/>
+        <xsl:with-param name="info" select="$info"/>
+        <xsl:with-param name="template" select="$template"/>
+        <xsl:with-param name="depth_of_chunk" select="$depth_of_chunk"/>
+        <xsl:with-param name="prev_id" select="$prev_id"/>
+        <xsl:with-param name="next_id" select="$next_id"/>
+        <xsl:with-param name="prev_node" select="$prev_node"/>
+        <xsl:with-param name="next_node" select="$next_node"/>
+      </xsl:call-template>
+      <div class="body">
         <xsl:choose>
           <xsl:when test="$template = 'info'">
             <xsl:call-template name="db2html.info.div">
@@ -301,7 +292,13 @@ REMARK: Talk about some of the parameters
   <xsl:param name="lang" select="$node/@lang"/>
   <xsl:param name="dir" select="false()"/>
 
-  <div class="division {local-name($node)}">
+  <div>
+    <xsl:attribute name="class">
+      <xsl:value-of select="local-name($node)"/>
+      <xsl:if test="$depth_in_chunk != 0">
+        <xsl:text> sect</xsl:text>
+      </xsl:if>
+    </xsl:attribute>
     <xsl:choose>
       <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
         <xsl:attribute name="dir">
@@ -602,8 +599,7 @@ REMARK: Document this template
   </xsl:param>
   <xsl:param name="prev_node" select="key('idkey', $prev_id)"/>
   <xsl:param name="next_node" select="key('idkey', $next_id)"/>
-  <xsl:param name="position" select="'top'"/>
-  <div class="navbar navbar-{$position}">
+  <div class="navbar">
     <!-- FIXME: rtl -->
     <table class="navbar"><tr>
       <td class="navbar-prev">
@@ -755,16 +751,17 @@ REMARK: Describe this template
   </xsl:param>
   <xsl:param name="prev_node" select="key('idkey', $prev_id)"/>
   <xsl:param name="next_node" select="key('idkey', $next_id)"/>
-  <xsl:if test="$db2html.navbar.top">
-    <xsl:call-template name="db2html.navbar">
-      <xsl:with-param name="node" select="$node"/>
-      <xsl:with-param name="prev_id" select="$prev_id"/>
-      <xsl:with-param name="next_id" select="$next_id"/>
-      <xsl:with-param name="prev_node" select="$prev_node"/>
-      <xsl:with-param name="next_node" select="$next_node"/>
-      <xsl:with-param name="position" select="'top'"/>
-    </xsl:call-template>
-  </xsl:if>
+  <div class="head">
+    <xsl:if test="$db2html.navbar.top">
+      <xsl:call-template name="db2html.navbar">
+        <xsl:with-param name="node" select="$node"/>
+        <xsl:with-param name="prev_id" select="$prev_id"/>
+        <xsl:with-param name="next_id" select="$next_id"/>
+        <xsl:with-param name="prev_node" select="$prev_node"/>
+        <xsl:with-param name="next_node" select="$next_node"/>
+      </xsl:call-template>
+    </xsl:if>
+  </div>
 </xsl:template>
 
 
@@ -819,7 +816,7 @@ REMARK: Describe this template
   <xsl:param name="prev_node" select="key('idkey', $prev_id)"/>
   <xsl:param name="next_node" select="key('idkey', $next_id)"/>
   <xsl:if test="$db2html.sidenav">
-    <div class="sidebar">
+    <div class="side">
       <xsl:call-template name="db2html.sidenav">
         <xsl:with-param name="node" select="$node"/>
         <xsl:with-param name="template" select="$template"/>
@@ -879,16 +876,17 @@ REMARK: Describe this template
   </xsl:param>
   <xsl:param name="prev_node" select="key('idkey', $prev_id)"/>
   <xsl:param name="next_node" select="key('idkey', $next_id)"/>
-  <xsl:if test="$db2html.navbar.bottom">
-    <xsl:call-template name="db2html.navbar">
-      <xsl:with-param name="node" select="$node"/>
-      <xsl:with-param name="prev_id" select="$prev_id"/>
-      <xsl:with-param name="next_id" select="$next_id"/>
-      <xsl:with-param name="prev_node" select="$prev_node"/>
-      <xsl:with-param name="next_node" select="$next_node"/>
-      <xsl:with-param name="position" select="'bottom'"/>
-    </xsl:call-template>
-  </xsl:if>
+  <div class="foot">
+    <xsl:if test="$db2html.navbar.bottom">
+      <xsl:call-template name="db2html.navbar">
+        <xsl:with-param name="node" select="$node"/>
+        <xsl:with-param name="prev_id" select="$prev_id"/>
+        <xsl:with-param name="next_id" select="$next_id"/>
+        <xsl:with-param name="prev_node" select="$prev_node"/>
+        <xsl:with-param name="next_node" select="$next_node"/>
+      </xsl:call-template>
+    </xsl:if>
+  </div>
 </xsl:template>
 
 
diff --git a/xslt/docbook/html/db2html-info.xsl b/xslt/docbook/html/db2html-info.xsl
index 7df74ad..de370b1 100644
--- a/xslt/docbook/html/db2html-info.xsl
+++ b/xslt/docbook/html/db2html-info.xsl
@@ -171,8 +171,8 @@ REMARK: Describe this template
           <xsl:with-param name="number" select="count($authors)"/>
         </xsl:call-template>
       </h2>
-      <div class="block block-first">
-        <dl class="dl-compact">
+      <div class="block">
+        <dl class="compact">
           <xsl:apply-templates mode="db2html.info.mode" select="$authors"/>
         </dl>
       </div>
@@ -202,8 +202,8 @@ REMARK: Describe this template
           <xsl:with-param name="number" select="count($editors)"/>
         </xsl:call-template>
       </h2>
-      <div class="block block-first">
-        <dl class="dl-compact">
+      <div class="block">
+        <dl class="compact">
           <xsl:apply-templates mode="db2html.info.mode" select="$editors"/>
         </dl>
       </div>
@@ -233,8 +233,8 @@ REMARK: Describe this template
           <xsl:with-param name="number" select="count($collabs)"/>
         </xsl:call-template>
       </h2>
-      <div class="block block-first">
-        <dl class="dl-compact">
+      <div class="block">
+        <dl class="compact">
           <xsl:apply-templates mode="db2html.info.mode" select="$collabs"/>
         </dl>
       </div>
@@ -268,8 +268,8 @@ REMARK: Describe this template
           <xsl:with-param name="number" select="count($translators)"/>
         </xsl:call-template>
       </h2>
-      <div class="block block-first">
-        <dl class="dl-compact">
+      <div class="block">
+        <dl class="compact">
           <xsl:apply-templates mode="db2html.info.mode" select="$translators"/>
         </dl>
       </div>
@@ -298,8 +298,8 @@ REMARK: Describe this template
           <xsl:with-param name="number" select="count($publishers)"/>
         </xsl:call-template>
       </h2>
-      <div class="block block-first">
-        <dl class="dl-compact">
+      <div class="block">
+        <dl class="compact">
           <xsl:apply-templates mode="db2html.info.mode" select="$publishers"/>
         </dl>
       </div>
@@ -334,8 +334,8 @@ REMARK: Describe this template
           <xsl:with-param name="number" select="count($othercredits)"/>
         </xsl:call-template>
       </h2>
-      <div class="block block-first">
-        <dl class="dl-compact">
+      <div class="block">
+        <dl class="compact">
           <xsl:apply-templates mode="db2html.info.mode" select="$othercredits"/>
         </dl>
       </div>
@@ -364,8 +364,8 @@ REMARK: Describe this template
           <xsl:with-param name="number" select="count($copyrights)"/>
         </xsl:call-template>
       </h2>
-      <div class="block block-first">
-        <dl class="dl-compact">
+      <div class="block">
+        <dl class="compact">
           <xsl:apply-templates mode="db2html.info.mode" select="$copyrights"/>
         </dl>
       </div>
diff --git a/xslt/docbook/html/db2html-list.xsl b/xslt/docbook/html/db2html-list.xsl
index fdd9eae..85e203a 100644
--- a/xslt/docbook/html/db2html-list.xsl
+++ b/xslt/docbook/html/db2html-list.xsl
@@ -32,7 +32,7 @@ REMARK: Describe this module
 
 <!-- = variablelist = -->
 <xsl:template match="glosslist">
-  <div class="block list glosslist">
+  <div class="list glosslist">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -50,7 +50,7 @@ REMARK: Describe this module
 
 <!-- = itemizedlist = -->
 <xsl:template match="itemizedlist">
-  <div class="block list itemizedlist">
+  <div class="list itemizedlist">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -61,6 +61,12 @@ REMARK: Describe this module
     <xsl:call-template name="db2html.anchor"/>
     <xsl:apply-templates select="*[not(self::listitem)]"/>
     <ul class="itemizedlist">
+      <xsl:attribute name="class">
+        <xsl:text>itemizedlist</xsl:text>
+        <xsl:if test="@spacing = 'compact'">
+          <xsl:text> compact</xsl:text>
+        </xsl:if>
+      </xsl:attribute>
       <xsl:if test="@mark">
         <xsl:attribute name="style">
           <xsl:text>list-style-type: </xsl:text>
@@ -71,11 +77,6 @@ REMARK: Describe this module
           </xsl:choose>
         </xsl:attribute>
       </xsl:if>
-      <xsl:if test="@spacing = 'compact'">
-        <xsl:attribute name="compact">
-          <xsl:value-of select="@spacing"/>
-        </xsl:attribute>
-      </xsl:if>
       <xsl:apply-templates select="listitem"/>
     </ul>
   </div>
@@ -83,9 +84,6 @@ REMARK: Describe this module
 
 <!-- = itemizedlist/listitem = -->
 <xsl:template match="itemizedlist/listitem">
-  <xsl:variable name="first"
-             select="not(preceding-sibling::*
-                     [not(self::blockinfo) and not(self::title) and not(self::titleabbrev)])"/>
   <li>
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
@@ -94,11 +92,6 @@ REMARK: Describe this module
         </xsl:call-template>
       </xsl:attribute>
     </xsl:if>
-    <xsl:if test="$first">
-      <xsl:attribute name="class">
-        <xsl:text>li-first</xsl:text>
-      </xsl:attribute>
-    </xsl:if>
     <xsl:if test="@override">
       <xsl:attribute name="style">
         <xsl:text>list-style-type: </xsl:text>
@@ -131,7 +124,7 @@ REMARK: Describe this module
     </xsl:choose>
   </xsl:variable>
   <!-- FIXME: auto-numeration for nested lists -->
-  <div class="block list orderedlist">
+  <div class="list orderedlist">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -142,6 +135,12 @@ REMARK: Describe this module
     <xsl:call-template name="db2html.anchor"/>
     <xsl:apply-templates select="*[not(self::listitem)]"/>
     <ol class="orderedlist">
+      <xsl:attribute name="class">
+        <xsl:text>orderedlist</xsl:text>
+        <xsl:if test="@spacing = 'compact'">
+          <xsl:text> compact</xsl:text>
+        </xsl:if>
+      </xsl:attribute>
       <xsl:if test="@numeration">
         <xsl:attribute name="type">
           <xsl:choose>
@@ -159,11 +158,6 @@ REMARK: Describe this module
           <xsl:value-of select="$start"/>
         </xsl:attribute>
       </xsl:if>
-      <xsl:if test="@spacing = 'compact'">
-        <xsl:attribute name="compact">
-          <xsl:value-of select="@spacing"/>
-        </xsl:attribute>
-      </xsl:if>
       <!-- FIXME: @inheritnum -->
       <xsl:apply-templates select="listitem"/>
     </ol>
@@ -172,9 +166,6 @@ REMARK: Describe this module
 
 <!-- = orderedlist/listitem = -->
 <xsl:template match="orderedlist/listitem">
-  <xsl:variable name="first"
-             select="not(preceding-sibling::*
-                     [not(self::blockinfo) and not(self::title) and not(self::titleabbrev)])"/>
   <li>
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
@@ -183,11 +174,6 @@ REMARK: Describe this module
         </xsl:call-template>
       </xsl:attribute>
     </xsl:if>
-    <xsl:if test="$first">
-      <xsl:attribute name="class">
-        <xsl:text>li-first</xsl:text>
-      </xsl:attribute>
-    </xsl:if>
     <xsl:if test="@override">
       <xsl:attribute name="value">
         <xsl:value-of select="@override"/>
@@ -200,7 +186,7 @@ REMARK: Describe this module
 
 <!-- = procedure = -->
 <xsl:template match="procedure">
-  <div class="block list procedure">
+  <div class="list procedure">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -228,7 +214,7 @@ REMARK: Describe this module
 <!-- = seg = -->
 <xsl:template match="seg">
   <xsl:variable name="position" select="count(preceding-sibling::seg) + 1"/>
-  <p class="block seg">
+  <p class="seg">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -236,11 +222,6 @@ REMARK: Describe this module
         </xsl:call-template>
       </xsl:attribute>
     </xsl:if>
-    <xsl:if test="$position = 1">
-      <xsl:attribute name="class">
-        <xsl:text>segfirst</xsl:text>
-      </xsl:attribute>
-    </xsl:if>
     <xsl:apply-templates select="../../segtitle[position() = $position]"/>
     <xsl:apply-templates/>
   </p>
@@ -249,7 +230,7 @@ REMARK: Describe this module
 <!-- = seglistitem = -->
 <xsl:template match="seglistitem">
   <xsl:param name="position" select="count(preceding-sibling::seglistitem) + 1"/>
-  <div class="block seglistitem">
+  <div class="seglistitem">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -276,7 +257,7 @@ REMARK: Describe this module
 <!-- FIXME: Implement tabular segmentedlists -->
 <!-- = segmentedlist = -->
 <xsl:template match="segmentedlist">
-  <div class="block list segmentedlist">
+  <div class="list segmentedlist">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -341,7 +322,7 @@ REMARK: Describe this module
       </span>
     </xsl:when>
     <xsl:when test="@type = 'horiz'">
-      <div class="block list simplelist">
+      <div class="list simplelist">
         <xsl:if test="@lang">
           <xsl:attribute name="dir">
             <xsl:call-template name="l10n.direction">
@@ -353,7 +334,7 @@ REMARK: Describe this module
         <table class="simplelist">
           <xsl:for-each select="member[$columns = 1 or position() mod $columns = 1]">
             <tr>
-              <td class="td-first">
+              <td>
                 <xsl:apply-templates select="."/>
               </td>
               <xsl:for-each select="following-sibling::member[
@@ -372,7 +353,7 @@ REMARK: Describe this module
       </div>
     </xsl:when>
     <xsl:otherwise>
-      <div class="block list simplelist">
+      <div class="list simplelist">
         <xsl:if test="@lang">
           <xsl:attribute name="dir">
             <xsl:call-template name="l10n.direction">
@@ -385,7 +366,7 @@ REMARK: Describe this module
         <table class="simplelist">
           <xsl:for-each select="member[position() &lt;= $rows]">
             <tr>
-              <td class="td-first">
+              <td>
                 <xsl:apply-templates select="."/>
               </td>
               <xsl:for-each select="following-sibling::member[
@@ -412,9 +393,6 @@ REMARK: Describe this module
 <!-- FIXME: Do something with @performance -->
 <!-- = step = -->
 <xsl:template match="step">
-  <xsl:variable name="first"
-             select="not(preceding-sibling::*
-                     [not(self::blockinfo) and not(self::title) and not(self::titleabbrev)])"/>
   <li>
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
@@ -423,11 +401,6 @@ REMARK: Describe this module
         </xsl:call-template>
       </xsl:attribute>
     </xsl:if>
-    <xsl:if test="$first">
-      <xsl:attribute name="class">
-        <xsl:text>li-first</xsl:text>
-      </xsl:attribute>
-    </xsl:if>
     <xsl:apply-templates/>
   </li>
 </xsl:template>
@@ -436,7 +409,7 @@ REMARK: Describe this module
 <!-- = substeps = -->
 <xsl:template match="substeps">
   <xsl:variable name="depth" select="count(ancestor::substeps)"/>
-  <div class="block list substeps">
+  <div class="list substeps">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -479,9 +452,6 @@ REMARK: Describe this module
     </xsl:choose>
     <xsl:attribute name="class">
       <xsl:text>term</xsl:text>
-      <xsl:if test="not(../preceding-sibling::varlistentry)">
-        <xsl:text> dt-first</xsl:text>
-      </xsl:if>
     </xsl:attribute>
     <xsl:if test="../varlistentry/@id and not(preceding-sibling::term)">
       <xsl:call-template name="db2html.anchor">
@@ -494,7 +464,7 @@ REMARK: Describe this module
 
 <!-- = variablelist = -->
 <xsl:template match="variablelist">
-  <div class="block list variablelist">
+  <div class="list variablelist">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
diff --git a/xslt/docbook/html/db2html-title.xsl b/xslt/docbook/html/db2html-title.xsl
index beaca5c..107e9ad 100644
--- a/xslt/docbook/html/db2html-title.xsl
+++ b/xslt/docbook/html/db2html-title.xsl
@@ -48,7 +48,7 @@ REMARK: Talk about the different kinds of title blocks
       <xsl:with-param name="node" select="$referent"/>
     </xsl:call-template>
   </xsl:variable>
-  <div class="block block-first {local-name($node)}">
+  <div class="block {local-name($node)}">
     <xsl:choose>
       <xsl:when test="$dir = 'ltr' or $dir = 'rtl'">
         <xsl:attribute name="dir">
diff --git a/xslt/docbook/html/db2html.xsl b/xslt/docbook/html/db2html.xsl
index 786107c..855a890 100644
--- a/xslt/docbook/html/db2html.xsl
+++ b/xslt/docbook/html/db2html.xsl
@@ -45,6 +45,7 @@ DocBook to HTML
 
 <xsl:include href="../../theme/theme-colors.xsl"/>
 <xsl:include href="../../theme/theme-icons.xsl"/>
+<xsl:include href="../../theme/theme-html.xsl"/>
 
 <xsl:include href="../common/db-chunk.xsl"/>
 <xsl:include href="../common/db-common.xsl"/>
diff --git a/xslt/docbook/html/db2xhtml.xsl b/xslt/docbook/html/db2xhtml.xsl
index 515cc01..cd76726 100644
--- a/xslt/docbook/html/db2xhtml.xsl
+++ b/xslt/docbook/html/db2xhtml.xsl
@@ -44,6 +44,7 @@ DocBook to XHTML
 
 <xsl:include href="../../theme/theme-colors.xsl"/>
 <xsl:include href="../../theme/theme-icons.xsl"/>
+<xsl:include href="../../theme/theme-html.xsl"/>
 
 <xsl:include href="../common/db-chunk.xsl"/>
 <xsl:include href="../common/db-common.xsl"/>
diff --git a/xslt/mallard/html/mal2html-block.xsl b/xslt/mallard/html/mal2html-block.xsl
index 3ca00ce..be53610 100644
--- a/xslt/mallard/html/mal2html-block.xsl
+++ b/xslt/mallard/html/mal2html-block.xsl
@@ -35,33 +35,31 @@ FIXME
 -->
 <xsl:template name="mal2html.pre">
   <xsl:param name="node" select="."/>
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
   <xsl:variable name="first" select="$node/node()[1]/self::text()"/>
   <xsl:variable name="last" select="$node/node()[last()]/self::text()"/>
-  <pre>
+  <div>
     <xsl:attribute name="class">
       <xsl:value-of select="local-name($node)"/>
-      <xsl:if test="$first_child">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
     </xsl:attribute>
-    <xsl:if test="$first">
-      <xsl:call-template name="utils.strip_newlines">
-        <xsl:with-param name="string" select="$first"/>
-        <xsl:with-param name="leading" select="true()"/>
-        <xsl:with-param name="trailing" select="count(node()) = 1"/>
-      </xsl:call-template>
-    </xsl:if>
-    <xsl:apply-templates mode="mal2html.inline.mode"
-                         select="node()[not(self::text() and (position() = 1 or position() = last()))]"/>
-    <xsl:if test="$last and (count(node()) != 1)">
-      <xsl:call-template name="utils.strip_newlines">
-        <xsl:with-param name="string" select="$last"/>
-        <xsl:with-param name="leading" select="false()"/>
-        <xsl:with-param name="trailing" select="true()"/>
-      </xsl:call-template>
-    </xsl:if>
-  </pre>
+    <pre class="contents">
+      <xsl:if test="$first">
+        <xsl:call-template name="utils.strip_newlines">
+          <xsl:with-param name="string" select="$first"/>
+          <xsl:with-param name="leading" select="true()"/>
+          <xsl:with-param name="trailing" select="count(node()) = 1"/>
+        </xsl:call-template>
+      </xsl:if>
+      <xsl:apply-templates mode="mal2html.inline.mode"
+                           select="node()[not(self::text() and (position() = 1 or position() = last()))]"/>
+      <xsl:if test="$last and (count(node()) != 1)">
+        <xsl:call-template name="utils.strip_newlines">
+          <xsl:with-param name="string" select="$last"/>
+          <xsl:with-param name="leading" select="false()"/>
+          <xsl:with-param name="trailing" select="true()"/>
+        </xsl:call-template>
+      </xsl:if>
+    </pre>
+  </div>
 </xsl:template>
 
 
@@ -83,33 +81,21 @@ FIXME
 
 <!-- = code = -->
 <xsl:template mode="mal2html.block.mode" match="mal:code">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
-  <xsl:call-template name="mal2html.pre">
-    <xsl:with-param name="first_child" select="$first_child"/>
-  </xsl:call-template>
+  <xsl:call-template name="mal2html.pre"/>
 </xsl:template>
 
 <!-- = comment = -->
 <xsl:template mode="mal2html.block.mode" match="mal:comment">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
   <xsl:if test="$mal2html.editor_mode
                 or processing-instruction('mal2html.show_comment')">
-    <div>
-      <xsl:attribute name="class">
-        <xsl:text>comment</xsl:text>
-        <xsl:if test="$first_child">
-          <xsl:text> first-child</xsl:text>
-        </xsl:if>
-      </xsl:attribute>
+    <div class="comment">
       <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
       <xsl:apply-templates mode="mal2html.block.mode" select="mal:cite"/>
-      <xsl:for-each select="mal:*[not(self::mal:title or self::mal:cite)
-                            and ($mal2html.editor_mode or not(self::mal:comment)
-                            or processing-instruction('mal2html.show_comment'))]">
-        <xsl:apply-templates mode="mal2html.block.mode" select=".">
-          <xsl:with-param name="first_child" select="position() = 1"/>
-        </xsl:apply-templates>
-      </xsl:for-each>
+      <div class="comment-inner">
+        <xsl:for-each select="*[not(self::mal:title or self::mal:cite)]">
+          <xsl:apply-templates mode="mal2html.block.mode" select="."/>
+        </xsl:for-each>
+      </div>
     </div>
   </xsl:if>
 </xsl:template>
@@ -138,66 +124,34 @@ FIXME
 
 <!-- = example = -->
 <xsl:template mode="mal2html.block.mode" match="mal:example">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
-  <div>
-    <xsl:attribute name="class">
-      <xsl:text>example</xsl:text>
-      <xsl:if test="$first_child">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
-    <xsl:for-each select="mal:*[$mal2html.editor_mode or not(self::mal:comment)
-                          or processing-instruction('mal2html.show_comment')]">
-      <xsl:apply-templates mode="mal2html.block.mode" select=".">
-        <xsl:with-param name="first_child" select="position() = 1"/>
-      </xsl:apply-templates>
-    </xsl:for-each>
+  <div class="example">
+    <xsl:apply-templates mode="mal2html.block.mode"/>
   </div>
 </xsl:template>
 
 <!-- = figure = -->
 <xsl:template mode="mal2html.block.mode" match="mal:figure">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
-  <div>
-    <xsl:attribute name="class">
-      <xsl:text>figure</xsl:text>
-      <xsl:if test="$first_child">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
-    <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
-    <div class="figure-contents">
-      <xsl:for-each select="mal:*[not(self::mal:title or self::mal:desc)
-                            and ($mal2html.editor_mode or not(self::mal:comment)
-                            or processing-instruction('mal2html.show_comment'))]">
-        <xsl:apply-templates mode="mal2html.block.mode" select=".">
-          <xsl:with-param name="first_child" select="position() = 1"/>
-        </xsl:apply-templates>
-      </xsl:for-each>
+  <div class="figure">
+    <div class="inner">
+      <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
+      <div class="contents">
+        <xsl:for-each select="*[not(self::mal:title or self::mal:desc)]">
+          <xsl:apply-templates mode="mal2html.block.mode" select="."/>
+        </xsl:for-each>
+      </div>
+      <xsl:apply-templates mode="mal2html.block.mode" select="mal:desc"/>
     </div>
-    <xsl:apply-templates mode="mal2html.block.mode" select="mal:desc"/>
   </div>
 </xsl:template>
 
 <!-- = listing = -->
 <xsl:template mode="mal2html.block.mode" match="mal:listing">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
-  <div>
-    <xsl:attribute name="class">
-      <xsl:text>listing</xsl:text>
-      <xsl:if test="$first_child">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
+  <div class="listing">
     <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
     <xsl:apply-templates mode="mal2html.block.mode" select="mal:desc"/>
-    <div class="listing-contents">
-      <xsl:for-each select="mal:*[not(self::mal:title or self::mal:desc)
-                            and ($mal2html.editor_mode or not(self::mal:comment)
-                            or processing-instruction('mal2html.show_comment'))]">
-        <xsl:apply-templates mode="mal2html.block.mode" select=".">
-          <xsl:with-param name="first_child" select="position() = 1"/>
-        </xsl:apply-templates>
+    <div class="listing-inner">
+      <xsl:for-each select="*[not(self::mal:title or self::mal:desc)]">
+        <xsl:apply-templates mode="mal2html.block.mode" select="."/>
       </xsl:for-each>
     </div>
   </div>
@@ -205,7 +159,6 @@ FIXME
 
 <!-- = note = -->
 <xsl:template mode="mal2html.block.mode" match="mal:note">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
   <xsl:variable name="notestyle">
     <xsl:choose>
       <xsl:when test="contains(concat(' ', @style, ' '), ' advanced ')">
@@ -231,20 +184,11 @@ FIXME
       <xsl:if test="normalize-space($notestyle) != ''">
         <xsl:value-of select="concat(' note-', $notestyle)"/>
       </xsl:if>
-      <xsl:if test="$first_child">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
     </xsl:attribute>
-    <div class="note-inner">
+    <div class="inner">
       <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
-      <div class="note-contents">
-        <xsl:for-each select="mal:*[not(self::mal:title)
-                              and ($mal2html.editor_mode or not(self::mal:comment)
-                              or processing-instruction('mal2html.show_comment'))]">
-          <xsl:apply-templates mode="mal2html.block.mode" select=".">
-            <xsl:with-param name="first_child" select="position() = 1"/>
-          </xsl:apply-templates>
-        </xsl:for-each>
+      <div class="contents">
+        <xsl:apply-templates mode="mal2html.block.mode" select="*[not(self::mal:title)]"/>
       </div>
     </div>
   </div>
@@ -255,37 +199,19 @@ FIXME
 
 <!-- = p = -->
 <xsl:template mode="mal2html.block.mode" match="mal:p">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
-  <p>
-    <xsl:attribute name="class">
-      <xsl:text>p</xsl:text>
-      <xsl:if test="$first_child">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
+  <p class="p">
     <xsl:apply-templates mode="mal2html.inline.mode"/>
   </p>
 </xsl:template>
 
 <!-- = quote = -->
 <xsl:template mode="mal2html.block.mode" match="mal:quote">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
   <div class="quote">
-    <xsl:attribute name="class">
-      <xsl:text>quote</xsl:text>
-      <xsl:if test="$first_child">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
-    <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
-    <div class="quote-inner">
-      <blockquote class="quote-contents">
-        <xsl:for-each select="mal:*[not(self::mal:title or self::mal:cite)
-                              and ($mal2html.editor_mode or not(self::mal:comment)
-                              or processing-instruction('mal2html.show_comment'))]">
-          <xsl:apply-templates mode="mal2html.block.mode" select=".">
-            <xsl:with-param name="first_child" select="position() = 1"/>
-          </xsl:apply-templates>
+    <div class="inner">
+      <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
+      <blockquote class="quote-inner">
+        <xsl:for-each select="*[not(self::mal:title or self::mal:cite)]">
+          <xsl:apply-templates mode="mal2html.block.mode" select="."/>
         </xsl:for-each>
       </blockquote>
       <xsl:apply-templates mode="mal2html.block.mode" select="mal:cite"/>
@@ -317,31 +243,17 @@ FIXME
 
 <!-- = screen = -->
 <xsl:template mode="mal2html.block.mode" match="mal:screen">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
-  <xsl:call-template name="mal2html.pre">
-    <xsl:with-param name="first_child" select="$first_child"/>
-  </xsl:call-template>
+  <xsl:call-template name="mal2html.pre"/>
 </xsl:template>
 
 <!-- = synopsis = -->
 <xsl:template mode="mal2html.block.mode" match="mal:synopsis">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
   <div class="synopsis">
-    <xsl:attribute name="class">
-      <xsl:text>synopsis</xsl:text>
-      <xsl:if test="$first_child">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
     <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
     <xsl:apply-templates mode="mal2html.block.mode" select="mal:desc"/>
-    <div class="synopsis-contents">
-      <xsl:for-each select="mal:*[not(self::mal:title or self::mal:desc)
-                            and ($mal2html.editor_mode or not(self::mal:comment)
-                            or processing-instruction('mal2html.show_comment'))]">
-        <xsl:apply-templates mode="mal2html.block.mode" select=".">
-          <xsl:with-param name="first_child" select="position() = 1"/>
-        </xsl:apply-templates>
+    <div class="synopsis-inner">
+      <xsl:for-each select="*[not(self::mal:title or self::mal:desc)]">
+        <xsl:apply-templates mode="mal2html.block.mode" select="."/>
       </xsl:for-each>
     </div>
   </div>
diff --git a/xslt/mallard/html/mal2html-css.xsl b/xslt/mallard/html/mal2html-css.xsl
index 46d6cbe..c0a1e9c 100644
--- a/xslt/mallard/html/mal2html-css.xsl
+++ b/xslt/mallard/html/mal2html-css.xsl
@@ -24,6 +24,7 @@ Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
 <!--!!==========================================================================
 Mallard to HTML - CSS
+:Requires: theme-html
 
 REMARK: Describe this module
 -->
@@ -94,19 +95,8 @@ by extension stylesheets to extend or override the CSS.
       <xsl:with-param name="direction" select="$direction"/>
     </xsl:call-template>
   </xsl:variable>
+  <xsl:call-template name="theme.html.css"/>
   <xsl:text>
-html { height: 100%; }
-body {
-  margin: 0px;
-  background-color: </xsl:text>
-    <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
-  padding: 12px;
-  min-height: 100%;
-  direction: </xsl:text><xsl:value-of select="$direction"/><xsl:text>;
-}
-ul, ol, dl, dd { margin: 0; }
-div, pre, p, li, dt { margin: 1em 0 0 0; padding: 0; }
-.first-child { margin-top: 0; }
 div.floatleft {
   float: left;
   margin-top: 0;
@@ -117,37 +107,7 @@ div.floatright {
   margin-top: 0;
   margin-left: 1em;
 }
-li.condensed { margin-top: 0.2em; }
-a {
-  text-decoration: none;
-  color: </xsl:text>
-    <xsl:value-of select="$theme.color.link"/><xsl:text>;
-}
-a:visited {
-  color: </xsl:text>
-    <xsl:value-of select="$theme.color.link_visited"/><xsl:text>;
-}
-a:hover { text-decoration: underline; }
 
-div.headbar {
-  margin: 0;
-  max-width: 48em;
-}
-div.footbar {
-  margin: 0;
-  max-width: 48em;
-}
-div.body {
-  margin: 0;
-  padding: 1em;
-  max-width: 48em;
-  min-height: 20em;
-  -moz-border-radius: 6px;
-  border: solid 1px </xsl:text>
-    <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-  background-color: </xsl:text>
-    <xsl:value-of select="$theme.color.background"/><xsl:text>;
-}
 div.navbar {
   margin: 0;
   float: right;
@@ -171,27 +131,7 @@ div.copyrights {
   color: </xsl:text>
     <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
 }
-div.section { margin-top: 2.4em; clear: both; }
-div.section div.section {
-  margin-top: 1.72em;
-  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.72em;
-}
-div.section div.section div.section { margin-top: 1.44em; }
-div.header {
-  margin: 0;
-  color: </xsl:text>
-    <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-  border-bottom: solid 1px </xsl:text>
-    <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-}
-h1 {
-  font-size: 1.44em;
-  margin: 0;
-}
-h2, h3, h4, h5, h6, h7 {
-  font-size: 1.2em;
-  margin: 0;
-}
+
 table { border-collapse: collapse; }
 
 div.autolinks ul { margin: 0; padding: 0; }
@@ -246,116 +186,21 @@ div.linkdivsep {
     <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
 }
 
-div.title {
-  margin: 0 0 0.2em 0;
-  font-weight: bold;
-  color: </xsl:text>
-    <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-}
-div.desc { margin: 0 0 0.2em 0; }
 div.desc-listing, div.desc-synopsis { font-style: italic; }
-div.desc-figure { margin: 0.2em 0 0 0; }
-pre.code {
-  /* FIXME: In RTL locales, we really want to align this left, but the watermark
-   * we have is designed to fit in the top right corner.  Either we need a new
-   * watermark, or we need a separate RTL version.
-   */
-  background: url('</xsl:text>
-    <xsl:value-of select="$theme.icons.watermark.code"/><xsl:text>') no-repeat top right;
-  border: solid 2px </xsl:text>
-    <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-  padding: 0.5em 1em 0.5em 1em;
-}
+
 div.example {
   border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: solid 4px </xsl:text>
     <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
   padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1em;
 }
-div.figure {
-  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.72em;
-  padding: 4px;
-  color: </xsl:text>
-    <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-  border: solid 1px </xsl:text>
-    <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-  background-color: </xsl:text>
-    <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
-}
-div.figure-contents {
-  margin: 0;
-  padding: 0.5em 1em 0.5em 1em;
-  text-align: center;
-  color: </xsl:text>
-    <xsl:value-of select="$theme.color.text"/><xsl:text>;
-  border: solid 1px </xsl:text>
-    <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-  background-color: </xsl:text>
-    <xsl:value-of select="$theme.color.background"/><xsl:text>;
-}
-div.listing-contents { margin: 0; padding: 0; }
-div.note {
-  padding: 0.5em 6px 0.5em 6px;
-  border-top: solid 1px </xsl:text>
-    <xsl:value-of select="$theme.color.red_border"/><xsl:text>;
-  border-bottom: solid 1px </xsl:text>
-    <xsl:value-of select="$theme.color.red_border"/><xsl:text>;
-  background-color: </xsl:text>
-    <xsl:value-of select="$theme.color.yellow_background"/><xsl:text>;
-}
-div.note-inner {
-  margin: 0;
-  padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
-    <xsl:value-of select="$theme.icons.emblem.size + 12"/><xsl:text>px;
-  background-position: </xsl:text><xsl:value-of select="$left"/><xsl:text> top;
-  background-repeat: no-repeat;
-  min-height: </xsl:text><xsl:value-of select="$theme.icons.emblem.size"/><xsl:text>px;
-  background-image: url("</xsl:text>
-    <xsl:value-of select="$theme.icons.emblem.note"/><xsl:text>");
-}
-div.note-advanced div.note-inner { <!-- background-image: url("</xsl:text>
-  <xsl:value-of select="$theme.icons.emblem.note.advanced"/><xsl:text>"); --> }
-div.note-bug div.note-inner { background-image: url("</xsl:text>
-  <xsl:value-of select="$theme.icons.emblem.note.bug"/><xsl:text>"); }
-div.note-important div.note-inner { background-image: url("</xsl:text>
-  <xsl:value-of select="$theme.icons.emblem.note.important"/><xsl:text>"); }
-div.note-tip div.note-inner { background-image: url("</xsl:text>
-  <xsl:value-of select="$theme.icons.emblem.note.tip"/><xsl:text>"); }
-div.note-warning div.note-inner { background-image: url("</xsl:text>
-  <xsl:value-of select="$theme.icons.emblem.note.warning"/><xsl:text>"); }
-div.note-contents { margin: 0; padding: 0; }
-div.quote-inner {
-  margin: 0;
-  background-image: url('</xsl:text>
-    <xsl:value-of select="$theme.icons.watermark.quote"/><xsl:text>');
-  background-repeat: no-repeat;
-  background-position: top </xsl:text><xsl:value-of select="$left"/><xsl:text>;
-  padding: 0.5em;
-  padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 4em;
-}
-div.title-quote {
-  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 4em;
-}
-blockquote { margin: 0; padding: 0; }
+div.listing-inner { margin: 0; padding: 0; }
+
 div.cite-comment {
   margin-top: 0.5em;
   color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
 }
-div.cite-quote {
-  margin-top: 0.5em;
-  color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-}
-div.cite-quote::before {
-  <!-- FIXME: i18n -->
-  content: '&#x2015; ';
-}
-pre.screen {
-  padding: 0.5em 1em 0.5em 1em;
-  background-color: </xsl:text>
-    <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
-  border: solid 2px </xsl:text>
-    <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-}
-div.synopsis-contents {
+
+div.synopsis-inner {
   margin: 0;
   padding: 0.5em 1em 0.5em 1em;
   border-top: solid 2px;
@@ -365,18 +210,18 @@ div.synopsis-contents {
   background-color: </xsl:text>
     <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
 }
-div.synopsis pre.code {
+div.synopsis div.code {
   background: none;
   border: none;
   padding: 0;
 }
+div.synopsis div.code > pre.contents { margin: 0; padding: 0; }
 
-div.list-contents { margin: 0; padding: 0; }
+div.list-inner { margin: 0; padding: 0; }
 div.title-list { margin-bottom: 0.5em; }
 ol.list, ul.list { margin: 0; padding: 0; }
-li.item-list { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.44em; }
 
-div.steps-contents {
+div.steps-inner {
   margin: 0;
   padding: 0.5em 1em 0.5em 1em;
   border-top: solid 2px;
@@ -386,27 +231,22 @@ div.steps-contents {
   background-color: </xsl:text>
     <xsl:value-of select="$theme.color.yellow_background"/><xsl:text>;
 }
-div.steps-contents div.steps-contents {
+div.steps-inner div.steps-inner {
   padding: 0;
   border: none;
   background-color: none;
 }
-ol.steps, ul.steps { margin: 0; padding: 0; }
-li.item-steps { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.44em; }
+li.steps { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.72em; }
+li.steps li.steps { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 2.4em; }
 
-div.terms-contents { margin: 0; }
-dt.item-next { margin-top: 0; }
-dd.item-terms {
-  margin-top: 0.2em;
-  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.44em;
-}
+div.terms-inner { margin: 0; }
 
 ul.tree {
   margin: 0; padding: 0;
   list-style-type: none;
 }
-li.item-tree { margin: 0; padding: 0; }
-div.item-tree { margin: 0; padding: 0; }
+li.tree { margin: 0; padding: 0; }
+li.tree div { margin: 0; padding: 0; }
 ul.tree ul.tree { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.44em; }
 div.tree-lines ul.tree { margin-left: 0; }
 
diff --git a/xslt/mallard/html/mal2html-list.xsl b/xslt/mallard/html/mal2html-list.xsl
index 6ec692c..814b655 100644
--- a/xslt/mallard/html/mal2html-list.xsl
+++ b/xslt/mallard/html/mal2html-list.xsl
@@ -55,7 +55,7 @@ FIXME
 
 <!-- = list = -->
 <xsl:template mode="mal2html.block.mode" match="mal:list">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
+  <xsl:variable name="style" select="concat(' ', @style, ' ')"/>
   <xsl:variable name="el">
     <xsl:choose>
       <xsl:when test="not(@type) or (@type = 'none') or (@type = 'box')
@@ -68,18 +68,15 @@ FIXME
       </xsl:otherwise>
     </xsl:choose>
   </xsl:variable>
-  <div>
-    <xsl:attribute name="class">
-      <xsl:text>list</xsl:text>
-      <xsl:if test="$first_child">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
+  <div class="list">
     <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
-    <div class="list-contents">
+    <div class="list-inner">
       <xsl:element name="{$el}" namespace="{$mal2html.namespace}">
         <xsl:attribute name="class">
           <xsl:text>list</xsl:text>
+          <xsl:if test="contains($style, ' compact ')">
+            <xsl:text> compact</xsl:text>
+          </xsl:if>
         </xsl:attribute>
         <xsl:if test="@type">
           <xsl:attribute name="style">
@@ -94,39 +91,16 @@ FIXME
 
 <!-- = list/item = -->
 <xsl:template mode="mal2html.list.list.mode" match="mal:item">
-  <li>
-    <xsl:attribute name="class">
-      <xsl:text>item-list</xsl:text>
-      <xsl:if test="not(preceding-sibling::mal:item)">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
-      <xsl:if test="contains(concat(' ', ../@style, ' '), ' condensed ')">
-        <xsl:text> condensed</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
-    <xsl:for-each
-     select="mal:*[
-             ($mal2html.editor_mode or not(self::mal:comment)
-             or processing-instruction('mal2html.show_comment'))]">
-      <xsl:apply-templates mode="mal2html.block.mode" select=".">
-        <xsl:with-param name="first_child" select="position() = 1"/>
-      </xsl:apply-templates>
-    </xsl:for-each>
+  <li class="list">
+    <xsl:apply-templates mode="mal2html.block.mode"/>
   </li>
 </xsl:template>
 
 <!-- = steps = -->
 <xsl:template mode="mal2html.block.mode" match="mal:steps">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
-  <div>
-    <xsl:attribute name="class">
-      <xsl:text>steps</xsl:text>
-      <xsl:if test="$first_child">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
+  <div class="steps">
     <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
-    <div class="steps-contents">
+    <div class="steps-inner">
       <ol class="steps">
         <xsl:apply-templates mode="mal2html.list.steps.mode" select="mal:item"/>
       </ol>
@@ -136,37 +110,24 @@ FIXME
 
 <!-- = steps/item = -->
 <xsl:template mode="mal2html.list.steps.mode" match="mal:item">
-  <li>
-    <xsl:attribute name="class">
-      <xsl:text>item-steps</xsl:text>
-      <xsl:if test="not(preceding-sibling::mal:item)">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
-    <xsl:for-each
-     select="mal:*[
-             ($mal2html.editor_mode or not(self::mal:comment)
-             or processing-instruction('mal2html.show_comment'))]">
-      <xsl:apply-templates mode="mal2html.block.mode" select=".">
-        <xsl:with-param name="first_child" select="position() = 1"/>
-      </xsl:apply-templates>
-    </xsl:for-each>
+  <li class="steps">
+    <xsl:apply-templates mode="mal2html.block.mode"/>
   </li>
 </xsl:template>
 
 <!-- = terms = -->
 <xsl:template mode="mal2html.block.mode" match="mal:terms">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
-  <div>
-    <xsl:attribute name="class">
-      <xsl:text>terms</xsl:text>
-      <xsl:if test="$first_child">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
-    </xsl:attribute>
+  <xsl:variable name="style" select="concat(' ', @style, ' ')"/>
+  <div class="terms">
     <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
-    <div class="terms-contents">
-      <dl class="terms">
+    <div class="terms-inner">
+      <dl>
+        <xsl:attribute name="class">
+          <xsl:text>terms</xsl:text>
+          <xsl:if test="contains($style, ' compact ')">
+            <xsl:text> compact</xsl:text>
+          </xsl:if>
+        </xsl:attribute>
         <xsl:apply-templates mode="mal2html.list.terms.mode" select="mal:item"/>
       </dl>
     </div>
@@ -176,34 +137,17 @@ FIXME
 <!-- = list/item = -->
 <xsl:template mode="mal2html.list.terms.mode" match="mal:item">
   <xsl:for-each select="mal:title">
-    <dt>
-      <xsl:attribute name="class">
-        <xsl:text>item-terms</xsl:text>
-        <xsl:if test="not(../preceding-sibling::mal:item)">
-          <xsl:text> first-child</xsl:text>
-        </xsl:if>
-        <xsl:if test="preceding-sibling::mal:title">
-          <xsl:text> item-next</xsl:text>
-        </xsl:if>
-      </xsl:attribute>
+    <dt class="terms">
       <xsl:apply-templates mode="mal2html.inline.mode"/>
     </dt>
   </xsl:for-each>
-  <dd class="item-terms">
-    <xsl:for-each
-     select="mal:*[not(self::mal:title)
-             and ($mal2html.editor_mode or not(self::mal:comment)
-             or processing-instruction('mal2html.show_comment'))]">
-      <xsl:apply-templates mode="mal2html.block.mode" select=".">
-        <xsl:with-param name="first_child" select="position() = 1"/>
-      </xsl:apply-templates>
-    </xsl:for-each>
+  <dd class="terms">
+    <xsl:apply-templates mode="mal2html.block.mode" select="*[not(self::mal:title)]"/>
   </dd>
 </xsl:template>
 
 <!-- = tree = -->
 <xsl:template mode="mal2html.block.mode" match="mal:tree">
-  <xsl:param name="first_child" select="not(preceding-sibling::*)"/>
   <xsl:variable name="lines" select="contains(concat(' ', @style, ' '), ' lines ')"/>
   <div>
     <xsl:attribute name="class">
@@ -211,10 +155,6 @@ FIXME
       <xsl:if test="$lines">
         <xsl:text> tree-lines</xsl:text>
       </xsl:if>
-      <!-- FIXME -->
-      <xsl:if test="$first_child">
-        <xsl:text> first-child</xsl:text>
-      </xsl:if>
     </xsl:attribute>
     <ul class="tree">
       <xsl:apply-templates mode="mal2html.list.tree.mode" select="mal:item">
@@ -228,8 +168,8 @@ FIXME
 <xsl:template mode="mal2html.list.tree.mode" match="mal:item">
   <xsl:param name="lines" select="false()"/>
   <xsl:param name="prefix" select="''"/>
-  <li class="item-tree">
-    <div class="item-tree">
+  <li class="tree">
+    <div>
       <xsl:if test="$lines">
         <xsl:value-of select="$prefix"/>
         <xsl:text> </xsl:text>
diff --git a/xslt/mallard/html/mal2html-page.xsl b/xslt/mallard/html/mal2html-page.xsl
index 4e7d29e..a07dd4d 100644
--- a/xslt/mallard/html/mal2html-page.xsl
+++ b/xslt/mallard/html/mal2html-page.xsl
@@ -255,7 +255,7 @@ REMARK: Describe this template
   </xsl:variable>
   <xsl:variable name="guidenodes" select="exsl:node-set($guidelinks)/*"/>
   <xsl:if test="$inlinks or $outlinks or $guidenodes">
-    <div class="section autolinkssection">
+    <div class="sect autolinkssection">
       <div class="header">
         <xsl:element name="{concat('h', $depth)}" namespace="{$mal2html.namespace}">
           <xsl:attribute name="class">
@@ -358,7 +358,7 @@ REMARK: FIXME
 -->
 <xsl:template name="mal2html.page.headbar">
   <xsl:param name="node" select="."/>
-  <div class="headbar">
+  <div class="head">
     <xsl:call-template name="mal2html.page.linktrails">
       <xsl:with-param name="node" select="$node"/>
     </xsl:call-template>
@@ -374,7 +374,7 @@ REMARK: FIXME
 -->
 <xsl:template name="mal2html.page.footbar">
   <xsl:param name="node" select="."/>
-  <div class="footbar">
+  <div class="foot">
     <xsl:call-template name="mal2html.page.copyrights">
       <xsl:with-param name="node" select="$node"/>
     </xsl:call-template>
@@ -606,14 +606,10 @@ REMARK: Describe this template
     <xsl:apply-templates mode="mal2html.title.mode" select="mal:title"/>
     <xsl:apply-templates mode="mal2html.title.mode" select="mal:subtitle"/>
   </div>
-  <div class="contents">
+  <div class="page-inner">
     <xsl:for-each
-        select="mal:*[not(self::mal:section or self::mal:title or self::mal:subtitle)
-                and ($mal2html.editor_mode or not(self::mal:comment)
-                or processing-instruction('mal2html.show_comment'))]">
-      <xsl:apply-templates mode="mal2html.block.mode" select=".">
-        <xsl:with-param name="first_child" select="position() = 1"/>
-      </xsl:apply-templates>
+        select="*[not(self::mal:section or self::mal:title or self::mal:subtitle)]">
+      <xsl:apply-templates mode="mal2html.block.mode" select="."/>
     </xsl:for-each>
     <xsl:if test="@type = 'guide'">
       <xsl:call-template name="mal2html.page.topiclinks"/>
@@ -627,19 +623,15 @@ REMARK: Describe this template
 
 <!-- = section = -->
 <xsl:template match="mal:section">
-  <div class="section" id="{ id}">
+  <div class="sect section" id="{ id}">
     <div class="header">
       <xsl:apply-templates mode="mal2html.title.mode" select="mal:title"/>
       <xsl:apply-templates mode="mal2html.title.mode" select="mal:subtitle"/>
     </div>
-    <div class="contents">
+    <div class="section-inner">
       <xsl:for-each
-          select="mal:*[not(self::mal:section or self::mal:title or self::mal:subtitle)
-                  and ($mal2html.editor_mode or not(self::mal:comment)
-                  or processing-instruction('mal2html.show_comment'))]">
-        <xsl:apply-templates mode="mal2html.block.mode" select=".">
-          <xsl:with-param name="first_child" select="position() = 1"/>
-        </xsl:apply-templates>
+          select="*[not(self::mal:section or self::mal:title or self::mal:subtitle)]">
+        <xsl:apply-templates mode="mal2html.block.mode" select="."/>
       </xsl:for-each>
       <xsl:if test="/mal:page/@type = 'guide'">
         <xsl:call-template name="mal2html.page.topiclinks"/>
diff --git a/xslt/mallard/html/mal2html.xsl b/xslt/mallard/html/mal2html.xsl
index ba5c3af..cf68a2c 100644
--- a/xslt/mallard/html/mal2html.xsl
+++ b/xslt/mallard/html/mal2html.xsl
@@ -59,9 +59,9 @@ REMARK: Describe this module
 <xsl:include href="mal2html-table.xsl"/>
 
 <xsl:include href="../../common/utils.xsl"/>
-
 <xsl:include href="../../theme/theme-colors.xsl"/>
 <xsl:include href="../../theme/theme-icons.xsl"/>
+<xsl:include href="../../theme/theme-html.xsl"/>
 
 <!-- FIXME -->
 <xsl:template match="*">
diff --git a/xslt/mallard/html/mal2xhtml.xsl b/xslt/mallard/html/mal2xhtml.xsl
index d8baebf..73230d8 100644
--- a/xslt/mallard/html/mal2xhtml.xsl
+++ b/xslt/mallard/html/mal2xhtml.xsl
@@ -58,9 +58,9 @@ REMARK: Describe this module
 <xsl:include href="mal2html-table.xsl"/>
 
 <xsl:include href="../../common/utils.xsl"/>
-
 <xsl:include href="../../theme/theme-colors.xsl"/>
 <xsl:include href="../../theme/theme-icons.xsl"/>
+<xsl:include href="../../theme/theme-html.xsl"/>
 
 <!-- FIXME -->
 <xsl:template match="*">
diff --git a/xslt/theme/Makefile.am b/xslt/theme/Makefile.am
index 2e9dad3..5c38e13 100644
--- a/xslt/theme/Makefile.am
+++ b/xslt/theme/Makefile.am
@@ -2,6 +2,7 @@ xsldir=$(datadir)/yelp-xsl/xslt/theme
 
 xsl_DATA =			\
 	theme-colors.xsl	\
+	theme-html.xsl		\
 	theme-icons.xsl
 
 EXTRA_DIST=$(xsl_DATA)
diff --git a/xslt/theme/theme-html.xsl b/xslt/theme/theme-html.xsl
new file mode 100644
index 0000000..d3d2cae
--- /dev/null
+++ b/xslt/theme/theme-html.xsl
@@ -0,0 +1,310 @@
+<?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
+<!--
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU Lesser General Public License as published by the Free
+Software Foundation; either version 2 of the License, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with this program; see the file COPYING.LGPL.  If not, write to the
+Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.
+-->
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
+                version="1.0">
+
+<!--!!==========================================================================
+Common HTML Styling
+:Requires: gettext theme-colors theme-icons
+
+-->
+
+<!--**==========================================================================
+theme.html.css
+-->
+<xsl:template name="theme.html.css">
+  <xsl:variable name="direction">
+    <xsl:call-template name="l10n.direction"/>
+  </xsl:variable>
+  <xsl:variable name="left">
+    <xsl:call-template name="l10n.align.start">
+      <xsl:with-param name="direction" select="$direction"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:variable name="right">
+    <xsl:call-template name="l10n.align.end">
+      <xsl:with-param name="direction" select="$direction"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:call-template name="theme.html.css.core">
+    <xsl:with-param name="direction" select="$direction"/>
+    <xsl:with-param name="left" select="$left"/>
+    <xsl:with-param name="right" select="$right"/>
+  </xsl:call-template>
+  <xsl:call-template name="theme.html.css.elements">
+    <xsl:with-param name="direction" select="$direction"/>
+    <xsl:with-param name="left" select="$left"/>
+    <xsl:with-param name="right" select="$right"/>
+  </xsl:call-template>
+</xsl:template>
+
+<xsl:template name="theme.html.css.core">
+  <xsl:param name="direction">
+    <xsl:call-template name="l10n.direction"/>
+  </xsl:param>
+  <xsl:param name="left">
+    <xsl:call-template name="l10n.align.start">
+      <xsl:with-param name="direction" select="$direction"/>
+    </xsl:call-template>
+  </xsl:param>
+  <xsl:param name="right">
+    <xsl:call-template name="l10n.align.end">
+      <xsl:with-param name="direction" select="$direction"/>
+    </xsl:call-template>
+  </xsl:param>
+  <xsl:text>
+html { height: 100%; }
+body {
+  margin: 0;
+  padding-top: 1em;
+  padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1em;
+  background-color: </xsl:text>
+    <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
+  direction: </xsl:text><xsl:value-of select="$direction"/><xsl:text>;
+  max-width: 73em;
+  position: relative;
+}
+div.body {
+  margin: 0;
+  padding: 1em;
+  max-width: 60em;
+  min-height: 20em;
+  background-color: </xsl:text>
+    <xsl:value-of select="$theme.color.background"/><xsl:text>;
+  border: solid 1px </xsl:text>
+    <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+}
+div.side {
+  margin: 0; padding: 0;
+  position: absolute;
+  </xsl:text><xsl:value-of select="$right"/><xsl:text>: 0;
+  width: 12em;
+}
+div.head {
+  max-width: 60em;
+}
+div.foot {
+  max-width: 60em;
+}
+div.side + div.body {
+  margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 13em;
+}
+div.side + div.body + div.foot {
+  margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 13em;
+}
+div.sect { margin-top: 1.72em; clear: both; }
+div.sect div.sect {
+  margin-top: 1.44em;
+  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.72em;
+}
+div.header {
+  margin: 0;
+  color: </xsl:text>
+    <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+  border-bottom: solid 1px </xsl:text>
+    <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+}
+h1, h2, h3, h4, h5, h6, h7 {
+  margin: 0; padding: 0;
+  color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+  font-weight: bold;
+}
+h1 { font-size: 1.44em; }
+h2 { font-size: 1.2em; }
+h3.title, h4.title, h5.title, h6.title, h7.title { font-size: 1.2em; }
+h3, h4, h5, h6, h7 { font-size: 1em; } 
+
+div, pre, p { margin: 1em 0 0 0; padding: 0; }
+div:first-child, pre:first-child, p:first-child { margin-top: 0; }
+div.inner, div.contents, pre.contents { margin-top: 0; }
+p img { vertical-align: middle; }
+
+ul, ol, dl { margin: 0; }
+li {
+  margin: 1em 0 0 0;
+  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 2.4em;
+  padding: 0;
+}
+li:first-child { margin-top: 0; }
+dt { margin-top: 1em; }
+dt:first-child { margin-top: 0; }
+dt + dt { margin-top: 0; }
+dd {
+  margin: 0.2em 0 0 0;
+  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.44em;
+}
+ol.compact li { margin-top: 0.2em; }
+ul.compact li { margin-top: 0.2em; }
+ol.compact li:first-child { margin-top: 0; }
+ul.compact li:first-child { margin-top: 0; }
+dl.compact dt { margin-top: 0.2em; }
+dl.compact dt:first-child { margin-top: 0; }
+dl.compact dt + dt { margin-top: 0; }
+
+a {
+  text-decoration: none;
+  color: </xsl:text><xsl:value-of select="$theme.color.link"/><xsl:text>;
+}
+a:visited { color: </xsl:text>
+  <xsl:value-of select="$theme.color.link_visited"/><xsl:text>; }
+a:hover { text-decoration: underline; }
+a img { border: none; }
+</xsl:text>
+</xsl:template>
+
+<xsl:template name="theme.html.css.elements">
+  <xsl:param name="direction">
+    <xsl:call-template name="l10n.direction"/>
+  </xsl:param>
+  <xsl:param name="left">
+    <xsl:call-template name="l10n.align.start">
+      <xsl:with-param name="direction" select="$direction"/>
+    </xsl:call-template>
+  </xsl:param>
+  <xsl:param name="right">
+    <xsl:call-template name="l10n.align.end">
+      <xsl:with-param name="direction" select="$direction"/>
+    </xsl:call-template>
+  </xsl:param>
+  <xsl:text>
+div.title {
+  margin: 0 0 0.2em 0;
+  font-weight: bold;
+  color: </xsl:text>
+    <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+}
+div.desc { margin: 0 0 0.2em 0; }
+div.contents + div.desc { margin: 0.2em 0 0 0; }
+pre.linenumbering {
+  margin: 0;
+  padding: 0.5em;
+  float: </xsl:text><xsl:value-of select="$left"/><xsl:text>;
+  margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 0.5em;
+  text-align: </xsl:text><xsl:value-of select="$right"/><xsl:text>;
+  color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+  background-color: </xsl:text>
+    <xsl:value-of select="$theme.color.yellow_background"/><xsl:text>;
+}
+pre.contents {
+  padding: 0.5em 1em 0.5em 1em;
+}
+div.code {
+  background: url('</xsl:text>
+    <xsl:value-of select="$theme.icons.watermark.code"/><xsl:text>') no-repeat top </xsl:text>
+    <xsl:value-of select="$right"/><xsl:text>;
+  border: solid 1px </xsl:text>
+    <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+}
+div.figure {
+  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.72em;
+  padding: 4px;
+  color: </xsl:text>
+    <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+  border: solid 1px </xsl:text>
+    <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+  background-color: </xsl:text>
+    <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
+}
+div.figure > div.inner > div.contents {
+  margin: 0;
+  padding: 0.5em 1em 0.5em 1em;
+  text-align: center;
+  color: </xsl:text>
+    <xsl:value-of select="$theme.color.text"/><xsl:text>;
+  border: solid 1px </xsl:text>
+    <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+  background-color: </xsl:text>
+    <xsl:value-of select="$theme.color.background"/><xsl:text>;
+}
+div.note {
+  padding: 6px;
+  border-top: solid 1px </xsl:text>
+    <xsl:value-of select="$theme.color.red_border"/><xsl:text>;
+  border-bottom: solid 1px </xsl:text>
+    <xsl:value-of select="$theme.color.red_border"/><xsl:text>;
+  background-color: </xsl:text>
+    <xsl:value-of select="$theme.color.yellow_background"/><xsl:text>;
+}
+div.note > div.inner > div.title {
+  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
+    <xsl:value-of select="$theme.icons.emblem.size + 6"/><xsl:text>px;
+}
+div.note > div.inner > div.contents {
+  margin: 0; padding: 0;
+  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
+    <xsl:value-of select="$theme.icons.emblem.size + 6"/><xsl:text>px;
+}
+div.note > div.inner {
+  margin: 0; padding: 0;
+  background-image: url("</xsl:text>
+    <xsl:value-of select="$theme.icons.emblem.note"/><xsl:text>");
+  background-position: </xsl:text><xsl:value-of select="$left"/><xsl:text> top;
+  background-repeat: no-repeat;
+  min-height: </xsl:text><xsl:value-of select="$theme.icons.emblem.size"/><xsl:text>px;
+}
+div.note-advanced div.inner { <!-- background-image: url("</xsl:text>
+  <xsl:value-of select="$theme.icons.emblem.note.advanced"/><xsl:text>"); --> }
+div.note-bug div.inner { background-image: url("</xsl:text>
+  <xsl:value-of select="$theme.icons.emblem.note.bug"/><xsl:text>"); }
+div.note-important div.inner { background-image: url("</xsl:text>
+  <xsl:value-of select="$theme.icons.emblem.note.important"/><xsl:text>"); }
+div.note-tip div.inner { background-image: url("</xsl:text>
+  <xsl:value-of select="$theme.icons.emblem.note.tip"/><xsl:text>"); }
+div.note-warning div.inner { background-image: url("</xsl:text>
+  <xsl:value-of select="$theme.icons.emblem.note.warning"/><xsl:text>"); }
+div.quote {
+  background-image: url('</xsl:text>
+    <xsl:value-of select="$theme.icons.watermark.quote"/><xsl:text>');
+  background-repeat: no-repeat;
+  background-position: top </xsl:text><xsl:value-of select="$left"/><xsl:text>;
+  padding: 0.5em;
+  min-height: </xsl:text>
+    <xsl:value-of select="$theme.icons.watermark.size"/><xsl:text>px;
+}
+div.quote > div.inner > div.title {
+  margin: 0 0 0.5em 0;
+  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
+    <xsl:value-of select="$theme.icons.watermark.size"/><xsl:text>px;
+}
+blockquote {
+  margin: 0; padding: 0;
+  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
+    <xsl:value-of select="$theme.icons.watermark.size"/><xsl:text>px;
+}
+div.quote > div.inner > div.cite {
+  margin-top: 0.5em;
+  margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: </xsl:text>
+    <xsl:value-of select="$theme.icons.watermark.size"/><xsl:text>px;
+  color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+}
+div.quote > div.inner > div.cite::before {
+  <!-- FIXME: i18n -->
+  content: '&#x2015; ';
+}
+pre.screen {
+  padding: 0.5em 1em 0.5em 1em;
+  background-color: </xsl:text>
+    <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
+  border: solid 2px </xsl:text>
+    <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
+}
+</xsl:text>
+</xsl:template>
+
+</xsl:stylesheet>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]