Update CSS to dynamically color alternate home sections

This commit is contained in:
George Cushen 2016-05-09 20:45:35 +01:00
commit 6a91758b80
2 changed files with 8 additions and 5 deletions

View file

@ -9,7 +9,7 @@
<!-- Biography Section -->
{{ range $index, $page := where .Site.Pages "Section" "=" "home" }}
{{ if eq .Title "about" }}
<section id="bio" class="home-section-wrapper full_width home alt" style="padding-top: 0;">
<section id="bio" class="home-section-wrapper full_width home" style="padding-top: 0;">
{{ partial "home_biography" . }}
</section>
{{ end }}
@ -39,7 +39,7 @@
<!-- Blog Posts Section -->
<section id="posts" class="home-section-wrapper full_width home alt">
<section id="posts" class="home-section-wrapper full_width home">
<div class="row">
<div class="col-xs-12 col-md-4">
<h2>Posts</h2>
@ -93,7 +93,7 @@
{{ range $index, $page := where .Site.Pages "Section" "=" "home" }}
{{ if and (isset .Params "section_id") (not (eq .Params.section_id 0)) }}
{{ $title_words := split $page.Title " " }}
<section id="{{ range $k, $v := $title_words }}{{ if eq $k 0 }}{{ . | urlize | lower }}{{ end }}{{ end }}" class="home-section-wrapper full_width home alt">
<section id="{{ range $k, $v := $title_words }}{{ if eq $k 0 }}{{ . | urlize | lower }}{{ end }}{{ end }}" class="home-section-wrapper full_width home">
<div class="row">
<div class="col-xs-12 col-md-4">
<h2>{{ title $page.Title }}</h2>

View file

@ -129,13 +129,16 @@ footer p.powered-by {
margin-bottom: 0px;
width: 1905px;
margin-left: -382.5px;
background-color: rgb(247, 247, 247);
}
.home-section-wrapper.full_width.home.alt {
.home-section-wrapper.full_width.home:nth-child(even) {
background-color: rgb(255, 255, 255);
}
.home-section-wrapper.full_width.home:nth-child(odd) {
background-color: rgb(247, 247, 247);
}
/*************************************************
* Blog Articles
**************************************************/