Skip to content
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

[WIP] fix(button): Icon examples clickable in NVDA #986

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ <h2>Gux Button</h2>
</div>

<gux-button onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon>
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon>
<gux-screen-reader-beta>
This will be read by a screen reader
</gux-screen-reader-beta>
</gux-button>

<gux-button onclick="notify(event)">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,46 +17,46 @@ <h3>Text Only</h3>
</div>
<h3>Icon Only</h3>
<div class="container">
<gux-button onclick="notify(event)"
><gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon
<gux-button onclick="notify(event)">
<gux-screen-reader-beta>
This will be read by a screen reader
</gux-screen-reader-beta>
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon
></gux-button>
Comment on lines +20 to 25
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure whether it makes more sense in this scenario to use provide a way to set the button aria-label rather than introducing another slotted component. We have guxTitle prop but I know we've looked at phasing that out, also don't know if tooltips will always be needed.

It could be something like <gux-button gux-title="This will be read by a screenreader" tooltip-disabled="false"><gux-icon icon-name="fa/diamond-regular" decorative><gux-icon></gux-button>

Suggestions welcome


<gux-button accent="primary" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon
<gux-screen-reader-beta>
This will be read by a screen reader
</gux-screen-reader-beta>
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon
></gux-button>

<gux-button accent="secondary" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon
<gux-screen-reader-beta>
This will be read by a screen reader
</gux-screen-reader-beta>
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon
></gux-button>

<gux-button accent="tertiary" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon
<gux-screen-reader-beta>
This will be read by a screen reader
</gux-screen-reader-beta>
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon
></gux-button>

<gux-button accent="ghost" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon>
<gux-screen-reader-beta>
This will be read by a screen reader
</gux-screen-reader-beta>
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon>
</gux-button>

<gux-button accent="danger" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon
<gux-screen-reader-beta>
This will be read by a screen reader
</gux-screen-reader-beta>
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon
></gux-button>
</div>

Expand Down Expand Up @@ -103,73 +103,55 @@ <h4>Text with extra description</h4>
<h4>Icon Only</h4>
<div class="container">
<gux-button onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon>
<gux-tooltip-beta aria-hidden="true"
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon>
<gux-tooltip-beta
><span slot="content"
>Visual of screen reader text</span
>This is some screenreader text</span
></gux-tooltip-beta
>
</gux-button>

<gux-button accent="primary" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon>
<gux-tooltip-beta aria-hidden="true"
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon>
<gux-tooltip-beta
><span slot="content"
>Visual of screen reader text</span
>This is some screenreader text</span
></gux-tooltip-beta
>
</gux-button>

<gux-button accent="secondary" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon>
<gux-tooltip-beta aria-hidden="true"
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon>
<gux-tooltip-beta
><span slot="content"
>Visual of screen reader text</span
>This is some screenreader text</span
></gux-tooltip-beta
>
</gux-button>

<gux-button accent="tertiary" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon>
<gux-tooltip-beta aria-hidden="true"
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon>
<gux-tooltip-beta
><span slot="content"
>Visual of screen reader text</span
>This is some screenreader text</span
></gux-tooltip-beta
>
</gux-button>

<gux-button accent="ghost" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon>
<gux-tooltip-beta aria-hidden="true"
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon>
<gux-tooltip-beta
><span slot="content"
>Visual of screen reader text</span
>This is some screenreader text</span
></gux-tooltip-beta
>
</gux-button>

<gux-button accent="danger" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon>
<gux-tooltip-beta aria-hidden="true"
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon>
<gux-tooltip-beta
><span slot="content"
>Visual of screen reader text</span
>This is some screenreader text</span
></gux-tooltip-beta
>
</gux-button>
Expand Down Expand Up @@ -248,46 +230,46 @@ <h2>Disabled</h2>
</div>
<h3>Icon Only</h3>
<div class="container">
<gux-button disabled onclick="notify(event)"
><gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon>
<gux-button disabled onclick="notify(event)">
<gux-screen-reader-beta>
This will be read by a screen reader
</gux-screen-reader-beta>
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon>
</gux-button>

<gux-button disabled accent="primary" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon
></gux-button>
<gux-screen-reader-beta>
This will be read by a screen reader
</gux-screen-reader-beta>
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon>
</gux-button>

<gux-button disabled accent="secondary" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon
></gux-button>
<gux-screen-reader-beta>
This will be read by a screen reader
</gux-screen-reader-beta>
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon>
</gux-button>

<gux-button disabled accent="tertiary" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon
></gux-button>
<gux-screen-reader-beta>
This will be read by a screen reader
</gux-screen-reader-beta>
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon>
</gux-button>

<gux-button disabled accent="ghost" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon
></gux-button>
<gux-screen-reader-beta>
This will be read by a screen reader
</gux-screen-reader-beta>
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon>
</gux-button>

<gux-button disabled accent="danger" onclick="notify(event)">
<gux-icon
icon-name="fa/diamond-regular"
screenreader-text="This will be read by a screen reader"
></gux-icon
<gux-screen-reader-beta>
This will be read by a screen reader
</gux-screen-reader-beta>
<gux-icon icon-name="fa/diamond-regular" decorative></gux-icon
></gux-button>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
}

::slotted(gux-tooltip),
::slotted(gux-tooltip-beta) {
::slotted(gux-tooltip-beta),
::slotted(gux-screenreader-beta) {
padding-inline-start: 0;
}

Expand Down