Skip to content

Commit

Permalink
Center site header content in wide mode (xPathr)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilshoerrmann committed Dec 17, 2012
1 parent 91834fe commit d6b086f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 24 deletions.
8 changes: 8 additions & 0 deletions css/factory.css
Original file line number Diff line number Diff line change
Expand Up @@ -1435,6 +1435,14 @@ pre[data-line] {
right: 0;
}

#site .site-header .centered {

/* Wide layouts with centered site header (like xPathr) */
padding: 0 30px;
box-sizing: border-box;
-moz-box-sizing: border-box;
}

#site .site-header h1 {
background: url(../img/logo.png) -1px 0 no-repeat;
float: left;
Expand Down
58 changes: 34 additions & 24 deletions docs/factory/docs.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -39,30 +39,20 @@
<div id="site">

<!-- Current header -->
<header>
<xsl:attribute name="class">
<xsl:choose>
<xsl:when test="data/title = 'xPathr'">site-header wide</xsl:when>
<xsl:otherwise>site-header centered</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<h1>
<span>Symphony</span>
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="data/title/@mode = 'push'">
<xsl:value-of select="data/title" />
</xsl:when>
<xsl:when test="data/title/@mode = 'empty'"></xsl:when>
<xsl:otherwise>Factory</xsl:otherwise>
</xsl:choose>
</h1>
<nav>
<xsl:apply-templates select="document('navigation.xml')/data/nav">
<xsl:with-param name="title" select="data/title/@id | data/title" />
</xsl:apply-templates>
</nav>
</header>
<xsl:choose>
<xsl:when test="data/title = 'xPathr'">
<header class="site-header wide">
<div class="centered">
<xsl:call-template name="site-header" />
</div>
</header>
</xsl:when>
<xsl:otherwise>
<header class="site-header centered">
<xsl:call-template name="site-header" />
</header>
</xsl:otherwise>
</xsl:choose>

<!-- Content -->
<xsl:apply-templates select="data/content/*" mode="ninja" />
Expand Down Expand Up @@ -90,4 +80,24 @@
</a>
</xsl:template>

<!-- Site header -->
<xsl:template name="site-header">
<h1>
<span>Symphony</span>
<xsl:text> </xsl:text>
<xsl:choose>
<xsl:when test="data/title/@mode = 'push'">
<xsl:value-of select="data/title" />
</xsl:when>
<xsl:when test="data/title/@mode = 'empty'"></xsl:when>
<xsl:otherwise>Factory</xsl:otherwise>
</xsl:choose>
</h1>
<nav>
<xsl:apply-templates select="document('navigation.xml')/data/nav">
<xsl:with-param name="title" select="data/title/@id | data/title" />
</xsl:apply-templates>
</nav>
</xsl:template>

</xsl:stylesheet>

0 comments on commit d6b086f

Please sign in to comment.