UNPKG

@kiwicom/orbit-components

Version:

Orbit-components is a React component library which provides developers with the easiest possible way of building Kiwi.com’s products.

34 lines (32 loc) 1.13 kB
import { css } from "styled-components"; import getJustify from "./getJustify"; import getDirection from "./getDirection"; import getWidth from "./getWidth"; import getDisplay from "./getDisplay"; import getShrink from "./getShrink"; import getWrap from "./getWrap"; import getGrow from "./getGrow"; import getAlign from "./getAlign"; import getSpacingToken from "../../common/getSpacingToken/index"; const getViewportFlexStyles = viewport => props => { const { flex, theme } = props; const { inline, direction, wrap, grow, shrink, basis, justify, align, spaceAfter } = props[viewport]; return css(["", ";width:", ";margin-bottom:", ";"], flex && css(["display:", ";flex-direction:", ";flex-wrap:", ";flex-grow:", ";flex-shrink:", ";flex-basis:", ";justify-content:", ";align-content:", ";align-items:", ";"], getDisplay(inline), getDirection(direction), getWrap(wrap), getGrow(grow), getShrink(shrink), basis, getJustify(justify), getAlign(align), getAlign(align)), getWidth(inline), getSpacingToken({ spaceAfter, theme })); }; export default getViewportFlexStyles;