-
Notifications
You must be signed in to change notification settings - Fork 42
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
Add scoll to top feature to website #2080
Conversation
The latest updates on your projects. Learn more about Vercel for Git βοΈ
|
@heatherlarsen the CSS linter seems unhappy after the last commit, but you can fix it by running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a few comments and suggestions.
- Adjusted the aria label to be more descriptive - Adjusted the background color to use transparency so it's more obvious that it's overlaying content in smaller devices - Added box-shadows to the button - Added a visible change on hover - Added a subtle transition
Co-authored-by: Cristiano Rastelli <cristiano.rastelli@hashicorp.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach to always have the button in the DOM with opacity 0 has usability flaws when the button overlaps another interactive element, such as a link on the page (see the example below where it partly overlaps with a doc card image). When the user clicks the area highlighted in red nothing will happen β as you can imagine the problem becomes more acute on narrow screens.
You're right, I didn't think of this case. Do you reckon that adding a |
I've not tested |
β¦eclarations) probably not a big difference, but just in case
β¦`tabindex` depending on the visibility
@alex-ju see my last commit: does this address all the issues? |
Dismissed the request for changes as they were addressed
yes, this looks conformant! π |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks everyone for the support and reviews β€οΈ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM π
π Summary
This PR introduces a feature to the website that affords users a button that can be clicked to return to the top of the current page.
π οΈ Detailed description
Implementation choices:
<Doc::Page::Content>
component, which is pretty much every page except the homepageπΈ Screenshots
π External links
Jira ticket: HDS-3298
Figma file
π¬ Please consider using conventional comments when reviewing this PR.