mq_to($to)
  s("screen and (max-width: %s)", $to - 1)
mq_from($from)
  s("screen and (min-width: %s)", $from)
mq_from_to($from, $to)
  s("screen and (min-width: %s) and (max-width: %s)", $from, $to - 1)
mq_from_and_print($from)
  s("screen and (min-width: %s), print", $from)

// converts breakpoints defined in json file to variables:
// { "S": 320 } -> $breakpoint-S = 320
json(pathjoin('tokens', 'breakpoints.json'), null, '$breakpoint-')

$breakpoint-s = unit($breakpoint-S, 'px')
$breakpoint-m = unit($breakpoint-M, 'px')
$breakpoint-l = unit($breakpoint-L, 'px')
$breakpoint-xl = unit($breakpoint-XL, 'px')
$breakpoint-xxl = unit($breakpoint-XXL, 'px')

$mq-up_to_m = mq_to($breakpoint-m)
$mq-up_to_l = mq_to($breakpoint-l)
$mq-up_to_xl = mq_to($breakpoint-xl)
$mq-up_to_xxl = mq_to($breakpoint-xxl)

$mq-m_and_up = mq_from($breakpoint-m)
$mq-l_and_up = mq_from($breakpoint-l)
$mq-xl_and_up = mq_from($breakpoint-xl)
$mq-xxl_and_up = mq_from($breakpoint-xxl)

$mq-s_to_m = mq_from_to($breakpoint-s, $breakpoint-m)
$mq-m_to_l = mq_from_to($breakpoint-m, $breakpoint-l)
$mq-l_to_xl = mq_from_to($breakpoint-l, $breakpoint-xl)
$mq-xl_to_xxl = mq_from_to($breakpoint-xl, $breakpoint-xxl)
