}
}
+/// Return the best breakpoint to use according to the calling context. It returns in order:
+/// 1. the given `$value` argument if it is not null.
+/// 2. the global breakpoint context `$-zf-size` if it is not null (like if called inside then `breakpoint()` mixin)
+/// 3. the given `$default` argument.
+/// @access private
+///
+/// @param {Keyword} $value [null] - Breakpoint to use in priority if non-null.
+/// @param {Keyword} $default [null] - Breakpoint to use by default if no other value can be used.
+///
+/// @return {Keyword} The resolved breakpoint.
+@function -zf-current-breakpoint($value: null, $default: null) {
+ @if ($value != null) {
+ @return $value;
+ }
+ @else if (variable-exists(-zf-size) and type-of($-zf-size) != 'number') and $-zf-size != null {
+ @return $-zf-size;
+ }
+ @else {
+ @return $default;
+ }
+}
+
$small-up: '';
$small-only: '';
}
}
+ // Use the contextual breakpoint by default. Otherwise revert to the smallest breakpoint
+ $breakpoint: -zf-current-breakpoint($breakpoint);
@if($breakpoint == null) {
- // If `$bp-size` is available then use this, otherwise revert to the smallest bp.
- @if(variable-exists(-zf-size) and type-of($-zf-size) != 'number') and $-zf-size != null {
- $breakpoint: $-zf-size;
- }
- @else {
- $breakpoint: $-zf-zero-breakpoint;
- $bp-is-fallback: true;
- }
+ $breakpoint: $-zf-zero-breakpoint;
+ $bp-is-fallback: true;
}
// Get the default gutter position according to cell direction