stylesheets/flint/functions/lib/_calc-width.scss in flint-gs-1.3.5 vs stylesheets/flint/functions/lib/_calc-width.scss in flint-gs-1.3.6

- old
+ new

@@ -1,29 +1,29 @@ // 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 +// @param $key [string] : key for lookup +// @param $span [integer] : span value of element +// @param $context [integer] : context value of element // ------------------------------------------------------------------------------- -// @return [Value] | false +// @return calculated value | false -@function calc-width($key, $span, $context: NULL) { - @if get-value(settings, grid) == "fluid" { +@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)); + @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))); + @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 get-value("settings", "grid") == "fixed" { @if $key == "container" or $span == "container" { - @return get-value($key, breakpoint); + @return get-value($key, "breakpoint"); } @else { - @return get-value($key, breakpoint) / get-value($key, columns) * $span; + @return get-value($key, "breakpoint") / get-value($key, "columns") * $span; } } @else { @return false; } } \ No newline at end of file