[yelp-xsl/wip/html5] Fixing up some CSS issues around DocBook list elements



commit 6ea158354083a0f2dbbd5d769b88ae48712fbb6e
Author: Shaun McCance <shaunm gnome org>
Date:   Sat Oct 22 12:27:15 2016 -0400

    Fixing up some CSS issues around DocBook list elements
    
    The recent box model and style overhaul requires div.contents for
    vertical spacing between blocks, but it wasn't being consistently
    used in DocBook list elements.

 xslt/common/html.xsl               |    1 -
 xslt/docbook/html/db2html-css.xsl  |    8 ++--
 xslt/docbook/html/db2html-list.xsl |   73 ++++++++++++++++++++++++-----------
 3 files changed, 54 insertions(+), 28 deletions(-)
---
diff --git a/xslt/common/html.xsl b/xslt/common/html.xsl
index 1a16366..7fd5e4a 100644
--- a/xslt/common/html.xsl
+++ b/xslt/common/html.xsl
@@ -1489,7 +1489,6 @@ div.screen {
     <xsl:value-of select="$color.gray"/><xsl:text>;
 }
 ol.steps, ul.steps {
-  margin: 0;
   padding: 0.5em 1em 0.5em 1em;
   border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: solid 4px </xsl:text>
     <xsl:value-of select="$color.yellow"/><xsl:text>;
diff --git a/xslt/docbook/html/db2html-css.xsl b/xslt/docbook/html/db2html-css.xsl
index 0503706..5351334 100644
--- a/xslt/docbook/html/db2html-css.xsl
+++ b/xslt/docbook/html/db2html-css.xsl
@@ -126,12 +126,10 @@ div.simplelist td {
   border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: solid 1px </xsl:text>
     <xsl:value-of select="$color.gray"/><xsl:text>;
 }
-<!--
-div.simplelist td.td-first {
+div.simplelist td:first-child {
   padding-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0;
   border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0;
 }
--->
 
 span.accel { text-decoration: underline; }
 span.email { font-family: monospace; }
@@ -159,6 +157,7 @@ dt.question {
   margin-left: 0;
   margin-right: 0;
   font-weight: bold;
+  color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>;
 }
 dd + dt.question { margin-top: 1em; }
 dd.answer {
@@ -167,10 +166,11 @@ dd.answer {
   margin-right: 2em;
 }
 div.qanda-label {
-  line-height: 1.72em;
+  line-height: 1.44em;
   float: </xsl:text><xsl:value-of select="$left"/><xsl:text>;
   margin-</xsl:text><xsl:value-of select="$right"/><xsl:text>: 1em;
   font-weight: bold;
+  color: </xsl:text><xsl:value-of select="$color.fg.dark"/><xsl:text>;
 }
 dl.qandaset ol, dl.qandaset ul, dl.qandaset table { clear: both; }
 
diff --git a/xslt/docbook/html/db2html-list.xsl b/xslt/docbook/html/db2html-list.xsl
index 5f3018e..753dc83 100644
--- a/xslt/docbook/html/db2html-list.xsl
+++ b/xslt/docbook/html/db2html-list.xsl
@@ -18,8 +18,9 @@ along with this program; see the file COPYING.LGPL.  If not, see <http://www.gnu
                 xmlns:db="http://docbook.org/ns/docbook";
                 xmlns:msg="http://projects.gnome.org/yelp/gettext/";
                 xmlns:str="http://exslt.org/strings";
+                xmlns:set="http://exslt.org/sets";
                 xmlns="http://www.w3.org/1999/xhtml";
-                exclude-result-prefixes="db msg str"
+                exclude-result-prefixes="db msg str set"
                 version="1.0">
 
 <!--!!==========================================================================
@@ -37,12 +38,14 @@ REMARK: Describe this module
   <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
   <xsl:if test="$if != ''">
   <div>
+    <xsl:variable name="title" select="title | blockinfo/title |
+                                       db:title | db:info/db:title"/>
     <xsl:call-template name="html.class.attr">
       <xsl:with-param name="class" select="'list glosslist'"/>
     </xsl:call-template>
     <xsl:call-template name="html.lang.attrs"/>
     <xsl:call-template name="db2html.anchor"/>
-    <xsl:apply-templates select="title | db:title | db:info/db:title"/>
+    <xsl:apply-templates select="$title[1]"/>
     <dl class="glosslist">
       <xsl:apply-templates select="glossentry | db:glossentry"/>
     </dl>
@@ -152,14 +155,19 @@ REMARK: Describe this module
   <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
   <xsl:if test="$if != ''">
   <div>
+    <xsl:variable name="title" select="title | blockinfo/title |
+                                       db:title | db:info/db:title"/>
+    <xsl:variable name="items" select="listitem | db:listitem"/>
     <xsl:call-template name="html.class.attr">
       <xsl:with-param name="class" select="'list itemizedlist'"/>
     </xsl:call-template>
     <xsl:call-template name="html.lang.attrs"/>
     <xsl:call-template name="db2html.anchor"/>
-    <xsl:apply-templates select="db:info/db:title"/>
-    <xsl:apply-templates select="*[not(self::listitem) and not(self::db:listitem)]"/>
-    <ul>
+    <div class="inner">
+      <xsl:apply-templates select="$title[1]"/>
+      <div class="region"><div class="contents">
+      <xsl:apply-templates select="*[not(set:has-same-node(., $title | $items))]"/>
+      <ul>
       <xsl:attribute name="class">
         <xsl:text>list itemizedlist</xsl:text>
         <xsl:if test="@spacing = 'compact'">
@@ -176,8 +184,10 @@ REMARK: Describe this module
           </xsl:choose>
         </xsl:attribute>
       </xsl:if>
-      <xsl:apply-templates select="listitem | db:listitem"/>
-    </ul>
+      <xsl:apply-templates select="$items"/>
+      </ul>
+      </div></div>
+    </div>
   </div>
   </xsl:if>
 </xsl:template>
@@ -227,14 +237,19 @@ REMARK: Describe this module
   </xsl:variable>
   <!-- FIXME: auto-numeration for nested lists -->
   <div>
+    <xsl:variable name="title" select="title | blockinfo/title |
+                                       db:title | db:info/db:title"/>
+    <xsl:variable name="items" select="listitem | db:listitem"/>
     <xsl:call-template name="html.class.attr">
       <xsl:with-param name="class" select="'list orderedlist'"/>
     </xsl:call-template>
     <xsl:call-template name="html.lang.attrs"/>
     <xsl:call-template name="db2html.anchor"/>
-    <xsl:apply-templates select="db:info/db:title"/>
-    <xsl:apply-templates select="*[not(self::listitem) and not(self::db:listitem)]"/>
-    <ol>
+    <div class="inner">
+      <xsl:apply-templates select="$title[1]"/>
+      <div class="region"><div class="contents">
+      <xsl:apply-templates select="*[not(set:has-same-node(., $title | $items))]"/>
+      <ol>
       <xsl:attribute name="class">
         <xsl:text>list orderedlist</xsl:text>
         <xsl:if test="@spacing = 'compact'">
@@ -260,7 +275,9 @@ REMARK: Describe this module
       </xsl:if>
       <!-- FIXME: @inheritnum -->
       <xsl:apply-templates select="listitem | db:listitem"/>
-    </ol>
+      </ol>
+      </div></div>
+    </div>
   </div>
   </xsl:if>
 </xsl:template>
@@ -290,27 +307,31 @@ REMARK: Describe this module
   <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
   <xsl:if test="$if != ''">
   <div>
+    <xsl:variable name="title" select="title | blockinfo/title |
+                                       db:title | db:info/db:title"/>
+    <xsl:variable name="steps" select="step | db:step"/>
     <xsl:call-template name="html.class.attr">
       <xsl:with-param name="class" select="'steps'"/>
     </xsl:call-template>
     <xsl:call-template name="html.lang.attrs"/>
     <xsl:call-template name="db2html.anchor"/>
     <div class="inner">
-    <xsl:apply-templates select="db:info/db:title"/>
-    <xsl:apply-templates select="*[not(self::step) and not(self::db:step)]"/>
+    <xsl:apply-templates select="$title[1]"/>
+    <div class="region"><div class="contents">
+    <xsl:apply-templates select="*[not(set:has-same-node(., $title | $steps))]"/>
     <xsl:choose>
-      <xsl:when test="(count(step) + count(db:step)) = 1">
+      <xsl:when test="count($steps) = 1">
         <ul class="steps">
-          <xsl:apply-templates select="step | db:step"/>
+          <xsl:apply-templates select="$steps"/>
         </ul>
       </xsl:when>
       <xsl:otherwise>
         <ol class="steps">
-          <xsl:apply-templates select="step | db:step"/>
+          <xsl:apply-templates select="$steps"/>
         </ol>
       </xsl:otherwise>
     </xsl:choose>
-    </div>
+    </div></div></div>
   </div>
   </xsl:if>
 </xsl:template>
@@ -617,17 +638,23 @@ REMARK: Describe this module
   <xsl:variable name="if"><xsl:call-template name="db.profile.test"/></xsl:variable>
   <xsl:if test="$if != ''">
   <div>
+    <xsl:variable name="title" select="title | blockinfo/title |
+                                       db:title | db:info/db:title"/>
+    <xsl:variable name="items" select="varlistentry | db:varlistentry"/>
     <xsl:call-template name="html.class.attr">
       <xsl:with-param name="class" select="'terms variablelist'"/>
     </xsl:call-template>
     <xsl:call-template name="html.lang.attrs"/>
     <xsl:call-template name="db2html.anchor"/>
-    <xsl:apply-templates select="db:info/db:title"/>
-    <xsl:apply-templates select="*[not(self::varlistentry) and
-                                   not(self::db:varlistentry)]"/>
-    <dl class="terms variablelist">
-      <xsl:apply-templates select="varlistentry |db:varlistentry"/>
-    </dl>
+    <div class="inner">
+      <xsl:apply-templates select="$title[1]"/>
+      <div class="region"><div class="contents">
+        <xsl:apply-templates select="*[not(set:has-same-node(., $title | $items))]"/>
+        <dl class="terms variablelist">
+          <xsl:apply-templates select="$items"/>
+        </dl>
+      </div></div>
+    </div>
   </div>
   </xsl:if>
 </xsl:template>


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