-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[docs] Update the styling of the TOC #14520
Conversation
(Just scratching an itch 😄)
This started as a quick restyle of the TOC, and escalated from there! |
This comment has been minimized.
This comment has been minimized.
I'm trying to find examples of great documentation. Few have a TOCs: developers.google.com, getbootstrap.com, docker.com, most don't have it. After looking at them, I think that we should keep the current logic:
One thing I think that we should work on regarding the TOCs: i18n support, it's quite a broken right now in Chinese ✌️. |
This reverts commit 6e8fd97.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Here's one you might be familiar with! 🤣 Doing this means that when someone is referencing the documentation, the URL pinpoints the specific section. (If anything, it bugs me when there isn't a specific enough id. Having to say "go to this URL, then scroll down to XXX is a PITA for everyone.) (Yes, we have the '#' icon, but it's easy to miss, or to forget to click before copying the URL.) |
At one point I had ' - ' in front of subsection titles, but because of wrapped headings, it looked odd, so I dropped it (although there is almost certainly a CSS solution to that which preserves the indentation for subsequent lines). Perhaps rather than making the currently selected section or sub section bold, we reserve it for top level sections. The highlight should be enough by itself to show the currently selected section, so long as contrast doesn't suffer without the emboldening. |
@mbrookes I shouldn't have said "none" :). Then maybe it's just me spending too much time on their documentation, I dislike the way it's structured. They have disabled the headlines click to get the anchor. Yeah, I think that we should use this documentation as an example of what we shouldn't do 🙆♂️. I'm curious on the ratio % count of docs website using manual anchor links vs automatic. As somebody often linking documentation anchor, I personally prefer "being in control".
Then why so few documentation websites use this approach? I think that it's because you don't know if a person is going to link the whole page or a subsection, you let him choose. Most of the time, they link the whole page, so you optimize for the majority. It's also an incentive for us to split large documentation pages.
@eps1lon 💯 IMHO we shouldn't try to put too many thoughts into how the TOCs work. I think that a lot of documentation, older & more used than our have spent a lot of time on the problem, I would just copy what the majority do. "The majority is right", I think that it applies in this case. It's what I have tried to do when implementing the TOCs. |
This comment has been minimized.
This comment has been minimized.
To be fair: This is probably skewed because it's the default behavior of the docs software. I think having the anchor automatically update is a nice feature. It doesn't require knowledge about position of anchor links or if one even exists. I would even prefer if the anchor links where visible by default. |
This is a good page to compare the before and after:
In addition to the change of styling (updated again since first commit):
Smooth scrolling(removed out of consideration for those subject to motion sickness.)(subject to ongoing discussion)(Merged to get user feedback. Might be removed for v4.)findActiveIndex()
incomponentDidMount()
.font-awesome
) on http://localhost:3000/style/icons.