-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspacing.ts
17 lines (13 loc) · 861 Bytes
/
spacing.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { css } from 'react-emotion'
import ds from './design-system'
import { BreakpointNames, mediaquery } from './settings/responsive'
export const spacing = {
m: (bp: BreakpointNames, unit: number) => css(mediaquery(bp, `margin: ${ds.spacing(unit)};`)),
mt: (bp: BreakpointNames, unit: number) => css(mediaquery(bp, `margin-top: ${ds.spacing(unit)};`)),
mb: (bp: BreakpointNames, unit: number) => css(mediaquery(bp, `margin-bottom: ${ds.spacing(unit)};`)),
ml: (bp: BreakpointNames, unit: number) => css(mediaquery(bp, `margin-left: ${ds.spacing(unit)};`)),
mr: (bp: BreakpointNames, unit: number) => css(mediaquery(bp, `margin-right: ${ds.spacing(unit)};`)),
mtb: (bp: BreakpointNames, unit: number) =>
css(mediaquery(bp, `margin-top: ${ds.spacing(unit)}; margin-bottom: ${ds.spacing(unit)};`)),
}
export default spacing