-
Notifications
You must be signed in to change notification settings - Fork 1.1k
In-page nav main content section requirement changed from the main element to a class #5124
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
Co-authored-by: James Mejia <james.mejia@gsa.gov>
Co-authored-by: James Mejia <james.mejia@gsa.gov>
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 1.4.0 to 1.4.1. - [Release notes](https://github.com/webpack/loader-utils/releases) - [Changelog](https://github.com/webpack/loader-utils/blob/v1.4.1/CHANGELOG.md) - [Commits](webpack/loader-utils@v1.4.0...v1.4.1) --- updated-dependencies: - dependency-name: loader-utils dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
…ils-1.4.1 Bump loader-utils from 1.4.0 to 1.4.1
Add inclusive patterns code updates
…uswds-core/decode-uri-component-0.2.2 Bump decode-uri-component from 0.2.0 to 0.2.2 in /packages/uswds-core
Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2. - [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases) - [Commits](SamVerschueren/decode-uri-component@v0.2.0...v0.2.2) --- updated-dependencies: - dependency-name: decode-uri-component dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
…i-component-0.2.2 Bump decode-uri-component from 0.2.0 to 0.2.2
Co-authored-by: James Mejia <james.mejia@gsa.gov>
removed emojis and updated tone and voice
USWDS - Update pull request template
…an be applied to any element
const IN_PAGE_NAV_NAV_CLASS = `${IN_PAGE_NAV_CLASS}__nav`; | ||
const IN_PAGE_NAV_LIST_CLASS = `${IN_PAGE_NAV_CLASS}__list`; | ||
const IN_PAGE_NAV_ITEM_CLASS = `${IN_PAGE_NAV_CLASS}__item`; | ||
const IN_PAGE_NAV_LINK_CLASS = `${IN_PAGE_NAV_CLASS}__link`; | ||
const IN_PAGE_NAV_TITLE_CLASS = `${IN_PAGE_NAV_CLASS}__heading`; | ||
const SUB_ITEM_CLASS = `${IN_PAGE_NAV_ITEM_CLASS}--sub-item`; | ||
const MAIN_ELEMENT = "main"; |
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.
I'm not a maintainer, just a fellow contributor, but: Since this would be a breaking change as proposed, would another option be to support an optional attribute on the In-Page Navigation element to override the selector for the main element, so you could do something like ... ?
<aside
class="usa-in-page-nav__container"
data-main-selector=".usa-in-page-nav__main"
></aside>
Or at least, could backward-compatibility be maintained by continuing to support the main
element, if present?
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.
Note: The effort to create a custom selector for the main content region is now being worked in #5387
Leaving this PR open because we need to discuss if we want to include the other changes (including the HTML and test updates) as shown in this PR.
cc: @mejiaj @mahoneycm
Closing this PR in favor of #5387 |
This update makes in-page nav way more flexible by changing the main content portion requirement from the
main
element to any element with the class.usa-in-page-nav__main
.https://federalist-3b6ba08e-0df4-44c9-ac73-6fc193b0e19c.sites.pages.cloud.gov/preview/uswds/uswds/mm-in-page-nav-parent-update/iframe.html?args=&id=components-in-page-navigation--default&viewMode=story
This was suggested in the following issue:
Closes #5050striking this because it no longer closes this issue (Amy)Also, the HTML structural requirement has been updated to bring it more inline with other components. Currently, the parent wrapper is
.usa-in-page-nav__container
. The new structure changes that to.usa-in-page-nav
and overall looks like this now:Notice the main content section is a
div
with the class.usa-in-page-nav__main
instead of forcing themain
element.Finally, unit test assertions have been vastly improved in this PR.
Looking forward to questions and comments, thanks!!