Custom Scrollbar Design
Getting a custom scrollbar on your site makes it stand out a bit compared to
the very plain stock one that are on most sites. This is how I set mine up on
my gatsby site.
Inspired by Wes Bos’s new uses.tech [1] I wanted a custom
scrollbar on my personal site. I had tried to do it in the past, but gave up
after it was not working.
Looking at the Source # [2]
Since uses.tech [1] is open source I jumped on github, searched for scroll and found this layout.js [3].
Copy it to my own component # [4]
My first step was to take his css and copy it into a styled component for my entire layout, but it failed. I do not fully understand why. None of the custom style came through at all. If you know please leave me a comment.
[5]
I suspect for some reason it has to do with attatching to the html [6] element inside of a styled-component. I think wes was able to get around this by using createGlobalStyle. But I was still using much of the default gatsby template, so I did not have a createG...