Namespace: Breakpoints:breakpoint-value

Breakpoints:breakpoint-value

Methods

breakpoint-value($value, $breakpoint) → {*|null}

Search for a value, defined for a breakpoint, in a given map of values. The function escalates in a mobile-first manner. So we take the value for the smallest breakpoint and step up the breakpoints one by one until we reach the defined breakpoint. So, if we want the according value for "large", but we only have a value for "medium", we'll get the "medium" value, which, in mobile-first manner, escalates upwards and is the "large" value if nothing else is defined.

Parameters:
Name Type Description
$value * | Map

a map of breakpoint-keyed map of values, or a simple value

$breakpoint Literal | String

either "auto" (to use the current breakpoint) or one of the defined named breakpoints

Source:
Throws:

error if named breakpoint is unknown

Returns:
the breakpoint value or null if nothing was found
Type
* | null
Example
breakpoint-value(
  (
    'small' : 10px,
    'medium' : 20px
  ),
  large
)
  => 20px