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

Version Path
flint-gs-1.3.5 stylesheets/flint/functions/lib/_calc-width.scss
flint-gs-1.3.4 stylesheets/flint/functions/lib/_calc-width.scss
flint-gs-1.3.3 stylesheets/flint/functions/lib/_calc-width.scss
flint-gs-1.3.2 stylesheets/flint/functions/lib/_calc-width.scss
flint-gs-1.3.1 stylesheets/flint/functions/lib/_calc-width.scss
flint-gs-1.3.0 stylesheets/flint/functions/lib/_calc-width.scss
flint-gs-1.2.0 stylesheets/flint/functions/lib/_calc-width.scss
flint-gs-1.1.0 stylesheets/flint/functions/lib/_calc-width.scss