Sha256: 755ca9d05c301548fe33f2aadbdf9f570d761838b9d1744633c6f043ded2b58c

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

// Calculate margin
// -------------------------------------------------------------------------------
// @param $key [string] : key for lookup
// @param $span [number] : span value of element
// @param $context [number] : context value of element
// -------------------------------------------------------------------------------
// @return calculated 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

3 entries across 3 versions & 1 rubygems

Version Path
flint-gs-1.6.5 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-1.6.4 stylesheets/flint/functions/lib/_calc-margin.scss
flint-gs-1.6.3 stylesheets/flint/functions/lib/_calc-margin.scss