Skip to content

Commit

Permalink
Merge pull request #102 from maartenpaauw/master
Browse files Browse the repository at this point in the history
Feature: smooth scrolling
  • Loading branch information
ChristopherBilg committed Jul 13, 2023
2 parents 14e976a + 4eb7531 commit c49c098
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions mvp.css
Expand Up @@ -40,6 +40,16 @@
}
}

html {
scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
html {
scroll-behavior: auto;
}
}

/* Layout */
article aside {
background: var(--color-secondary-accent);
Expand Down
6 changes: 3 additions & 3 deletions mvp.html
Expand Up @@ -20,7 +20,7 @@
<a href="/"><img alt="Logo" src="https://via.placeholder.com/200x70?text=Logo" height="70"></a>
<ul>
<li>Menu Item 1</li>
<li><a href="#">Menu Item 2</a></li>
<li><a href="#section-1">Menu Item 2</a></li>
<li><a href="#">Dropdown Menu Item</a>
<ul>
<li><a href="#">Sublink with a long name</a></li>
Expand All @@ -36,7 +36,7 @@ <h1>Page Heading with <i>Italics</i> and <u>Underline</u></h1>
</header>
<main>
<hr>
<section>
<section id="section-1">
<header>
<h2>Section Heading</h2>
<p>Section Subheading</p>
Expand Down Expand Up @@ -148,4 +148,4 @@ <h2>Form title</h2>
</footer>
</body>

</html>
</html>

0 comments on commit c49c098

Please sign in to comment.