MCPcopy Create free account
hub / github.com/Lobos/react-ui / generate

Function generate

src/utils/grids.js:45–67  ·  view source on GitHub ↗
(width, type, responsive)

Source from the content-addressed store, hash-verified

43}
44
45function generate(width, type, responsive) {
46 if (!width || width <= 0) {
47 return '';
48 }
49
50 if (width > 1) { width = 1; }
51 width = (width * 100).toFixed(4);
52 width = width.substr(0, width.length - 1);
53
54 responsive = responsive || defaultResponsive;
55 let key = responsive + '-' + width.replace('.', '-');
56 if (type === 'grid') {
57 if (!GRIDS[key]) {
58 generateGrid(width, key, responsive);
59 }
60 return `${gridPre}-${key}`;
61 } else {
62 if (!OFFSETS[key]) {
63 generateOffset(width, key, responsive);
64 }
65 return `${offsetPre}-${key}`;
66 }
67}
68
69function generateGrid(width, key, responsive) {
70 GRIDS[key] = true;

Callers 1

getGridFunction · 0.85

Calls 2

generateGridFunction · 0.85
generateOffsetFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…