Sha256: 787a4bfc4a9c31b2c8ea731791debd4c558d8494462e52deeebd2a6421e14e19

Contents?: true

Size: 1.16 KB

Versions: 16

Compression:

Stored size: 1.16 KB

Contents

// Calculate margin
// -------------------------------------------------------------------------------
// @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-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 {
			@return fluid-width(get-value(settings, gutter), ((get-value($key, breakpoint) / get-value($key, columns) * $context)));
		}
	} @if get-value(settings, grid) == "fixed" {
		@if $key == "container" or $span == "container" {
			@return 0;
		} @if $context == NULL {
			@return get-value(settings, gutter);
		} @else {
			@return get-value(settings, gutter);
		}
	} @else {
		@return false;
	}
}

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
flint-gs-1.0.9 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-1.0.8 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-1.0.7 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-1.0.6 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-1.0.5 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-1.0.4 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-1.0.3 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-1.0.2 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-1.0.1 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-1.0.0 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-0.1.7 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-0.1.6 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-0.1.5 sass/flint/functions/lib/_calc-margin.scss
flint-gs-0.1.4 sass/flint/functions/lib/_calc-margin.scss
flint-gs-0.1.3 sass/flint/functions/lib/_calc-margin.scss
flint-gs-0.1.2 sass/flint/functions/lib/_calc-margin.scss