Skip to content

Commit

Permalink
fix: improve tooltip style (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuzmadom authored Dec 13, 2024
1 parent f03a8f2 commit c9667fc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/components/Tooltip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {ChartTooltipContent} from './ChartTooltipContent';

import './styles.scss';

const b = block('d3-tooltip');
const b = block('tooltip');

type TooltipProps = {
dispatcher: Dispatch<object>;
Expand Down Expand Up @@ -47,6 +47,7 @@ export const Tooltip = (props: TooltipProps) => {
return hovered?.length ? (
<Popup
className={b({pinned: tooltipPinned})}
contentClassName={b('popup-content')}
open={true}
anchorRef={anchorRef}
offset={[0, 20]}
Expand Down
11 changes: 7 additions & 4 deletions src/components/Tooltip/styles.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.gcharts-d3-tooltip {
.gcharts-tooltip {
&[class] {
--g-popup-border-width: 0;
pointer-events: none;
Expand All @@ -14,13 +14,16 @@
pointer-events: inherit;
}

&__popup-content {
box-shadow: none;
}

&__content {
padding: 10px 14px;
padding: 8px 14px;

text-wrap: nowrap;

border: 1px solid var(--g-color-line-generic);
border-radius: 3px;
border-radius: 4px;
background-color: var(--g-color-infographics-tooltip-bg);
box-shadow: 0 2px 12px var(--g-color-sfx-shadow);
}
Expand Down

0 comments on commit c9667fc

Please sign in to comment.