Last active
October 1, 2020 06:49
-
-
Save Sandstedt/6b15a78ac8767e7e5df42bb8e64f5c59 to your computer and use it in GitHub Desktop.
A native CSS adoptation of smooth scroll js libraries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Activate a smooth scroll whn using inline anchor links, example: #about */ | |
html { | |
scroll-behavior: smooth; | |
} | |
/* Deactivate the smooth scroll if users has choose to reduce motion in their OS */ | |
@media (prefers-reduced-motion: reduce) { | |
html { | |
scroll-behavior: auto; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment