Skip to content

Commit

Permalink
Fix section vertical aligment (#37)
Browse files Browse the repository at this point in the history
* Fix section vertical aligment

This fixes the sections' vertical scroll offset when navigating through
menu anchor links.

Screencast of the observed issue:
https://drive.google.com/file/d/12rB1Pjm_UO2l23cSB1aGOlrpil_CWTvP/view

Signed-off-by: Nick Diego Yamane <[email protected]>

* Fix smaller screen sizes

---------

Signed-off-by: Nick Diego Yamane <[email protected]>
Co-authored-by: Manuel Rego Casasnovas <[email protected]>
  • Loading branch information
Nick Yamane and mrego authored May 28, 2024
1 parent 2af93b9 commit 72e7ec9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions _assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
--orange-background: #ff9900cc;
}

html {
scroll-padding-top: 5rem;
}

html, body {
margin: 0;
padding: 0;
Expand Down Expand Up @@ -55,6 +59,7 @@ nav {
position: sticky;
top: 0;
z-index: 1;
height: 5rem;
}

nav > ul {
Expand Down Expand Up @@ -366,6 +371,14 @@ footer a:hover, a:focus, a:active {
}

@media (max-width: 1024px) {
html {
scroll-padding-top: 3rem;
}

nav {
height: 3rem;
}

nav > ul {
margin-inline: 1rem;
}
Expand Down Expand Up @@ -414,6 +427,14 @@ footer a:hover, a:focus, a:active {
}

@media (max-width: 512px) {
html {
scroll-padding-top: 5.5rem;
}

nav {
height: 5.5rem;
}

nav > ul {
margin-inline: 0;
}
Expand Down

0 comments on commit 72e7ec9

Please sign in to comment.