@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
14 lines (11 loc) • 609 B
JavaScript
import { getBreakpointValue, getSize } from '@mantine/styles';
function getSortedBreakpoints(theme, breakpoints) {
if (breakpoints.length === 0) {
return breakpoints;
}
const property = "maxWidth" in breakpoints[0] ? "maxWidth" : "minWidth";
const sorted = [...breakpoints].sort((a, b) => getBreakpointValue(getSize({ size: b[property], sizes: theme.breakpoints })) - getBreakpointValue(getSize({ size: a[property], sizes: theme.breakpoints })));
return property === "minWidth" ? sorted.reverse() : sorted;
}
export { getSortedBreakpoints };
//# sourceMappingURL=get-sorted-breakpoints.js.map