braid-design-system
Version:
Themeable design system for the SEEK Group
18 lines (17 loc) • 508 B
JavaScript
import { breakpointNames } from "../../css/breakpoints.mjs";
function resolveResponsiveObject(breakpointName, value) {
let resolvedValue = null;
for (const currentBreakpointName of breakpointNames) {
const valueForBreakpoint = value[currentBreakpointName];
if (valueForBreakpoint !== void 0) {
resolvedValue = valueForBreakpoint;
}
if (breakpointName === currentBreakpointName) {
return resolvedValue;
}
}
return resolvedValue;
}
export {
resolveResponsiveObject
};