Skip to content

Conversation

mirualves
Copy link
Contributor

@mirualves mirualves commented Jul 25, 2019

WHY are these changes introduced?

Fixes https://github.com/Shopify/polaris-ux/issues/147

The current hover/focus styles rely on a change in color alone which isn't visible in Windows High Contrast, and may be difficult for other low vision users to distinguish. An underline that's displayed when a user starts to interact with the link would help cement the idea that it's a link and clarify exactly what that particular link does.

WHAT is this pull request doing?

Add underline to Links and Plain button on hover, so it doesn't rely on color alone for accessibility.

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

Copy-paste this code in playground/Playground.tsx:
import * as React from 'react';
import {
  Page,
  Button,
  Link,
  Stack,
  Card,
  FooterHelp,
  TextContainer,
} from '../src';

interface State {}

export default class Playground extends React.Component<{}, State> {
  render() {
    return (
      <Page title="Playground">
        <Card>
          <Card.Section>
            <TextContainer>
              This is some text and <Link url="#">this thing right here</Link>{' '}
              is a link.
            </TextContainer>
          </Card.Section>
          <Card.Section>
            <Stack>
              <Button plain>View shipping settings</Button>
              <Link url="https://help.shopify.com/manual">
                fulfilling orders
              </Link>
              <Link url="https://help.shopify.com/manual" external>
                Shopify Help Center
              </Link>
            </Stack>
          </Card.Section>
        </Card>
        <FooterHelp>
          Learn more about{' '}
          <Link url="https://help.shopify.com/manual/orders/fulfill-orders">
            fulfilling orders
          </Link>
          .
        </FooterHelp>
      </Page>
    );
  }
}

🎩 checklist

@BPScott BPScott temporarily deployed to polaris-react-pr-1885 July 25, 2019 18:11 Inactive
@BPScott BPScott temporarily deployed to polaris-react-pr-1885 July 25, 2019 18:44 Inactive
@mirualves mirualves changed the title [WIP] [Link, Plain button] Add underline to Links and Plain button on hover [Link, Plain button] Add underline to Links and Plain button on hover Jul 25, 2019
@mirualves mirualves self-assigned this Jul 25, 2019
@dpersing
Copy link

Adding a note that this is a partial fix. It does help users find the links on interaction, but users still might have challenges finding the links in the first place. Will take a closer look in a bit!

@mirualves mirualves force-pushed the link_button_accessibility branch from f7f5e02 to 2a0a35e Compare August 12, 2019 13:21
@BPScott BPScott temporarily deployed to polaris-react-pr-1885 August 12, 2019 13:22 Inactive
@mirualves mirualves requested a review from dleroux August 12, 2019 13:24
Copy link

@dpersing dpersing left a comment

Choose a reason for hiding this comment

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

🎉 Thanks so much for your patience, @mirualves !

@mirualves mirualves merged commit 6e200bf into master Aug 12, 2019
@alex-page alex-page deleted the link_button_accessibility branch August 12, 2019 17:43
@AndrewMusgrave AndrewMusgrave temporarily deployed to production August 13, 2019 21:12 Inactive
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.

4 participants