feat: add positionAbsolute in style helper

This commit is contained in:
QiShaoXuan
2023-01-30 18:29:46 +08:00
parent 0636622158
commit 056c657721
+26
View File
@@ -117,3 +117,29 @@ export const textEllipsis = (lineNum = 1): CSSProperties => {
whiteSpace: 'nowrap',
};
};
export const positionAbsolute = ({
left,
top,
right,
bottom,
}: {
left?: CSSProperties['left'];
top?: CSSProperties['top'];
right?: CSSProperties['right'];
bottom?: CSSProperties['bottom'];
}): {
position: CSSProperties['position'];
left: CSSProperties['left'];
top: CSSProperties['top'];
right: CSSProperties['right'];
bottom: CSSProperties['bottom'];
} => {
return {
position: 'absolute',
left,
top,
right,
bottom,
};
};