-
Notifications
You must be signed in to change notification settings - Fork 0
/
borderRadius.ts
47 lines (41 loc) · 1.62 KB
/
borderRadius.ts
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import type { CSSProperties } from "../CSSProperties";
export type BorderRadiusLonghands = Required<
Pick<
CSSProperties,
| "borderTopLeftRadius"
| "borderTopRightRadius"
| "borderBottomRightRadius"
| "borderBottomLeftRadius"
>
>;
export function borderRadius(
all: NonNullable<CSSProperties["borderTopLeftRadius"]>,
): BorderRadiusLonghands;
export function borderRadius(
topLeftAndBottomRight: NonNullable<CSSProperties["borderTopLeftRadius"]>,
topRightAndBottomLeft: NonNullable<CSSProperties["borderTopRightRadius"]>,
): BorderRadiusLonghands;
export function borderRadius(
topLeft: NonNullable<CSSProperties["borderTopLeftRadius"]>,
topRightAndBottomLeft: NonNullable<CSSProperties["borderTopRightRadius"]>,
bottomRight: NonNullable<CSSProperties["borderBottomRightRadius"]>,
): BorderRadiusLonghands;
export function borderRadius(
topLeft: NonNullable<CSSProperties["borderTopLeftRadius"]>,
topRight: NonNullable<CSSProperties["borderTopRightRadius"]>,
bottomRight: NonNullable<CSSProperties["borderBottomRightRadius"]>,
bottomLeft: NonNullable<CSSProperties["borderBottomLeftRadius"]>,
): BorderRadiusLonghands;
export function borderRadius(
topLeft: NonNullable<CSSProperties["borderTopLeftRadius"]>,
topRight: NonNullable<CSSProperties["borderTopRightRadius"]> = topLeft,
bottomRight: NonNullable<CSSProperties["borderBottomRightRadius"]> = topLeft,
bottomLeft: NonNullable<CSSProperties["borderBottomLeftRadius"]> = topRight,
): BorderRadiusLonghands {
return {
borderTopLeftRadius: topLeft,
borderTopRightRadius: topRight,
borderBottomRightRadius: bottomRight,
borderBottomLeftRadius: bottomLeft,
};
}