From 3c7dca37f5f596aa47978e3a706db7a181747d01 Mon Sep 17 00:00:00 2001
From: Ezekiel Aquino <ezekiel@bakkenbaeck.no>
Date: Tue, 4 Dec 2018 16:30:12 +0100
Subject: Adds padding prop to text elements

---
 packages/website/ts/@next/constants/utilities.tsx | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 packages/website/ts/@next/constants/utilities.tsx

(limited to 'packages/website/ts/@next/constants/utilities.tsx')

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`;
+    }
+};
-- 
cgit v1.2.3

