Skip to content

Commit

Permalink
fix: header layout flex
Browse files Browse the repository at this point in the history
  • Loading branch information
reuixiy committed Mar 4, 2020
1 parent a11c06a commit 44b352e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
17 changes: 17 additions & 0 deletions assets/js/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,20 @@ if (mainInner !== null) {
headerInner.style.setProperty('--main-inner', '{{ . }}');
{{ end }}
}


// Hide switcher's parentNode if it has `data-hide`

function addDisplayNone(e) {
const ele = document.getElementById(e);
if (ele !== null) {
const hide = ele.getAttribute('data-hide');
if (hide !== null) {
ele.parentNode.style = 'display: none';
}
}
}

addDisplayNone('theme-switcher');

addDisplayNone('lang-switcher');
2 changes: 1 addition & 1 deletion assets/scss/layout/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
.header-inner {
display: flex;
justify-content: space-between;
align-items: baseline;
align-items: center;
width: var(--main-inner);
margin: 0 auto;
}
Expand Down

0 comments on commit 44b352e

Please sign in to comment.