forked from psychobolt/react-pie-menu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSlice.style.js
29 lines (25 loc) · 973 Bytes
/
Slice.style.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import { css } from 'styled-components';
export const container = css`
width: 200%;
height: 200%;
transform-origin: 50% 50%;
border-radius: 50%;
transform: ${({ skew, polar, centralAngle }) => `skew(${-skew}deg) rotate(${((polar ? 90 : centralAngle) / 2) - 90}deg)`};
color: black;
background: radial-gradient(transparent ${({ centerRadius }) => `${centerRadius}, rgba(109, 109, 109, 0.925) ${centerRadius}`});
outline: none;
&:hover {
color: white;
background: radial-gradient(transparent ${({ centerRadius }) => `${centerRadius}, #424242 ${centerRadius}`});
}
`;
export const contentContainer = css`
position: absolute;
width: 100%;
text-align: center;
top: ${({ radius, centralAngle, centerRadius, contentHeight }) => `calc((${centralAngle > 90 ? '50% + ' : ''}${radius} - ${centerRadius}) / 2 - ${contentHeight} / 2)`};
`;
export const content = css`
display: inline-block;
transform: rotate(${({ angle }) => -angle}deg);
`;