Skip to content

Commit

Permalink
Removing global styles and fixing tooltip activator
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominic McPhee authored and kyledurand committed Feb 3, 2021
1 parent 4f556ce commit b3da2f3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 25 deletions.
2 changes: 0 additions & 2 deletions UNRELEASED.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ Use [the changelog guidelines](https://git.io/polaris-changelog-guidelines) to f

### Enhancements

- Added `flush` prop to `Card.Section` ([#3645](https://github.com/Shopify/polaris-react/pull/3645))
- Added `stretchContent` prop for `Button` ([#3664](https://github.com/Shopify/polaris-react/pull/3664))
- Added `focus-visible` polyfill and default styles ([#3695](https://github.com/Shopify/polaris-react/pull/3695))

### Bug fixes
Expand Down
23 changes: 0 additions & 23 deletions src/components/AppProvider/AppProvider.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,29 +62,6 @@ body {
box-sizing: border-box;
}

:focus:not(:focus-visible) {
outline: none;
}

:focus-visible {
outline: none;
box-shadow: 0 0 0 rem(2px) var(--p-focused, color('indigo'));
border-radius: var(--p-border-radius-base);
}

[data-js-focus-visible] {
:focus:not([data-focus-visible-added]) {
outline: none;
}

// stylelint-disable-next-line selector-max-attribute
[data-focus-visible-added] {
outline: none;
box-shadow: 0 0 0 rem(2px) var(--p-focused, color('indigo'));
border-radius: var(--p-border-radius-base);
}
}

h1,
h2,
h3,
Expand Down
1 change: 1 addition & 0 deletions src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export function Tooltip({

accessibilityNode.tabIndex = 0;
accessibilityNode.setAttribute('aria-describedby', id);
accessibilityNode.setAttribute('data-polaris-tooltip-activator', 'true');
}, [id, children]);

const handleKeyUp = useCallback(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,17 @@ $content-max-width: rem(200px);
padding: spacing(extra-tight) spacing(tight);
word-break: break-word;
}

[data-polaris-tooltip-activator] {
outline: 0;
@include focus-ring;

&:focus-visible {
@include focus-ring($style: 'focused');
}
}

// stylelint-disable-next-line selector-max-attribute
[data-polaris-tooltip-activator][data-focus-visible-added] {
@include focus-ring($style: 'focused');
}

0 comments on commit b3da2f3

Please sign in to comment.