From 056c657721d808a0df48d925a52f179f84cf9a3a Mon Sep 17 00:00:00 2001 From: QiShaoXuan Date: Mon, 30 Jan 2023 18:29:46 +0800 Subject: [PATCH] feat: add positionAbsolute in style helper --- packages/app/src/styles/helper.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/packages/app/src/styles/helper.ts b/packages/app/src/styles/helper.ts index da70c3cd4b..3e5949ae3e 100644 --- a/packages/app/src/styles/helper.ts +++ b/packages/app/src/styles/helper.ts @@ -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, + }; +};