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 committed Dec 9, 2020
1 parent 7ba1d45 commit 4055976
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 23 deletions.
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
14 changes: 14 additions & 0 deletions src/components/Tooltip/Tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,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');
}
1 change: 1 addition & 0 deletions src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,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

0 comments on commit 4055976

Please sign in to comment.