Skip to content

Commit d35966a

Browse files
feat: consistent arrow rotation
1 parent d57f6c7 commit d35966a

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

Diff for: src/components/Tooltip/styles.module.css

+15
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,24 @@
88
.arrow {
99
width: 8px;
1010
height: 8px;
11+
}
12+
13+
[class*='react-tooltip__place-top'] > .arrow {
1114
transform: rotate(45deg);
1215
}
1316

17+
[class*='react-tooltip__place-right'] > .arrow {
18+
transform: rotate(135deg);
19+
}
20+
21+
[class*='react-tooltip__place-bottom'] > .arrow {
22+
transform: rotate(225deg);
23+
}
24+
25+
[class*='react-tooltip__place-left'] > .arrow {
26+
transform: rotate(315deg);
27+
}
28+
1429
/** Types variant **/
1530
.dark {
1631
background: var(--rt-color-dark);

Diff for: src/utils/compute-positions.ts

+4-8
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,10 @@ export const computeTooltipPosition = async ({
4444
left: 'right',
4545
}[placement.split('-')[0]] ?? 'bottom'
4646

47-
const borderSide =
48-
border &&
49-
{
50-
top: { borderBottom: border, borderRight: border },
51-
right: { borderBottom: border, borderLeft: border },
52-
bottom: { borderTop: border, borderLeft: border },
53-
left: { borderTop: border, borderRight: border },
54-
}[placement.split('-')[0]]
47+
const borderSide = border && {
48+
borderBottom: border,
49+
borderRight: border,
50+
}
5551

5652
let borderWidth = 0
5753
if (border) {

0 commit comments

Comments
 (0)