UNPKG

@dnanpm/styleguide

Version:

DNA Styleguide repository provides the set of components and theme object used in various DNA projects.

20 lines (16 loc) 768 B
'use strict'; var styledComponents = require('styled-components'); var breakpoints = require('../themes/themeComponents/breakpoints.js'); const getMultipliedSize = (base, multiply) => `${multiply * base.value}${base.unit}`; const getDividedSize = (base, divide) => `${base.value / divide}${base.unit}`; const media = Object.keys(breakpoints.default).reduce((acc, label) => { acc[label] = (literals, ...placeholders) => styledComponents.css ` @media (min-width: ${breakpoints.default[label]}px) { ${styledComponents.css(literals, ...placeholders)}; } `.join(''); return acc; }, {}); exports.getDividedSize = getDividedSize; exports.getMultipliedSize = getMultipliedSize; exports.media = media;