Skip to content

Commit

Permalink
Change to flexbox to support longer titles in post navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
rohanchandra committed Jun 24, 2015
1 parent 9e96db3 commit 32a97bb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
10 changes: 7 additions & 3 deletions _layouts/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ <h1 class="title">{{ page.title }}</h1>
{% if page.previous.url %}
<a id="prev-post" href="{{ site.baseurl }}{{ page.previous.url }}">
<span class="page-title">{{ page.previous.title }}</span>
<i class="fa fa-chevron-left"></i> {{ site.theme.str_prev }}
<span class="nav-label">
<i class="fa fa-chevron-left"></i> {{ site.theme.str_prev }}
</span>
</a>
{% endif %}
{% if page.next.url %}
<a id="next-post" href="{{ site.baseurl }}{{ page.next.url }}">
<span class="page-title">{{ page.next.title }}</span>
{{ site.theme.str_next }} <i class="fa fa-chevron-right"></i>
<span class="page-title">{{ page.next.title }}</span>
<span class="nav-label">
{{ site.theme.str_next }} <i class="fa fa-chevron-right"></i>
</span>
</a>
{% endif %}
</div>
Expand Down
12 changes: 3 additions & 9 deletions _sass/layouts/_posts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ header {
#post-nav {
width:100%;
border-bottom: 1px solid $border-color;
display: inline-block;
display: flex;
float: left;

a, .page-title {
display: inline-block;
Expand All @@ -64,7 +65,7 @@ header {
}

a {
@extend %padding-small;
padding: 2em 3em;
border: 1px solid rgba(255, 255, 255, 0);
text-align: center;
width: 50%;
Expand All @@ -73,13 +74,6 @@ header {
@extend a.button:hover;
}

#prev-post {
float: left;
}
#next-post {
float: right;
}

i {
vertical-align: middle;
}
Expand Down

0 comments on commit 32a97bb

Please sign in to comment.