UNPKG

1.08 kBJavaScriptView Raw
1import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
2import generateUtilityClass from '@mui/utils/generateUtilityClass';
3export function getGridUtilityClass(slot) {
4 return generateUtilityClass('MuiGrid', slot);
5}
6const SPACINGS = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
7const DIRECTIONS = ['column-reverse', 'column', 'row-reverse', 'row'];
8const WRAPS = ['nowrap', 'wrap-reverse', 'wrap'];
9const GRID_SIZES = ['auto', true, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
10const gridClasses = generateUtilityClasses('MuiGrid', ['root', 'container', 'item', 'zeroMinWidth',
11// spacings
12...SPACINGS.map(spacing => `spacing-xs-${spacing}`),
13// direction values
14...DIRECTIONS.map(direction => `direction-xs-${direction}`),
15// wrap values
16...WRAPS.map(wrap => `wrap-xs-${wrap}`),
17// grid sizes for all breakpoints
18...GRID_SIZES.map(size => `grid-xs-${size}`), ...GRID_SIZES.map(size => `grid-sm-${size}`), ...GRID_SIZES.map(size => `grid-md-${size}`), ...GRID_SIZES.map(size => `grid-lg-${size}`), ...GRID_SIZES.map(size => `grid-xl-${size}`)]);
19export default gridClasses;
\No newline at end of file