Sha256: 164876ec044360229401963cd6963c975f3c9c1c2a160c2667fbff6627237a42
Contents?: true
Size: 1.31 KB
Versions: 8
Compression:
Stored size: 1.31 KB
Contents
// Calculate margin // ------------------------------------------------------------------------------- // @dependence `get-value()` // @dependence `fluid-width()` // ------------------------------------------------------------------------------- // @param $key [Breakpoint | "container"] : key for lookup // @param $span [Value] : span of element // @param $context [Value] : context of element // ------------------------------------------------------------------------------- // @return [Value] | false @function calc-margin($key, $span, $context: NULL) { @if get-value(settings, grid) == "fluid" { @if $key == "container" or $span == "container" { @return 0; } @else if $context == NULL { @return fluid-width(get-value(settings, gutter), get-value($key, breakpoint)); } @else if $context <= get-value($key, columns) { @return fluid-width(get-value(settings, gutter), ((get-value($key, breakpoint) / get-value($key, columns) * $context))); } @else { @return fluid-width(get-value(settings, gutter) / get-value($key, columns) * $context, ((get-value($key, breakpoint) / get-value($key, columns) * $context))); } } @if get-value(settings, grid) == "fixed" { @if $key == "container" or $span == "container" { @return 0; } @else { @return get-value(settings, gutter); } } @else { @return false; } }
Version data entries
8 entries across 8 versions & 1 rubygems