-
Notifications
You must be signed in to change notification settings - Fork 0
/
border.ts
26 lines (24 loc) · 879 Bytes
/
border.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
import type { CSSProperties } from "../CSSProperties";
import { borderColor, BorderColorLonghands } from "./borderColor";
import {
borderImage,
BorderImageLonghandsWithInitialValues,
} from "./borderImage";
import { borderStyle, BorderStyleLonghands } from "./borderStyle";
import { borderWidth, BorderWidthLonghands } from "./borderWidth";
export type BorderLonghands = BorderWidthLonghands &
BorderColorLonghands &
BorderStyleLonghands &
BorderImageLonghandsWithInitialValues;
export function border(
width: NonNullable<CSSProperties["borderTopWidth"]>,
color: NonNullable<CSSProperties["borderTopColor"]> = "currentcolor",
style: NonNullable<CSSProperties["borderTopStyle"]> = "solid",
): BorderLonghands {
return Object.assign(
borderWidth(width),
borderColor(color),
borderStyle(style),
borderImage("none") as BorderImageLonghandsWithInitialValues,
);
}