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
USWDS - Pages: Avoid reordering content in Documentation example #5794
Conversation
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.
This is looking good. Added a suggestion to remove duplicate code. The suggestion will likely need to be tweaked and tested, but wanted to give you a starting point to let you know what I'm thinking. Let me know if you have questions!
packages/templates/usa-documentation/includes/_usa-docs-inner.twig
Outdated
Show resolved
Hide resolved
Update 3/1/24Loved @amyleadem's suggestion to implement the side-nav via |
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.
This is looking good! Just a couple small tweaks to the data, detailed in the comments below.
packages/templates/usa-documentation/includes/_usa-docs-inner.twig
Outdated
Show resolved
Hide resolved
…ure-doc-layout-order
…s/uswds into cm-feature-doc-layout-order
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.
Looks good to me!
I tested the following:
- Confirm no visual regressions from
develop
- Confirm that the HTML order matches the visual order
- Confirm that the code meets standards
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 for helping out with this. Small comment for clarity, otherwise LGTM.
packages/templates/usa-documentation/includes/_usa-docs-inner.twig
Outdated
Show resolved
Hide resolved
packages/templates/usa-documentation/includes/_usa-docs-inner.twig
Outdated
Show resolved
Hide resolved
packages/templates/usa-documentation/includes/_usa-docs-inner.twig
Outdated
Show resolved
Hide resolved
Co-authored-by: James Mejia <james.mejia@gsa.gov>
@mahoneycm I tweaked the summary to avoid any confusion with USA In-page navigation. |
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. Thank you!
Summary
Added mobile sidenav to the Documentation page template. Sidenavs will now always follow logical HTML order on mobile and desktop views. Both navs use utility classes to change display settings based on viewport width.
Breaking change
Workaround
Include a duplicate sidenav after main content. Visibility is toggled using utility classes to avoid accessibility issues related to tab order and users of assistive technologies.
Recommended workaround
Changed HTML
This solution effectively duplicates the nav HTML and displays only the correctly placed in-page nav.
While this doesn’t affect the in-page nav component, we do offer this page as a template and the component code is changed as a result of this PR. // Need to verify this causes a change
Removed template classes:
usa-layout-docs__main
: This is the class that had the styles that reordered element.usa-layout-docs
: This selector unused in current styles.Related issue
Closes #4594
Related pull requests
Alternate approach as discussed in #5681
Changelog → (Taken from #5681)
Preview link
develop
)Problem statement
In mobile, tab order doesn't match visual order in the documentation page example.
Solution
Create a second, mobile only in-page nav. Use utility classes to dictate which is displayed.
Testing and review
Visit Documentation page →
In desktop widths
In mobile widths
Testing checklist