Skip to content

Conversation

@KristinLBradley
Copy link
Contributor

@KristinLBradley KristinLBradley commented Oct 28, 2025

📌 Summary

If merged, this PR prevents inheritance of dark color styles on Buttons within Modals (actually DialogPrimitive) triggered within the SideNav or AppHeader

Showcase previews:

🛠️ Detailed description

  • Update SideNav & AppHeader styles to prevent Button & Dropdown contained in a DialogPrimitive from inheriting dark theme.
  • SideNav & AppHeader Showcase: Add examples of nested Button, Dropdown, & SuperSelect content within DialogPrimitive, etc.

📸 Screenshots

SideNav Showcase example added:
image

AppHeader Showcase example added:
image

BEFORE:
image

AFTER:
image

🔗 External links


👀 Component checklist

💬 Please consider using conventional comments when reviewing this PR.

📋 PCI review checklist
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've worked with GRC to document the impact of any changes to security controls.
    Examples of changes to controls include access controls, encryption, logging, etc.
  • If applicable, I've worked with GRC to ensure compliance due to a significant change to the in-scope PCI environment.
    Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.

@vercel
Copy link

vercel bot commented Oct 28, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
hds-showcase Ready Ready Preview Oct 31, 2025 5:05pm
hds-website Ready Ready Preview Oct 31, 2025 5:05pm

</M.Footer>
</:modal>
</ModalWithTrigger>
</SNL.Item>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a rough example for testing. Should I refine it a bit more? Currently, it just uses a plain unstyled button to trigger the Modal.

I can add an example Modal triggered within the AppHeader as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to add specific examples to the SideNav and AppHeader in which we add not just the modal, but also the flyout, the dropdown and the super select, to make sure their styles are not overwritten?

Copy link
Contributor Author

@KristinLBradley KristinLBradley Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the Modal code from the AppFrame demo and added examples to the SideNav Showcase.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add dark theming styles to the SuperSelect when used directly within the SideNav content?

(Or perhaps since there's been no call for this yet from consumers and we are also working towards adding true theming, it's not really necessary)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the examples I added in the SideNav demo look good, I can add similar examples to the AppHeader Showcase.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they look good. The only thing I would do, is to minimize the demo code added (we're targeting mainly the buttons, so no need to have a full realistic demo; eg, the fake content in the flyout is not necessary)

Copy link
Contributor Author

@KristinLBradley KristinLBradley Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simplified the examples including adding a new code fragment with a simplified SuperSelect example.

I will update the AppHeader Showcase to include similar examples next.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.ember-basic-dropdown-trigger * *,
.ember-basic-dropdown-content * *,
.hds-dialog-primitive__wrapper *
) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chaining CSS :not selectors like this isn't ideal. I could experiment to try to come up with something better, or else we could see if we can find a better solution using the upcoming theming options.

@KristinLBradley KristinLBradley requested a review from didoo October 29, 2025 18:53
@KristinLBradley KristinLBradley changed the title Button - Fix color of Buttons used inside Modal triggered from SideNav or AppHeader (HDS-5572) Button - Fix color of Buttons within Modal triggered from SideNav or AppHeader (HDS-5572) Oct 30, 2025
@KristinLBradley
Copy link
Contributor Author

I was seeing an accessibility failure on links using the "shw-frame__open-link" class name:

not ok 6 Chrome 140.0 - [1682 ms] - Acceptance | components/app-header: Components/app-header page passes automated a11y checks
    ---
        stack: >
            Error: The page should have no accessibility violations. Violations:
            [serious]: All touch targets must be 24px large, or leave sufficient space 
            Violated 1 time. Offending nodes are: 
            <a class="shw-frame__open-link" href="/layouts/app-frame/frameless/demo-full-app-frame-with-app-header-and-app-side-nav" target="_blank" rel="noopener noreferrer">
            https://dequeuniversity.com/rules/axe/4.10/target-size?application=axeAPI
            To rerun this specific failure, use the following query params: &testId=15a171ce&enableA11yAudit=true
                at DEFAULT_REPORTER (http://localhost:7357/assets/test-support.js:2199:13)
                at async Object.<anonymous> (http://localhost:7357/assets/tests.js:91:7)

I saw that this class name was used on links containing an icon to open full page demos in a new screen:
image

I updated the "shw-frame__open-link" CSS to expand the size of the target area from the current 16px x 16px. The a11y check was then passing locally so I pushed up to the PR. This then triggered a Percy diff on a different text-based link:
image

Before style update:
image

The previous width of 16px by 16px wasn't working on the text based link as it is styled to display inline rather than as a block.

Summary of issues:

So anyway, I'm not sure why that a11y test failure started happening suddenly in the first place and hadn't been happening before. But also two such different elements shouldn't be using the same class name which relies upon the width and height failing for the text-based inline link.

> .hds-icon {
width: 16px;
height: 16px;
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made these changes to fix an a11y test failure complaining about the touch target size being too small. After making the change I saw that this class is applied to 2 different types of links:

  • icon-based link: image

  • text-based link:

image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My updates to the styles caused the text-based link to display as a block when previously it had ignored the width and height styles.

It seems the class name should be removed from the text-based link and a different class and styles should be added if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced the class name on the link in the AdvancedTable Showcase and added some basic styles to style the link color the same. (May want to make an official "ShwLink" component or something sometime, but for now I just wanted to keep the link visually the same as it had been previously.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants