UNPKG

@ntragas/pouncejstest

Version:

A collection of UI components from Panther labs

38 lines (28 loc) 863 B
"use strict"; exports.__esModule = true; exports.countToColumns = exports.widthToColumns = void 0; // These helper fns are modified versions of the amazing rebass library // https://github.com/rebassjs/rebass/blob/master/packages/layout/src/index.js var px = function px(n) { return typeof n === 'number' ? n + 'px' : n; }; var widthToColumns = function widthToColumns(width) { if (Array.isArray(width)) { return width.map(widthToColumns); } if (width != null) { return "repeat(auto-fit, minmax(" + px(width) + ", 1fr))"; } return null; }; exports.widthToColumns = widthToColumns; var countToColumns = function countToColumns(count) { if (Array.isArray(count)) { return count.map(countToColumns); } if (count != null) { return "repeat(" + count + ", 1fr)"; } return null; }; exports.countToColumns = countToColumns;