Creating util Size class

This commit is contained in:
apanizo 2018-08-31 12:22:38 +02:00
parent df4c7439df
commit f7c0a13ee2
1 changed files with 21 additions and 0 deletions

21
src/theme/size.js Normal file
View File

@ -0,0 +1,21 @@
// @flow
import { xs, sm, md, lg, xl } from '~/theme/variables'
export type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
export const getSize = (size: Size) => {
switch (size) {
case 'xs':
return xs
case 'sm':
return sm
case 'md':
return md
case 'lg':
return lg
case 'xl':
return xl
default:
return md
}
}