Making tanstack docs more accessible with Stylus
Stylus is a browser extension with which you can modify styles on a webpage. I use it to fix accessibility and usability niggles faced on my regularly visited webpages.
My mouse/trackpad is configured to auto-click on rest/hover. Over time, I"ve developed a habit of resting the cursor on any white space of a webpage.
Tanstack.com hosts a collection of headless web widgets to develop web applications. Now, in the tanstack docs, each heading is a clickable anchor, but the clickable area also spans the whole width of the content area. When I subconsciously rest my cursor on the white space besides a heading, the heading and contents are suddenly yanked to the top.
Here is the Stylus fix:
a.anchor-heading {
display: inline;
}
Now, the heading still remains an anchor, but the white space besides the heading text stays out of the clickable area.
Update: 19 Feb 2025
Tanner Linsley, the founder of the tanstack ecosystem, saw this post on Bluesky, and prompted me to submit a PR to fix this problem. The PR is now merged.
Written by Jayesh Bhoot