Skip to content

Commit fa31439

Browse files
LFDanLudannify
andauthored
Tooltip design fixes (#1515)
* modify default distance between tooltip and button * adjusting tooltip margin so large scale tip distance is 5px * removing accidental comment * updating comment for tooltip offset Co-authored-by: Danni <[email protected]>
1 parent dd52b8d commit fa31439

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/@adobe/spectrum-css-temp/components/tooltip/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ governing permissions and limitations under the License.
1414
@import '../overlay/index.css';
1515

1616
:root {
17-
--spectrum-tooltip-target-offset: 3px;
17+
--spectrum-tooltip-target-offset: var(--spectrum-global-dimension-size-40);
1818
/* This variable needs to be updated in Spectrum DNA. Using the height variable so it scales to spectrum-large */
1919
--spectrum-tooltip-tip-width: var(--spectrum-tooltip-tip-height);
2020
}

packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {useOverlayPosition} from '@react-aria/overlays';
1919
import {useTooltipTrigger} from '@react-aria/tooltip';
2020
import {useTooltipTriggerState} from '@react-stately/tooltip';
2121

22-
const DEFAULT_OFFSET = 7; // Closest visual match to Spectrum's mocks
22+
const DEFAULT_OFFSET = -1; // Offset needed to reach 4px/5px (med/large) distance between tooltip and trigger button
2323
const DEFAULT_CROSS_OFFSET = 0;
2424

2525
function TooltipTrigger(props: SpectrumTooltipTriggerProps) {

0 commit comments

Comments
 (0)