Changeset 44850bb


Ignore:
Timestamp:
01/26/2024 01:55:51 PM (4 months ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
12.1, 12.1-rc1, multilib, trunk, xry111/arm64, xry111/clfs-ng, xry111/loongarch, xry111/loongarch-12.1, xry111/mips64el, xry111/update-glibc
Children:
360fdfca
Parents:
ea93c11
git-author:
Pierre Labastie <pierre.labastie@…> (01/26/2024 01:53:30 PM)
git-committer:
Pierre Labastie <pierre.labastie@…> (01/26/2024 01:55:51 PM)
Message:

Fix some defects of lfs book formatting

  • have title of section stay visible when scrolling
  • when clicking on an internal link, make it fully visible instead of hidden behind the header
Location:
stylesheets/lfs-xsl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • stylesheets/lfs-xsl/lfs.css

    rea93c11 r44850bb  
    11/* Global settings */
    22body {
    3   font-family: verdana, tahoma, helvetica, arial, sans-serif;
     3  font-family: verdana, tahoma, arial, sans-serif;
    44  text-align: left;
    55  background: #fff;
     
    88  padding: 0;
    99  font-size: 1em;
    10   line-height: 1.2em
     10  line-height: 1.2em;
    1111}
    1212
     
    3939}
    4040
    41 
    42 /* Sections */
    43 div.sect1, div.appendix {
    44   padding-left: .3em;
     41/* Section titles */
     42h1.sect1, h1.preface, h1.part, h1.chapter, h1.appendix, .glossary h1, .index h1
     43 {
     44  background: #f5f6f7;
     45  border-bottom: .1em solid #dbddec;
     46  margin-bottom:1em;
     47  margin-top: 0;
     48  padding: .4em;
     49}
     50
     51/* Scrolling parts
     52   The header is taller for sect1 and chapter pages than on the
     53   other pages.  Since we want fixed boxes, their top has to be calculated
     54   by trial and errors to fit below the static header box.*/
     55
     56div.sect1, div.chapter, div.appendix, div.wrap {
     57  top: 11.55em;
     58}
     59div.preface, div.part, .index div.index {
     60  top: 10.15em;
     61}
     62div.sect1, div.appendix, div.preface, div.part, div.chapter, div.wrap, .index div.index {
     63/*  padding-left: .3em;*/
     64  overflow:auto;
     65  height: auto;
     66  position: fixed;
     67  left:1em;
     68  right:1em;
     69  bottom: 1em;
     70  border-bottom: 1em solid #dbddec;
    4571}
    4672
     
    6490  border-bottom: 0.2em solid #dbddec;
    6591  padding-top: .1em;
     92/*  margin-top: 0;*/
     93}
     94/*
     95.lfs .package p:first-child {
    6696  margin-top: 0;
    67 }
     97}*/
    6898
    6999.lfs .configuration {
     
    75105  background: #f5f6f7;
    76106  border-top: 0.2em solid #dbddec;
     107  border-bottom: 0.2em solid #dbddec;
    77108  padding-bottom: .1em;
    78   margin-bottom: 0;
    79 }
    80 
     109  margin-bottom: .5em;
     110}
    81111
    82112/* Headers */
     
    97127}
    98128
    99 .preface h1, .part h1, .chapter h1, .appendix h1, .index h1, .sect1 h1, .glossary h1 {
    100   background: #f5f6f7;
    101   border-bottom: .1em solid #dbddec;
    102   margin-bottom: 1em;
    103   margin-top: 0;
    104   padding: .4em;
    105 }
    106 
    107 .sect1 h1, .appendix h1 {
    108   margin-left: -.2em;
    109 }
    110 
    111129.wrap h1 {
    112130  background: #f5f6f7;
     
    158176
    159177div.navheader {
    160   border-bottom: 1px solid #dbddec;
    161    position: sticky;
    162    top: 0;
    163 }
    164 
     178  border-bottom: .1em solid #dbddec;
     179}
     180
     181/* no need for a footer now that the header is always visible */
    165182div.navfooter {
    166   border-top: 1px solid #dbddec;
     183  display:none;
     184}
     185
     186/* Except for the first page (TOC), where the bottom is the only
     187   place where navigation is displayed. */
     188
     189div.book + div.navfooter {
     190  display:block
    167191}
    168192
     
    180204
    181205div.navheader ul, div.navfooter ul {
    182   padding: .2em .5em .5em 0;
     206  padding: .2em .5em .5em .5em; /*top right bottom left*/
    183207  margin: .5em 0;
    184208  position: relative;
     
    197221  text-align: left;
    198222  padding: 0.2em 1em;
    199   margin-left: 6px;
     223  margin-left: .4em;
    200224}
    201225
     
    204228  display: block;
    205229  text-align: right;
    206   right: 5px;
    207   padding: 0.2em 0.5em;
    208   margin-right: 7px;
     230  right: 0;
     231  padding: 0.2em 1em;
     232  margin-right: .4em;
    209233}
    210234
     
    212236div.navheader ul li.next p, div.navfooter ul li.next p {
    213237  padding: 0;
    214   margin: 1px 0px;
     238  margin: .1em 0;
    215239}
    216240
     
    219243  text-align: center;
    220244  padding: 0;
    221   margin: 0px auto;
     245  margin: 0 auto;
    222246  display: block;
    223247  color: #dbddec;
  • stylesheets/lfs-xsl/xhtml/lfs-sections.xsl

    rea93c11 r44850bb  
    1212
    1313    <!-- preface:
    14            Output non sect1 child elements before the TOC -->
     14         Output non sect1 child elements before the TOC
     15         Output title outside of the <div> because we want to be able to
     16         use it at a fixed position -->
    1517    <!-- The original template is in {docbook-xsl}/xhtml/components.xsl -->
    1618  <xsl:template match="preface">
    1719    <xsl:call-template name="id.warning"/>
     20    <xsl:call-template name="preface.titlepage"/>
     21    <xsl:call-template name="component.separator"/>
    1822    <div>
    1923      <xsl:apply-templates select="." mode="class.attribute"/>
     
    2731        </xsl:attribute>
    2832      </xsl:if>
    29       <xsl:call-template name="component.separator"/>
    30       <xsl:call-template name="preface.titlepage"/>
    3133      <xsl:apply-templates/>
    3234      <xsl:variable name="toc.params">
     
    4547  </xsl:template>
    4648
     49    <!-- part:
     50         Output non sect1 child elements before the TOC
     51         Output title outside of the <div> because we want to be able to
     52         use it at a fixed position -->
     53    <!-- The original template is in {docbook-xsl}/xhtml/divisions.xsl -->
     54  <xsl:template match="part">
     55    <xsl:call-template name="id.warning"/>
     56
     57    <xsl:call-template name="part.titlepage"/>
     58
     59    <div>
     60      <xsl:apply-templates select="." mode="common.html.attributes"/>
     61      <xsl:call-template name="id.attribute">
     62        <xsl:with-param name="conditional" select="0"/>
     63      </xsl:call-template>
     64
     65      <xsl:apply-templates/>
     66      <xsl:variable name="toc.params">
     67        <xsl:call-template name="find.path.params">
     68          <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
     69        </xsl:call-template>
     70      </xsl:variable>
     71      <xsl:if test="not(partintro) and contains($toc.params, 'toc')">
     72        <xsl:call-template name="division.toc"/>
     73      </xsl:if>
     74    </div>
     75  </xsl:template>
     76
    4777    <!-- chapter:
    48            Output non sect1 child elements before the TOC -->
     78           Output non sect1 child elements before the TOC
     79           Output title before div to be able to fix the title position -->
    4980    <!-- The original template is in {docbook-xsl}/xhtml/components.xsl -->
    5081  <xsl:template match="chapter">
    5182    <xsl:call-template name="id.warning"/>
     83    <xsl:call-template name="chapter.titlepage"/>
     84    <xsl:call-template name="component.separator"/>
    5285    <div>
    5386      <xsl:apply-templates select="." mode="class.attribute"/>
     
    6194        </xsl:attribute>
    6295      </xsl:if>
    63       <xsl:call-template name="component.separator"/>
    64       <xsl:call-template name="chapter.titlepage"/>
    6596      <xsl:apply-templates/>
    6697      <xsl:variable name="toc.params">
     
    79110  </xsl:template>
    80111
     112    <!-- appendix:
     113           Output non sect1 child elements before the TOC
     114           Output title before div to be able to fix the title position -->
     115    <!-- The original template is in {docbook-xsl}/xhtml/components.xsl -->
     116  <xsl:template match="appendix">
     117
     118    <xsl:call-template name="id.warning"/>
     119
     120    <xsl:call-template name="appendix.titlepage"/>
     121
     122    <xsl:element name="div" namespace="http://www.w3.org/1999/xhtml">
     123      <xsl:call-template name="common.html.attributes">
     124        <xsl:with-param name="inherit" select="1"/>
     125      </xsl:call-template>
     126      <xsl:call-template name="id.attribute">
     127        <xsl:with-param name="conditional" select="0"/>
     128      </xsl:call-template>
     129
     130      <xsl:apply-templates/>
     131
     132      <xsl:variable name="toc.params">
     133        <xsl:call-template name="find.path.params">
     134          <xsl:with-param name="table" select="normalize-space($generate.toc)"/>
     135        </xsl:call-template>
     136      </xsl:variable>
     137
     138      <xsl:if test="contains($toc.params, 'toc')">
     139        <xsl:call-template name="component.toc">
     140          <xsl:with-param name="toc.title.p" select="contains($toc.params, 'title')"/>
     141        </xsl:call-template>
     142      </xsl:if>
     143
     144    </xsl:element>
     145  </xsl:template>
     146
    81147    <!-- sect1:
    82148           When there is a role attibute, use it as the class value.
    83149           Process the SVN keywords found in sect1info as a footnote.
     150           Output title before the containing <div> so that the title
     151           can be at a fixed position.
    84152           Removed unused code. -->
    85153    <!-- The original template is in {docbook-xsl}/xhtml/sections.xsl -->
    86154  <xsl:template match="sect1">
     155    <xsl:call-template name="sect1.titlepage"/>
    87156    <div>
    88157      <xsl:choose>
     
    97166      </xsl:choose>
    98167      <xsl:call-template name="language.attribute"/>
    99       <xsl:call-template name="sect1.titlepage"/>
    100168      <xsl:apply-templates/>
    101169      <xsl:apply-templates select="sect1info" mode="svn-keys"/>
Note: See TracChangeset for help on using the changeset viewer.