[yelp-xsl] [theme-html] Moving list styling to common CSS



commit b678631fa9f5c0bc4c64d629b9957d0176cb78d2
Author: Shaun McCance <shaunm gnome org>
Date:   Mon Mar 1 10:37:03 2010 -0600

    [theme-html] Moving list styling to common CSS

 xslt/docbook/html/db2html-css.xsl   |    3 --
 xslt/docbook/html/db2html-list.xsl  |   56 ++++++++++-------------------------
 xslt/mallard/html/mal2html-css.xsl  |   24 ---------------
 xslt/mallard/html/mal2html-list.xsl |   56 +++++++++++++++-------------------
 xslt/theme/theme-html.xsl           |   20 ++++++++++++-
 5 files changed, 60 insertions(+), 99 deletions(-)
---
diff --git a/xslt/docbook/html/db2html-css.xsl b/xslt/docbook/html/db2html-css.xsl
index 3ee65a8..10ba0a7 100644
--- a/xslt/docbook/html/db2html-css.xsl
+++ b/xslt/docbook/html/db2html-css.xsl
@@ -235,9 +235,6 @@ dl.indexdiv dt { margin-top: 0; }
 dl.indexdiv dd { margin-top: 0; margin-bottom: 0; }
 dl.setindex dt { margin-top: 0; }
 dl.setindex dd { margin-top: 0; margin-bottom: 0; }
-div.list div.title-formal span.title {
-  border-bottom: solid 1px </xsl:text><xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
-}
 div.simplelist {
   margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.72em;
 }
diff --git a/xslt/docbook/html/db2html-list.xsl b/xslt/docbook/html/db2html-list.xsl
index 85e203a..ac5a8bc 100644
--- a/xslt/docbook/html/db2html-list.xsl
+++ b/xslt/docbook/html/db2html-list.xsl
@@ -60,9 +60,9 @@ REMARK: Describe this module
     </xsl:if>
     <xsl:call-template name="db2html.anchor"/>
     <xsl:apply-templates select="*[not(self::listitem)]"/>
-    <ul class="itemizedlist">
+    <ul>
       <xsl:attribute name="class">
-        <xsl:text>itemizedlist</xsl:text>
+        <xsl:text>list itemizedlist</xsl:text>
         <xsl:if test="@spacing = 'compact'">
           <xsl:text> compact</xsl:text>
         </xsl:if>
@@ -84,7 +84,7 @@ REMARK: Describe this module
 
 <!-- = itemizedlist/listitem = -->
 <xsl:template match="itemizedlist/listitem">
-  <li>
+  <li class="list itemizedlist">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -134,9 +134,9 @@ REMARK: Describe this module
     </xsl:if>
     <xsl:call-template name="db2html.anchor"/>
     <xsl:apply-templates select="*[not(self::listitem)]"/>
-    <ol class="orderedlist">
+    <ol>
       <xsl:attribute name="class">
-        <xsl:text>orderedlist</xsl:text>
+        <xsl:text>list orderedlist</xsl:text>
         <xsl:if test="@spacing = 'compact'">
           <xsl:text> compact</xsl:text>
         </xsl:if>
@@ -166,7 +166,7 @@ REMARK: Describe this module
 
 <!-- = orderedlist/listitem = -->
 <xsl:template match="orderedlist/listitem">
-  <li>
+  <li class="list orderedlist">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -186,7 +186,7 @@ REMARK: Describe this module
 
 <!-- = procedure = -->
 <xsl:template match="procedure">
-  <div class="list procedure">
+  <div class="steps">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -198,12 +198,12 @@ REMARK: Describe this module
     <xsl:apply-templates select="*[not(self::step)]"/>
     <xsl:choose>
       <xsl:when test="count(step) = 1">
-        <ul class="procedure">
+        <ul class="steps">
           <xsl:apply-templates select="step"/>
         </ul>
       </xsl:when>
       <xsl:otherwise>
-        <ol class="procedure">
+        <ol class="steps">
           <xsl:apply-templates select="step"/>
         </ol>
       </xsl:otherwise>
@@ -393,7 +393,7 @@ REMARK: Describe this module
 <!-- FIXME: Do something with @performance -->
 <!-- = step = -->
 <xsl:template match="step">
-  <li>
+  <li class="steps">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -409,7 +409,7 @@ REMARK: Describe this module
 <!-- = substeps = -->
 <xsl:template match="substeps">
   <xsl:variable name="depth" select="count(ancestor::substeps)"/>
-  <div class="list substeps">
+  <div class="steps substeps">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -418,7 +418,7 @@ REMARK: Describe this module
       </xsl:attribute>
     </xsl:if>
     <xsl:call-template name="db2html.anchor"/>
-    <ol class="substeps">
+    <ol class="steps substeps">
       <xsl:attribute name="type">
         <xsl:choose>
           <xsl:when test="$depth mod 3 = 0">a</xsl:when>
@@ -433,7 +433,7 @@ REMARK: Describe this module
 
 <!-- = term = -->
 <xsl:template match="term">
-  <dt>
+  <dt class="terms">
     <xsl:choose>
       <xsl:when test="@lang">
         <xsl:attribute name="dir">
@@ -450,9 +450,6 @@ REMARK: Describe this module
         </xsl:attribute>
       </xsl:when>
     </xsl:choose>
-    <xsl:attribute name="class">
-      <xsl:text>term</xsl:text>
-    </xsl:attribute>
     <xsl:if test="../varlistentry/@id and not(preceding-sibling::term)">
       <xsl:call-template name="db2html.anchor">
         <xsl:with-param name="node" select=".."/>
@@ -464,7 +461,7 @@ REMARK: Describe this module
 
 <!-- = variablelist = -->
 <xsl:template match="variablelist">
-  <div class="list variablelist">
+  <div class="terms variablelist">
     <xsl:if test="@lang">
       <xsl:attribute name="dir">
         <xsl:call-template name="l10n.direction">
@@ -474,7 +471,7 @@ REMARK: Describe this module
     </xsl:if>
     <xsl:call-template name="db2html.anchor"/>
     <xsl:apply-templates select="*[not(self::varlistentry)]"/>
-    <dl class="variablelist">
+    <dl class="terms variablelist">
       <xsl:apply-templates select="varlistentry"/>
     </dl>
   </div>
@@ -488,7 +485,7 @@ REMARK: Describe this module
 
 <!-- = varlistentry/listitem = -->
 <xsl:template match="varlistentry/listitem">
-  <dd>
+  <dd class="terms">
     <xsl:choose>
       <xsl:when test="@lang">
         <xsl:attribute name="dir">
@@ -510,25 +507,4 @@ REMARK: Describe this module
   </dd>
 </xsl:template>
 
-
-<!--
-FIXME: are these still necessary with block-first?
-These templates strip the p tag around single-paragraph list items to avoid
-introducing extra spacing.  We don't do this for list items in varlistentry
-elements because it adds a non-negligable amount of processing time for
-non-trivial documents.
--->
-<xsl:template match="itemizedlist/listitem/para[
-              not(preceding-sibling::* or following-sibling::*)  and
-              not(../preceding-sibling::listitem[count(*) != 1]) and
-              not(../following-sibling::listitem[count(*) != 1]) ]">
-  <xsl:call-template name="db2html.inline"/>
-</xsl:template>
-<xsl:template match="orderedlist/listitem/para[
-              not(preceding-sibling::* or following-sibling::*)  and
-              not(../preceding-sibling::listitem[count(*) != 1]) and
-              not(../following-sibling::listitem[count(*) != 1]) ]">
-  <xsl:call-template name="db2html.inline"/>
-</xsl:template>
-
 </xsl:stylesheet>
diff --git a/xslt/mallard/html/mal2html-css.xsl b/xslt/mallard/html/mal2html-css.xsl
index 0416cdf..7a90293 100644
--- a/xslt/mallard/html/mal2html-css.xsl
+++ b/xslt/mallard/html/mal2html-css.xsl
@@ -197,30 +197,6 @@ div.cite-comment {
 }
 
 
-div.list-inner { margin: 0; padding: 0; }
-div.title-list { margin-bottom: 0.5em; }
-ol.list, ul.list { margin: 0; padding: 0; }
-
-div.steps-inner {
-  margin: 0;
-  padding: 0.5em 1em 0.5em 1em;
-  border-top: solid 2px;
-  border-bottom: solid 2px;
-  border-color: </xsl:text>
-    <xsl:value-of select="$theme.color.blue_border"/><xsl:text>;
-  background-color: </xsl:text>
-    <xsl:value-of select="$theme.color.yellow_background"/><xsl:text>;
-}
-div.steps-inner div.steps-inner {
-  padding: 0;
-  border: none;
-  background-color: none;
-}
-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-inner { margin: 0; }
-
 ul.tree {
   margin: 0; padding: 0;
   list-style-type: none;
diff --git a/xslt/mallard/html/mal2html-list.xsl b/xslt/mallard/html/mal2html-list.xsl
index 814b655..1c0de60 100644
--- a/xslt/mallard/html/mal2html-list.xsl
+++ b/xslt/mallard/html/mal2html-list.xsl
@@ -70,22 +70,20 @@ FIXME
   </xsl:variable>
   <div class="list">
     <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
-    <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">
-            <xsl:value-of select="concat('list-style-type:', @type)"/>
-          </xsl:attribute>
+    <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:apply-templates mode="mal2html.list.list.mode" select="mal:item"/>
-      </xsl:element>
-    </div>
+      </xsl:attribute>
+      <xsl:if test="@type">
+        <xsl:attribute name="style">
+          <xsl:value-of select="concat('list-style-type:', @type)"/>
+        </xsl:attribute>
+      </xsl:if>
+      <xsl:apply-templates mode="mal2html.list.list.mode" select="mal:item"/>
+    </xsl:element>
   </div>
 </xsl:template>
 
@@ -100,11 +98,9 @@ FIXME
 <xsl:template mode="mal2html.block.mode" match="mal:steps">
   <div class="steps">
     <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
-    <div class="steps-inner">
-      <ol class="steps">
-        <xsl:apply-templates mode="mal2html.list.steps.mode" select="mal:item"/>
-      </ol>
-    </div>
+    <ol class="steps">
+      <xsl:apply-templates mode="mal2html.list.steps.mode" select="mal:item"/>
+    </ol>
   </div>
 </xsl:template>
 
@@ -120,17 +116,15 @@ FIXME
   <xsl:variable name="style" select="concat(' ', @style, ' ')"/>
   <div class="terms">
     <xsl:apply-templates mode="mal2html.block.mode" select="mal:title"/>
-    <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>
+    <dl class="terms">
+      <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>
 </xsl:template>
 
diff --git a/xslt/theme/theme-html.xsl b/xslt/theme/theme-html.xsl
index 022531a..b92b646 100644
--- a/xslt/theme/theme-html.xsl
+++ b/xslt/theme/theme-html.xsl
@@ -147,7 +147,7 @@ td, th {
   border-width: 1px;
 }
 
-ul, ol, dl { margin: 0; }
+ul, ol, dl { margin: 0; padding: 0; }
 li {
   margin: 1em 0 0 0;
   margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 2.4em;
@@ -244,6 +244,7 @@ div.figure > div.inner > div.contents {
   background-color: </xsl:text>
     <xsl:value-of select="$theme.color.background"/><xsl:text>;
 }
+div.list > div.title { margin-bottom: 0.5em; }
 div.listing > div.inner { margin: 0; padding: 0; }
 div.listing > div.inner > div.desc { font-style: italic; }
 div.note {
@@ -317,6 +318,23 @@ div.screen {
   border: solid 1px </xsl:text>
     <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
 }
+ol.steps, ul.steps {
+  margin: 0;
+  padding: 0.5em 1em 0.5em 1em;
+  border-top: solid 1px;
+  border-bottom: solid 1px;
+  border-color: </xsl:text>
+    <xsl:value-of select="$theme.color.blue_border"/><xsl:text>;
+  background-color: </xsl:text>
+    <xsl:value-of select="$theme.color.yellow_background"/><xsl:text>;
+}
+ol.steps .steps {
+  padding: 0;
+  border: none;
+  background-color: none;
+}
+li.steps { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 1.44em; }
+li.steps li.steps { margin-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 2.4em; }
 div.synopsis {
   padding: 0.5em 1em 0.5em 1em;
   border-top: solid 1px;



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