Skip to content

Commit

Permalink
style: sticky header for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
xianmin committed Nov 3, 2024
1 parent 27fcced commit 1fb65d7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion assets/sass/_partial/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Post footer
// =============================

.footer {
.site-footer {
margin-top: 3rem;
background: var(--pico-primary-focus);
padding-top: 2rem;
Expand Down
9 changes: 8 additions & 1 deletion assets/sass/_partial/_header/_mobile_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@
line-height: 1;

.mobile-navbar-icon {
font-size: 1.5em;
color: #fff;
order: 1;
padding: 0.5em;
padding: 0.3em;
}

.mobile-navbar-logo {
Expand All @@ -34,6 +35,12 @@
.mobile-header {
display: flex;
}

.site-header {
position: sticky;
top: 0;
z-index: 1000;
}
}

.mobile-menu-close-modal {
Expand Down
4 changes: 2 additions & 2 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<body>
<div id="back-to-top"></div>

<header>
<header class="site-header">
{{ partial "desktop_header.html" . }}
{{ partial "mobile_header.html" . }}
</header>
Expand All @@ -27,7 +27,7 @@
{{ block "content" . }}{{ end }}
</main>

<footer id="footer" class="footer">
<footer id="footer" class="site-footer">
{{ partial "footer.html" . }}
</footer>

Expand Down
1 change: 0 additions & 1 deletion layouts/partials/mobile_header.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
"className" "icon--languages"
) }}
{{ .Site.Language.LanguageName }}
{{ i18n "language" }}
</a>
</div>
<ul class="mobile-submenu-list">
Expand Down

0 comments on commit 1fb65d7

Please sign in to comment.