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

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