gka / chroma.js

JavaScript library for all kinds of color manipulations
https://vis4.net/chromajs/
Other
9.94k stars 543 forks source link

Make documentation's ToC sticky #299

Closed mannie-exe closed 2 years ago

mannie-exe commented 2 years ago

Hey there!

I hope you weren't planning to do something similar. Yesterday, I was busy looking at chroma.js' documentations, and I got mildly annoyed at needing to scroll back to the very top to navigate using the table of contents lol.

So I made the table of contents position fixed, and I added a small — horizontal scroll indicator. I considered chevrons to indicate scrollability, but I figured the scroll bar itself was enough.

Let me know if you have any suggestions. My immediate idea was to also rainbow-fy the scroll indicator color (currently, it's a static pink), and maybe add some other indications to highlight the user's ability to scroll the ToC.

You can see my changes live here: https://schmannie.github.io/chroma.js/

Let me know what you think, and if you'd like to use these changes at all!

mannie-exe commented 2 years ago

I have no idea why the tests are failing on Travis. I have made zero changes unrelated to the docs, and my local npm test completes successfully.

@gka2 @gka any hints?