diff options
Diffstat (limited to 'packages/website/ts/@next/constants')
-rw-r--r-- | packages/website/ts/@next/constants/utilities.tsx | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/website/ts/@next/constants/utilities.tsx b/packages/website/ts/@next/constants/utilities.tsx new file mode 100644 index 000000000..7d9313583 --- /dev/null +++ b/packages/website/ts/@next/constants/utilities.tsx @@ -0,0 +1,20 @@ +export interface PaddingInterface { + padding?: number | Array<'large' | 'default' | number>; +} + +interface PaddingSizes { + [key: string]: string; +} + +const PADDING_SIZES: PaddingSizes = { + 'default': '30px', + 'large': '60px', +}; + +export const getCSSPadding = (value: number | Array<string | number>): string => { + if (Array.isArray(value)) { + return value.map(val => PADDING_SIZES[val] || `${val}px`).join(' '); + } else { + return `${value}px`; + } +}; |