USWDS - Pages: Avoid reordering content in Documentation example#5794
USWDS - Pages: Avoid reordering content in Documentation example#5794thisisdano merged 7 commits intodevelopfrom
Conversation
amyleadem
left a comment
There was a problem hiding this comment.
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 |
amyleadem
left a comment
There was a problem hiding this comment.
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
amyleadem
left a comment
There was a problem hiding this comment.
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
mejiaj
left a comment
There was a problem hiding this comment.
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. |
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