-
Notifications
You must be signed in to change notification settings - Fork 21
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
Back To Top Link #2990
Back To Top Link #2990
Conversation
✅ Deploy Preview for ons-design-system-preview ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Few minor things here and I think the formatting of your examples needs looking at. Theres also a few of my previous comments that haven't been addressed
Id recommend adding the eslint extension to your VScode and changing the "render whitespace" setting to "all" which will allow you to easily spot some of these things |
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 "backToTop" files should be renamed "back-to-top" to be consistent with other filenames of the same type
…wcag 22 level aaa (#3119) * ⬆️ Back To Top Link ⬆️ (#2990) * Page template for length * Add macro * Add component foundations * Build stylesheet * Add additional functionality * Improved functionality * Fix border and layout * Fix resize behaviour * Changes to CSS * Add more tests * Update VR Tests * Change to full width --------- Co-authored-by: Alessio Venturini <112873190+alessioventuriniAND@users.noreply.github.com> * Description list not structured properly for screen readers (#3053) * initial change * update test * update test * update comment * update comment * Update placeholder text colour (#3062) * Fix/3004/icon in footer not clickable (#3036) * Fix checkbox appearance on safari (#3066) * Adding the change in readme (#3067) * updated youtube video to a more accessible one * updated reference files --------- Co-authored-by: Aditya Unnithan_ONS <56112669+adi-unni@users.noreply.github.com> Co-authored-by: Precious Onyenaucheya <86783201+precious-onyenaucheya-ons@users.noreply.github.com> Co-authored-by: rmccar <42928680+rmccar@users.noreply.github.com> Co-authored-by: Bali Birch-Lee_ONS <149602681+balibirchlee@users.noreply.github.com> Co-authored-by: SriHV <123635670+SriHV@users.noreply.github.com>
What is the context of this PR?
Fixes: #1599
The back-to-top link is a requested component for the Design System. The button takes you from wherever you are on the page to the top of the page or wherever you specify.
The default options for both are "Back to Top" taking you to "#top" however, this can be modified to you to the contents with the description "Scroll to contents" for example. To modify the text of the button, edit the description parameter. Similarly, to modify the jump location, edit the anchor parameter. When making a custom point to anchor, make sure to add an
id
to the element you want to jump to which matches theid
in the anchor parameter.As per the requirements, the button will appear towards the bottom of the screen when the user scrolls two window heights down from the anchor div. When the user reaches the link on the page, it will take the form of the link on the page.
Note: Position of the text of the button when sticky is based on the position when it is a link on the on the page. This in turn is based on the container it is in.
How to review this PR
Check out the back to top button examples and make sure they are working correctly. Also test resizing the window to make sure the BTT links margins move accordingly
Checklist
This needs to be completed by the person raising the PR.