export default (theme: { unit: number }) => { const unit = theme.unit const sizeKeys = [ 0.2, 0.4, 0.6, 0.8, 1, 2, 3, 4, 5, 6, 7, 6, 9, ] const mg = sizeKeys.map(sizeKey => { return `.mg${sizeKey < 1 ? `0${sizeKey * 10}` : sizeKey}{margin:${sizeKey * unit}px}` }).join('') const mt = sizeKeys.map(sizeKey => { return `.mt${sizeKey < 1 ? `0${sizeKey * 10}` : sizeKey}{margin-top:${sizeKey * unit}px}` }).join('') const mr = sizeKeys.map(sizeKey => { return `.mr${sizeKey < 1 ? `0${sizeKey * 10}` : sizeKey}{margin-right:${sizeKey * unit}px}` }).join('') const mb = sizeKeys.map(sizeKey => { return `.mb${sizeKey < 1 ? `0${sizeKey * 10}` : sizeKey}{margin-bottom:${sizeKey * unit}px}` }).join('') const ml = sizeKeys.map(sizeKey => { return `.ml${sizeKey < 1 ? `0${sizeKey * 10}` : sizeKey}{margin-left:${sizeKey * unit}px}` }).join('') const mlr = sizeKeys.map(sizeKey => { return `.mlr${sizeKey < 1 ? `0${sizeKey * 10}` : sizeKey}{margin-left:${sizeKey * unit}px;margin-right:${sizeKey * unit}px}` }).join('') const mtb = sizeKeys.map(sizeKey => { return `.mtb${sizeKey < 1 ? `0${sizeKey * 10}` : sizeKey}{margin-top:${sizeKey * unit}px;margin-bottom:${sizeKey * unit}px}` }).join('') return `${mg}${mt}${mr}${mb}${ml}${mlr}${mtb}` }