Skip to content

Commit 6e1ef8d

Browse files
committed
Center menu items around menu toggle if it has dynamic size
1 parent bae613f commit 6e1ef8d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/CircleMenuItem/StyledCircleMenuItem.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ interface Props {
99
export const StyledCircleMenuItem = styled.li<Props>`
1010
position: absolute;
1111
top: 50%;
12-
transform: translateY(-50%);
12+
left: 50%;
13+
transform: translate(-50%, -50%);
1314
visibility: hidden;
1415
opacity: 0;
1516
transition: all 0.5s;
@@ -18,7 +19,7 @@ export const StyledCircleMenuItem = styled.li<Props>`
1819
${({ menuActive, rotationAngle, $radius }) =>
1920
menuActive &&
2021
`
21-
transform: translateY(-50%) rotate(${rotationAngle}deg)
22+
transform: translate(-50%, -50%) rotate(${rotationAngle}deg)
2223
translate(${$radius}rem) rotate(${-rotationAngle}deg);
2324
visibility: visible;
2425
opacity: 1;

0 commit comments

Comments
 (0)