Skip to content

Commit

Permalink
Adjust sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
ngzhio committed Jul 1, 2020
1 parent d94cbc7 commit 6537437
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
19 changes: 19 additions & 0 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
<div class="wrapper">
<script>
function clickSidebarButton() {
const elem = document.getElementById("site-sidebar")
if (elem.style.display == "none") {
elem.style.display = "block";
} else {
elem.style.display = "none";
}
}
</script>
<a class="site-sidebar-button" onclick="clickSidebarButton()">
{%- if site.avatar contains "://" -%}
{%- assign avatar = site.avatar -%}
{%- else -%}
{%- assign avatar = site.avatar | relative_url -%}
{%- endif -%}
<i class="far fa-user"></i>
</a>

<a class="site-title" rel="author" href="{{ "/" | relative_url }}">{{ site.title | escape }}</a>

{% if site.data.navigation %}
Expand Down
2 changes: 1 addition & 1 deletion _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</header>

<div class="site-body wrapper">
<aside class="site-sidebar">
<aside class="site-sidebar" id="site-sidebar">
{% include sidebar.html %}
</aside>
<main class="site-main" aria-label="Content">
Expand Down
22 changes: 22 additions & 0 deletions _sass/hamilton/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,22 @@
}
}

.site-sidebar-button {
position: absolute;
top: -2px;
left: $spacing-unit / 2;

img {
width: $base-font-size * 2.5;
height: auto;
border-radius: 50%;
}

@media screen and (min-width: $on-small) {
display: none;
}
}

.site-title {
@include relative-font-size(1.625);
font-family: $title-font-family;
Expand Down Expand Up @@ -194,6 +210,12 @@

@include media-query($on-small) {
display: none;
border-right: none;
border-bottom: 1px solid;
}

@media screen and (min-width: $on-small) {
display: block !important;
}
}

Expand Down
2 changes: 1 addition & 1 deletion _sass/hamilton/skin.scss
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ table {
}

.site-sidebar {
border-right-color: $border-color-light;
border-color: $border-color-light;
}

.site-title {
Expand Down

0 comments on commit 6537437

Please sign in to comment.