[yelp-xsl] [theme-html] Adding more block elements to common HTML CSS



commit c75ff89d62e6bc9352766a8bcda4708b0ae50266
Author: Shaun McCance <shaunm gnome org>
Date:   Sun Feb 28 23:44:26 2010 -0600

    [theme-html] Adding more block elements to common HTML CSS

 xslt/docbook/html/db2html-classsynopsis.xsl |    5 +-
 xslt/docbook/html/db2html-cmdsynopsis.xsl   |    4 +-
 xslt/docbook/html/db2html-css.xsl           |   32 +-----------
 xslt/docbook/html/db2html-table.xsl         |    2 +-
 xslt/mallard/html/mal2html-css.xsl          |   41 ---------------
 xslt/mallard/html/mal2html-table.xsl        |   72 +++++++++++++--------------
 xslt/theme/theme-colors.xsl                 |    2 +-
 xslt/theme/theme-html.xsl                   |   72 ++++++++++++++++++++++++--
 8 files changed, 109 insertions(+), 121 deletions(-)
---
diff --git a/xslt/docbook/html/db2html-classsynopsis.xsl b/xslt/docbook/html/db2html-classsynopsis.xsl
index de2b317..96975a2 100644
--- a/xslt/docbook/html/db2html-classsynopsis.xsl
+++ b/xslt/docbook/html/db2html-classsynopsis.xsl
@@ -84,12 +84,11 @@ REMARK: Describe this param
       </xsl:otherwise>
     </xsl:choose>
     <xsl:attribute name="class">
-      <xsl:text>block synopsis </xsl:text>
+      <xsl:text>synopsis </xsl:text>
       <xsl:value-of select="local-name(.)"/>
-      <xsl:value-of select="concat(' watermark-code-', $language)"/>
     </xsl:attribute>
     <xsl:call-template name="db2html.anchor"/>
-    <pre class="{local-name(.)} classsynopsis-{$language}">
+    <pre class="contents {local-name(.)} classsynopsis-{$language}">
       <xsl:choose>
         <xsl:when test="$language = 'cpp'">
           <xsl:apply-templates mode="db2html.class.cpp.mode" select="."/>
diff --git a/xslt/docbook/html/db2html-cmdsynopsis.xsl b/xslt/docbook/html/db2html-cmdsynopsis.xsl
index 7e75279..aee886c 100644
--- a/xslt/docbook/html/db2html-cmdsynopsis.xsl
+++ b/xslt/docbook/html/db2html-cmdsynopsis.xsl
@@ -175,10 +175,10 @@ REMARK: Describe this param
       </xsl:otherwise>
     </xsl:choose>
     <xsl:attribute name="class">
-      <xsl:text>synopsis cmdsynopsis block</xsl:text>
+      <xsl:text>synopsis cmdsynopsis</xsl:text>
     </xsl:attribute>
     <xsl:call-template name="db2html.anchor"/>
-    <pre class="cmdsynopsis">
+    <pre class="contents cmdsynopsis">
       <xsl:for-each select="command | arg | group | sbr">
         <xsl:choose>
           <xsl:when test="position() = 1"/>
diff --git a/xslt/docbook/html/db2html-css.xsl b/xslt/docbook/html/db2html-css.xsl
index 0f3176d..3ee65a8 100644
--- a/xslt/docbook/html/db2html-css.xsl
+++ b/xslt/docbook/html/db2html-css.xsl
@@ -102,14 +102,9 @@ sub { font-size: 0.83em; }
 sub sub { font-size: 1em; }
 sup { font-size: 0.83em; }
 sup sup { font-size: 1em; }
-table { border-collapse: collapse; }
 table.table-pgwide { width: 100%; }
-td { vertical-align: top; }
-td { padding: 0.2em 0.83em 0.2em 0.83em; }
-th { padding: 0 0.83em 0 0.83em; }
-tr.tr-shade {
-  background-color: </xsl:text><xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
-}
+
+
 td.td-colsep { border-</xsl:text><xsl:value-of select="$right"/><xsl:text>: solid 1px; }
 td.td-rowsep { border-bottom: solid 1px; }
 thead { border-top: solid 2px; border-bottom: solid 2px; }
@@ -227,13 +222,6 @@ div.epigraph {
   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.screen .prompt {
-  color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-}
-div.screen .userinput {
-  font-weight: bold;
-  color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-}
 div.programlisting .userinput {
   font-weight: bold;
   color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
@@ -265,22 +253,6 @@ div.simplelist td.td-first {
   border-</xsl:text><xsl:value-of select="$left"/><xsl:text>: 0;
 }
 */
-div.synopsis {
-  padding: 0.5em;
-  <!-- FIXME: watermarks -->
-  background-color: </xsl:text><xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
-  border-top: solid 2px </xsl:text><xsl:value-of select="$theme.color.blue_border"/><xsl:text>;
-  border-bottom: solid 2px </xsl:text><xsl:value-of select="$theme.color.blue_border"/><xsl:text>;
-}
-div.synopsis div.synopsis {
-  padding: 0;
-  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; }
 span.acronym { font-family: sans-serif; }
diff --git a/xslt/docbook/html/db2html-table.xsl b/xslt/docbook/html/db2html-table.xsl
index 7eb8304..2ecbeda 100644
--- a/xslt/docbook/html/db2html-table.xsl
+++ b/xslt/docbook/html/db2html-table.xsl
@@ -50,7 +50,7 @@ FIXME
   <tr>
     <xsl:if test="$row/../self::tbody and (count($row/preceding-sibling::row) mod 2 = 1)">
       <xsl:attribute name="class">
-        <xsl:text>tr-shade</xsl:text>
+        <xsl:text>shade</xsl:text>
       </xsl:attribute>
     </xsl:if>
     <xsl:if test="$row/*[1]">
diff --git a/xslt/mallard/html/mal2html-css.xsl b/xslt/mallard/html/mal2html-css.xsl
index c0a1e9c..0416cdf 100644
--- a/xslt/mallard/html/mal2html-css.xsl
+++ b/xslt/mallard/html/mal2html-css.xsl
@@ -132,8 +132,6 @@ div.copyrights {
     <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
 }
 
-table { border-collapse: collapse; }
-
 div.autolinks ul { margin: 0; padding: 0; }
 div.autolinks div.title { margin: 1em 0 0 1em; }
 div.autolinks div.title span {
@@ -186,36 +184,18 @@ div.linkdivsep {
     <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
 }
 
-div.desc-listing, div.desc-synopsis { font-style: italic; }
 
 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.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.synopsis-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.gray_background"/><xsl:text>;
-}
-div.synopsis div.code {
-  background: none;
-  border: none;
-  padding: 0;
-}
-div.synopsis div.code > pre.contents { margin: 0; padding: 0; }
 
 div.list-inner { margin: 0; padding: 0; }
 div.title-list { margin-bottom: 0.5em; }
@@ -250,18 +230,6 @@ 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; }
 
-table.table {
-  border-collapse: collapse;
-  border-color: #555753;
-  border-width: 1px;
-}
-table.table td {
-  padding: 0.1em 0.5em 0.1em 0.5em;
-  border-color: #888a85;
-  border-width: 1px;
-  vertical-align: top;
-}
-
 span.app { font-style: italic; }
 span.cmd {
   font-family: monospace;
@@ -292,15 +260,6 @@ span.keyseq {
     <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
 }
 span.output { font-family: monospace; }
-pre.screen span.output {
-  color: </xsl:text>
-    <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
-}
-pre.screen span.output-error {
-<!-- FIXME: theme -->
-  color: #ff0000;
-}
-pre.screen span.output-prompt { font-weight: bold; }
 span.sys { font-family: monospace; }
 span.var { font-style: italic; }
 </xsl:text>
diff --git a/xslt/mallard/html/mal2html-table.xsl b/xslt/mallard/html/mal2html-table.xsl
index dfe4b4c..2c6ec82 100644
--- a/xslt/mallard/html/mal2html-table.xsl
+++ b/xslt/mallard/html/mal2html-table.xsl
@@ -285,7 +285,37 @@ REMARK: Describe this module
       </xsl:if>
     </xsl:for-each>
   </xsl:param>
+  <xsl:variable name="trpos" select="count(preceding-sibling::mal:tr) + 1"/>
+  <xsl:variable name="shaderow">
+    <xsl:choose>
+      <xsl:when test="$rowshade = 'all'">
+        <xsl:choose>
+          <xsl:when test="../self::mal:table">
+            <xsl:value-of select="($trpos + 1) mod 2"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:variable name="bodies"
+                          select="../preceding-sibling::mal:tbody |
+                                  ../preceding-sibling::mal:thead "/>
+            <xsl:variable name="trcount" select="count($bodies/mal:tr) + $trpos"/>
+            <xsl:value-of select="($trcount + 1) mod 2"/>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:when test="$rowshade = 'groups'">
+        <xsl:variable name="bodies"
+                      select="../preceding-sibling::mal:tbody |
+                              ../preceding-sibling::mal:thead "/>
+        <xsl:value-of select="count($bodies) mod 2"/>
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
   <tr>
+    <xsl:if test="$shaderow = 1">
+      <xsl:attribute name="class">
+        <xsl:text>shade</xsl:text>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:apply-templates select="mal:td">
       <xsl:with-param name="cols" select="$cols"/>
       <xsl:with-param name="rowrules" select="$rowrules"/>
@@ -395,31 +425,6 @@ REMARK: Describe this module
     </xsl:for-each>
   </xsl:variable>
   <xsl:variable name="tdpos" select="string-length($tdstr) + 1"/>
-  <!-- FIXME: this all breaks with rowspan/colspan -->
-  <xsl:variable name="shaderow">
-    <xsl:choose>
-      <xsl:when test="$rowshade = 'all'">
-        <xsl:choose>
-          <xsl:when test="../../self::mal:table">
-            <xsl:value-of select="($trpos + 1) mod 2"/>
-          </xsl:when>
-          <xsl:otherwise>
-            <xsl:variable name="bodies"
-                          select="../../preceding-sibling::mal:tbody |
-                                  ../../preceding-sibling::mal:thead "/>
-            <xsl:variable name="trcount" select="count($bodies/mal:tr) + $trpos"/>
-            <xsl:value-of select="($trcount + 1) mod 2"/>
-          </xsl:otherwise>
-        </xsl:choose>
-      </xsl:when>
-      <xsl:when test="$rowshade = 'groups'">
-        <xsl:variable name="bodies"
-                      select="../../preceding-sibling::mal:tbody |
-                              ../../preceding-sibling::mal:thead "/>
-        <xsl:value-of select="count($bodies) mod 2"/>
-      </xsl:when>
-    </xsl:choose>
-  </xsl:variable>
   <xsl:variable name="shadecol">
     <xsl:choose>
       <xsl:when test="$colshade = 'all'">
@@ -483,20 +488,13 @@ REMARK: Describe this module
         </xsl:if>
       </xsl:when>
     </xsl:choose>
-    <xsl:choose>
-      <xsl:when test="$shaderow = 1 and $shadecol = 1">
-        <xsl:text>background-color: </xsl:text>
-        <xsl:value-of select="$theme.color.dark_background"/>
-        <xsl:text>;</xsl:text>
-      </xsl:when>
-      <xsl:when test="$shaderow = 1 or $shadecol = 1">
-        <xsl:text>background-color: </xsl:text>
-        <xsl:value-of select="$theme.color.gray_background"/>
-        <xsl:text>;</xsl:text>
-      </xsl:when>
-    </xsl:choose>
   </xsl:variable>
   <td>
+    <xsl:if test="$shadecol = 1">
+      <xsl:attribute name="class">
+        <xsl:text>shade</xsl:text>
+      </xsl:attribute>
+    </xsl:if>
     <xsl:if test="$style != ''">
       <xsl:attribute name="style">
         <xsl:value-of select="$style"/>
diff --git a/xslt/theme/theme-colors.xsl b/xslt/theme/theme-colors.xsl
index d647dd2..d333378 100644
--- a/xslt/theme/theme-colors.xsl
+++ b/xslt/theme/theme-colors.xsl
@@ -131,7 +131,7 @@ This parameter specifies the dark gray background color.  The dark
 gray background color may be used by certain types of block elements.
 Foreground colors should be legible on this color.
 -->
-<xsl:param name="theme.color.dark_background" select="'#eeeeec'"/>
+<xsl:param name="theme.color.dark_background" select="'#e5e5e3'"/>
 
 <!--@@==========================================================================
 theme.color.gray_border
diff --git a/xslt/theme/theme-html.xsl b/xslt/theme/theme-html.xsl
index d3d2cae..022531a 100644
--- a/xslt/theme/theme-html.xsl
+++ b/xslt/theme/theme-html.xsl
@@ -135,6 +135,18 @@ 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; }
 
+table {
+  border-collapse: collapse;
+  border-color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+  border-width: 1px;
+}
+td, th {
+  padding: 0.1em 0.5em 0.1em 0.5em;
+  vertical-align: top;
+  border-color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+  border-width: 1px;
+}
+
 ul, ol, dl { margin: 0; }
 li {
   margin: 1em 0 0 0;
@@ -191,6 +203,9 @@ div.title {
 }
 div.desc { margin: 0 0 0.2em 0; }
 div.contents + div.desc { margin: 0.2em 0 0 0; }
+pre.contents {
+  padding: 0.5em 1em 0.5em 1em;
+}
 pre.linenumbering {
   margin: 0;
   padding: 0.5em;
@@ -201,9 +216,6 @@ pre.linenumbering {
   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>
@@ -232,6 +244,8 @@ div.figure > div.inner > div.contents {
   background-color: </xsl:text>
     <xsl:value-of select="$theme.color.background"/><xsl:text>;
 }
+div.listing > div.inner { margin: 0; padding: 0; }
+div.listing > div.inner > div.desc { font-style: italic; }
 div.note {
   padding: 6px;
   border-top: solid 1px </xsl:text>
@@ -297,13 +311,59 @@ div.quote > div.inner > div.cite::before {
   <!-- FIXME: i18n -->
   content: '&#x2015; ';
 }
-pre.screen {
-  padding: 0.5em 1em 0.5em 1em;
+div.screen {
   background-color: </xsl:text>
     <xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
-  border: solid 2px </xsl:text>
+  border: solid 1px </xsl:text>
     <xsl:value-of select="$theme.color.gray_border"/><xsl:text>;
 }
+div.synopsis {
+  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.gray_background"/><xsl:text>;
+}
+div.synopsis > pre.contents { margin: 0; padding: 0; }
+div.synopsis > div.inner > div.desc { font-style: italic; }
+div.synopsis div.code {
+  background: none;
+  border: none;
+  padding: 0;
+}
+div.synopsis div.code > pre.contents { margin: 0; padding: 0; }
+.table {}
+tr.shade {
+  background-color: </xsl:text><xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
+}
+td.shade {
+  background-color: </xsl:text><xsl:value-of select="$theme.color.gray_background"/><xsl:text>;
+}
+tr.shade td.shade {
+  background-color: </xsl:text><xsl:value-of select="$theme.color.dark_background"/><xsl:text>;
+}
+
+
+/* FIXME */
+div.screen .prompt {
+  color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+}
+div.screen .userinput {
+  font-weight: bold;
+  color: </xsl:text><xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+}
+pre.screen span.output {
+  color: </xsl:text>
+    <xsl:value-of select="$theme.color.text_light"/><xsl:text>;
+}
+pre.screen span.output-error {
+<!-- FIXME: theme -->
+  color: #ff0000;
+}
+pre.screen span.output-prompt { font-weight: bold; }
+
 </xsl:text>
 </xsl:template>
 



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