Skip to content

Conversation

mitchmoccia
Copy link
Contributor

@mitchmoccia mitchmoccia commented Feb 2, 2023

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 #5050 striking 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:

image

Notice the main content section is a div with the class .usa-in-page-nav__main instead of forcing the main element.

Finally, unit test assertions have been vastly improved in this PR.

Looking forward to questions and comments, thanks!!

Amy Leadem and others added 30 commits July 1, 2022 10:32
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
mahoneycm and others added 16 commits December 9, 2022 10:13
…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>
USWDS - Update pull request template
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";
Copy link
Contributor

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?

Copy link
Contributor

@amyleadem amyleadem left a 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

@amyleadem
Copy link
Contributor

Closing this PR in favor of #5387

@amyleadem amyleadem closed this Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants