Skip to content

Commit

Permalink
styles: sticky navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
fuuuzz committed Apr 26, 2024
1 parent ca9a889 commit 0c01db9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/assets/styles/components/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
position: sticky;
top: 0;
background-color: var(--background-default);
height: var(--header-height-desktop);
}
6 changes: 6 additions & 0 deletions src/assets/styles/components/nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@

.pc-nav.pc-desktop-only {
display: none;
position: relative;
}

.pc-nav.pc-desktop-only > ul {
position: sticky;
top: var(--header-height-desktop);
}

pc-nav-menu-button > button {
Expand Down
1 change: 1 addition & 0 deletions src/assets/styles/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
--event-other-border: rgb(244, 245, 247);
--event-other-text: rgb(36, 38, 45);
--event-today: #fcf8e3;
--header-height-desktop: 56px;
}

@media (prefers-color-scheme: dark) {
Expand Down
2 changes: 1 addition & 1 deletion src/templates/components/header.njk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% import 'macros/icons.njk' as icons %}

<header class="pc-header pc-cluster pc-shadow pc-p" style="--cluster-justify: space-between; z-index: 2; --p: calc(3 * var(--v)) calc(6 * var(--v))">
<header class="pc-header pc-cluster pc-shadow pc-p" style="--cluster-justify: space-between; --cluster-align: center; z-index: 2; --p: 0 calc(6 * var(--v))">
<pc-nav-menu-button>
<button aria-haspopup="true" aria-expanded="false" aria-controls="pc-nav-mobile-menu" aria-label="{{ 'nav-open'|trans }}">
{{ icons.menu() }}
Expand Down

0 comments on commit 0c01db9

Please sign in to comment.