forked from mmistakes/minimal-mistakes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert sidebar to topbar (in progress, incomplete)
- Loading branch information
1 parent
ddb2643
commit f2404f0
Showing
4 changed files
with
127 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{% if page.topbar %} | ||
<div class="topbar"> | ||
{% for s in page.topbar %} | ||
{% if s.image %} | ||
<img src="{{ s.image | relative_url }}" | ||
alt="{% if s.image_alt %}{{ s.image_alt }}{% endif %}"> | ||
{% endif %} | ||
{% if s.title %}<h3>{{ s.title }}</h3>{% endif %} | ||
{% if s.text %}{{ s.text | markdownify }}{% endif %} | ||
{% if s.nav %}{% include nav_list nav=s.nav %}{% endif %} | ||
{% endfor %} | ||
{% if page.topbar.nav %} | ||
{% include nav_list nav=page.topbar.nav %} | ||
{% endif %} | ||
|
||
</div> | ||
|
||
|
||
<!-- convert masthead instead of sidebar! --> | ||
<!-- | ||
<div class="topbar"> | ||
<div class="topbar__inner-wrap"> | ||
<div class="topbar__menu"> | ||
<nav id="topbar-nav" class="greedy-nav"> | ||
<ul class="visible-links"> | ||
{%- for link in site.data.navigation.main -%} | ||
<li class="masthead__menu-item"> | ||
<a href="{{ link.url | relative_url }}"{% if link.description %} title="{{ link.description }}"{% endif %}>{{ link.title }}</a> | ||
</li> | ||
{%- endfor -%} | ||
</ul> | ||
<button class="greedy-nav__toggle hidden" type="button"> | ||
<span class="visually-hidden">{{ site.data.ui-text[site.locale].menu_label | default: "Toggle menu" }}</span> | ||
<div class="navicon"></div> | ||
</button> | ||
<ul class="hidden-links hidden"></ul> | ||
</nav> | ||
</div> | ||
</div> | ||
</div> --> | ||
|
||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
/* ========================================================================== | ||
TOPBAR | ||
========================================================================== */ | ||
|
||
/* | ||
Default | ||
========================================================================== */ | ||
|
||
|
||
.topbar { | ||
position: relative; | ||
border-bottom: 1px solid $border-color; | ||
-webkit-animation: $intro-transition; | ||
animation: $intro-transition; | ||
-webkit-animation-delay: 0.15s; | ||
animation-delay: 0.15s; | ||
z-index: 20; | ||
background-color: $header-background-color; | ||
|
||
&__inner-wrap { | ||
@include clearfix; | ||
margin-left: auto; | ||
margin-right: auto; | ||
padding: 1em; | ||
max-width: 100%; | ||
display: -webkit-box; | ||
display: -ms-flexbox; | ||
display: flex; | ||
-webkit-box-pack: justify; | ||
-ms-flex-pack: justify; | ||
justify-content: space-between; | ||
font-family: $sans-serif-narrow; | ||
|
||
@include breakpoint($x-large) { | ||
max-width: $max-width; | ||
} | ||
|
||
nav { | ||
z-index: 10; | ||
} | ||
|
||
a { | ||
text-decoration: none; | ||
} | ||
} | ||
} | ||
|
||
.topbar__menu { | ||
float: left; | ||
margin-left: 0; | ||
margin-right: 0; | ||
width: 100%; | ||
clear: both; | ||
|
||
.site-nav { | ||
margin-left: 0; | ||
|
||
@include breakpoint($small) { | ||
float: right; | ||
} | ||
} | ||
|
||
ul { | ||
margin: 0; | ||
padding: 0; | ||
clear: both; | ||
list-style-type: none; | ||
} | ||
} | ||
|
||
.topbar__menu-item { | ||
display: block; | ||
list-style-type: none; | ||
white-space: nowrap; | ||
|
||
&--lg { | ||
padding-right: 2em; | ||
font-weight: 700; | ||
} | ||
} | ||
|