-
Notifications
You must be signed in to change notification settings - Fork 1.1k
USWDS - Pages: Avoid reordering content in Documentation example #5681
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
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
I've updated the summary. Feel free to edit for clarity. This change strictly affects the Documentation page example. We're making this change because in small screens the visual display does not match the tab order. Currently the sidenav is placed before the content, but then reordered to after on mobile. |
Removed `usa-layout-docs` since its placement doesn't match BEM standards.
@amyleadem @mahoneycm addressed comments, thank you. PR is ready for re-review. |
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. I added one small request to remove an undefined class. Other than that, I think it is good!
@@ -49,7 +49,7 @@ | |||
|
|||
</div> | |||
|
|||
<main class="usa-layout-docs__main desktop:grid-col-9 usa-prose usa-layout-docs" id="main-content"> | |||
<main class="usa-layout-docs__main desktop:grid-col-9 usa-prose" id="main-content"> |
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.
Can you also remove the usa-layout-docs__main
class?
<main class="usa-layout-docs__main desktop:grid-col-9 usa-prose" id="main-content"> | |
<main class="desktop:grid-col-9 usa-prose" id="main-content"> |
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.
@amyleadem I've removed the class in 66decc0. I've also bumped this up to potentially breaking change and noted in the PR description.
Mainly because:
- This is a markup change (even if minor)
- And because classes have been removed it could impact users that have relied on these classes for custom styling.
…twig Co-authored-by: Amy Leadem <93996430+amyleadem@users.noreply.github.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.
Looks good to me! Thanks @mejiaj
Hm. I'm not sure this is something we can recommend. The outcome here — a page with a big ol' sidebar preceding, and blocking, the content is not good. This kind of page would be really bad for the majority of folks accessing a content page on mobile, and would be confusing. (You'd think that you somehow missed the content.) From the original issue, I think we need to consider option B:
As is, this is a solution that essentially breaks conventional functionality. |
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.
See my comment above, but I think this solution has too much of an impact on conventional functionality and reading experience
Closing in favor of alternate solution mentioned by @thisisdano #5794 |
Summary
Documentation page structure follows logical order. Sidenav on page template now follows logical HTML order on mobile. Previously, the sidenav was shifted after the content, which did not follow the HTML order.
Breaking change
This is a potentially breaking 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.Caution
Users who rely on or extended the classes listed above would be negatively affected. See #5681 (comment).
Related issue
Closes #4594.
Related pull requests
Changelog entry: uswds/uswds-site#2495.
Preview link
Preview links; test all screen sizes:
develop
)Sidenav now comes before content on small screens. Previously, it was reordered after content.
Problem statement
In mobile, tab order doesn't match visual order in the documentation page example.
Solution
Removed styling that re-ordered the layout.
Testing and review