Skip to content

Commit 6ee523a

Browse files
authored
[Tooltip] Tweak animation duration and box-shadow (#8629)
### WHY are these changes introduced? After liaising with @dGoligorsky we wanted to tweak some of the primitive values for the Tooltip, namely the animation duration and the box-shadow for the overlay. The animation felt too slow, and the shadow meant that Tooltips being displayed over white backgrounds were quite hard to distinguish. We have sped up the animation duration from 200ms to 50ms, and added an extra shadow on top of the `--p-shadow-popover` for the Tooltip to ensure the top edge is visible. Spin URL: https://admin.web.tooltip-tweak-demo.marc-thomas.eu.spin.dev/store/shop1/products/1 ### 🎩 checklist - [x] Tested on [mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing) - [x] Tested on [multiple browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers) - [x] Tested for [accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md) - [x] Updated the component's `README.md` with documentation changes - [x] [Tophatted documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md) changes in the style guide
1 parent 446ba34 commit 6ee523a

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

.changeset/shy-plums-shout.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@shopify/polaris': patch
3+
---
4+
5+
Updated the animation duration and box-shadow for the `Tooltip`

polaris-react/src/components/Tooltip/Tooltip.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ export function ActivatorAsDiv() {
232232

233233
export function WithSuffix() {
234234
return (
235-
<Box padding="16">
235+
<Box padding="16" background="surface">
236236
<LegacyStack>
237237
<ButtonGroup segmented fullWidth>
238238
<Tooltip content="Bold" suffix="⌘B" activatorWrapper="div">

polaris-react/src/components/Tooltip/components/TooltipOverlay/TooltipOverlay.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// stylelint-disable-next-line -- generated by polaris-migrator DO NOT COPY
88
margin: var(--pc-tooltip-overlay-offset) var(--p-space-4) var(--p-space-4);
99
opacity: 1;
10-
box-shadow: var(--p-shadow-popover);
10+
box-shadow: var(--p-shadow-popover), var(--p-shadow-lg);
1111
// stylelint-disable-next-line -- Polaris component custom properties
1212
border-radius: var(--pc-tooltip-border-radius);
1313
pointer-events: none;
@@ -48,7 +48,7 @@
4848
}
4949

5050
.measured:not(.instant) {
51-
animation: var(--p-keyframes-appear-below) var(--p-duration-200)
51+
animation: var(--p-keyframes-appear-below) var(--p-duration-50)
5252
var(--p-ease-in) var(--p-duration-100) 1 both;
5353

5454
// stylelint-disable-next-line -- Not a breakpoint
@@ -58,7 +58,7 @@
5858
}
5959

6060
.measured.positionedAbove:not(.instant) {
61-
animation: var(--p-keyframes-appear-above) var(--p-duration-200)
61+
animation: var(--p-keyframes-appear-above) var(--p-duration-50)
6262
var(--p-ease-in) var(--p-duration-100) 1 both;
6363

6464
// stylelint-disable-next-line -- Not a breakpoint

0 commit comments

Comments
 (0)