@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
11 lines • 985 B
JavaScript
var _templateObject;
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
import { createStyles } from 'antd-style';
import { isString } from 'lodash-es';
export var useStyles = createStyles(function (_ref, _ref2) {
var css = _ref.css;
var rows = _ref2.rows,
maxItemWidth = _ref2.maxItemWidth,
gap = _ref2.gap;
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n --rows: ", ";\n --max-item-width: ", ";\n --gap: ", ";\n\n display: grid !important;\n grid-template-columns: repeat(\n auto-fill,\n minmax(\n max(var(--max-item-width), calc((100% - var(--gap) * (var(--rows) - 1)) / var(--rows))),\n 1fr\n )\n );\n "])), rows, isString(maxItemWidth) ? maxItemWidth : "".concat(maxItemWidth, "px"), isString(gap) ? gap : "".concat(gap, "px"));
});