@shopgate/engage
Version:
Shopgate's ENGAGE library.
6 lines • 697 B
JavaScript
import{parser}from"./breakpoints";var comparators={'>=':function _(from,to,width){return width>=from;},'>':function _(from,to,width){return width>=to;},'<':function _(from,to,width){return width<from;},'<=':function _(from,to,width){return width<to;},'':function _(from,to,width){return width>=from&&width<to;}};/**
* Tests if responsive condition applies.
* @param {string} breakpoint Breakpoint rule.
* @param {Object} params Parameters needed to generation.
* @returns {string}
*/export var responsiveCondition=function responsiveCondition(breakpoint){var params=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var parsed=parser(comparators,breakpoint,params);return parsed;};