Sha256: 13991b8600f14327881b7eeaab67c11a48792d52d1b66729a654aa58de3ca30f
Contents?: true
Size: 1.29 KB
Versions: 8
Compression:
Stored size: 1.29 KB
Contents
// Calculate width // ------------------------------------------------------------------------------- // @dependence `get-value()` // @dependence `fluid-width()` // ------------------------------------------------------------------------------- // @param $key [Breakpoint | "container"] : how to calculate value // @param $span [Value] : span // @param $context [Value] : if context is needed // ------------------------------------------------------------------------------- // @return [Value] | false @function calc-width($key, $span, $context: NULL) { @if get-value(settings, grid) == "fluid" { @if $key == "container" or $span == "container" { @return fluid-width(get-value($key, breakpoint), get-value($key, breakpoint)); } @else if $context == NULL { @return fluid-width((get-value($key, breakpoint) / get-value($key, columns) * $span), get-value($key, breakpoint)); } @else { @return fluid-width((get-value($key, breakpoint) / get-value($key, columns) * $span), ((get-value($key, breakpoint) / get-value($key, columns) * $context))); } } @if get-value(settings, grid) == "fixed" { @if $key == "container" or $span == "container" { @return get-value($key, breakpoint); } @else { @return get-value($key, breakpoint) / get-value($key, columns) * $span; } } @else { @return false; } }
Version data entries
8 entries across 8 versions & 1 rubygems