aboutsummaryrefslogblamecommitdiffstats
path: root/packages/website/ts/@next/constants/utilities.tsx
blob: 35956c47b0d706585c381309159897ac5855da3b (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                                           
                    








                                                                                  
export interface PaddingInterface {
    padding?: number | Array<'large' | 'default' | number>;
}

interface PaddingSizes {
    [key: string]: string;
}

const PADDING_SIZES: PaddingSizes = {
    'default': '30px',
    'large': '60px',
    'small': '15px',
};

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`;
    }
};