Skip to content

Commit

Permalink
fix: replace fixed position with sticky for header
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Apr 6, 2023
1 parent f4a3291 commit 323687f
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 12 deletions.
5 changes: 0 additions & 5 deletions assets/main/scss/_main.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
main {
margin-bottom: 2rem;
margin-top: if($fixedHeader, 92px, 28px);

@include media-breakpoint-down(sm) {
margin-top: if($fixedHeader, 76px, 18px);
}
}

.btn-scroll-to-top,
Expand Down
5 changes: 0 additions & 5 deletions assets/main/scss/_reboot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ html {
}
}

html,
body {
height: 100%;
}

a {
color: inherit;
text-decoration: none;
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/header.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<header>
<header class="mb-4{{ if $.Site.Params.fixedHeader }} sticky-top{{ end }}">
{{ partial "header/index" . }}
</header>
2 changes: 1 addition & 1 deletion layouts/partials/header/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- $baseURL := $.Site.BaseURL }}
{{- $dropdownMenuToggle := default true $.Site.Params.topAppBar.dropdownMenuToggle }}
<nav class="top-app-bar shadow navbar navbar-expand-xxl{{ if $.Site.Params.fixedHeader }} fixed-top{{ end }}">
<nav class="top-app-bar shadow navbar navbar-expand-xxl">
<div class="{{- partialCached "functions/container-class" . .FirstSection -}}">
{{- if eq .Type "docs" }}
<button class="navbar-toggler border-0" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasDocsNav"
Expand Down

0 comments on commit 323687f

Please sign in to comment.