Skip to content

Commit f6d79f6

Browse files
committed
feat(tooltip): migrate to semantic colors
1 parent 0936f95 commit f6d79f6

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/components/Tooltip/Tooltip.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import styled, { keyframes } from 'styled-components';
44
import { usePopper } from 'react-popper';
55
import { Placement } from '@popperjs/core/lib/enums';
66
import { variant } from 'styled-system';
7-
import { MediaQueries, SemanticColors } from '../../essentials';
7+
import { MediaQueries } from '../../essentials';
8+
import { getSemanticValue } from '../../utils/cssVariables';
89
import { get } from '../../utils/themeGet';
910
import { Text } from '../Text/Text';
1011
import { mapPlacementWithDeprecationWarning, TooltipPlacement } from './TooltipPlacement';
@@ -88,7 +89,7 @@ interface TooltipBodyProps {
8889
const TooltipBody = styled.div<TooltipBodyProps>`
8990
position: relative;
9091
background-color: ${p =>
91-
p.inverted ? SemanticColors.background.secondary : SemanticColors.background.primaryEmphasized};
92+
getSemanticValue(p.inverted ? 'background-secondary-default' : 'background-primary-emphasized')};
9293
padding: 0.25rem 0.5rem;
9394
border-radius: ${get('radii.2')};
9495
opacity: 0;
@@ -112,7 +113,7 @@ const TooltipBody = styled.div<TooltipBodyProps>`
112113
pointer-events: none;
113114
border: 0.25rem solid rgba(0, 0, 0, 0);
114115
border-bottom-color: ${p =>
115-
p.inverted ? SemanticColors.background.secondary : SemanticColors.background.primaryEmphasized};
116+
getSemanticValue(p.inverted ? 'background-secondary-default' : 'background-primary-emphasized')};
116117
margin-left: -0.25rem;
117118
118119
${arrowPlacementStyles}

src/components/Tooltip/docs/TooltipPlacementExample.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import * as React from 'react';
33
import styled from 'styled-components';
44
import { Placement } from '@popperjs/core/lib/enums';
55
import { RadioButton, Tooltip } from '../..';
6-
import { Colors, MediaQueries } from '../../../essentials';
6+
import { MediaQueries } from '../../../essentials';
7+
import { getSemanticValue } from '../../../utils/cssVariables';
78

89
const TargetSquare = styled.div`
9-
background: ${Colors.BUMPY_MAGENTA_50};
10-
color: ${Colors.BUMPY_MAGENTA_1000};
11-
border: 0.0625rem solid ${Colors.BUMPY_MAGENTA_350};
10+
background: ${getSemanticValue('background-highlight')};
11+
color: ${getSemanticValue('text-primaryInverted')};
1212
font-size: 0.75rem;
1313
cursor: default;
1414
width: 7rem;

0 commit comments

Comments
 (0)