Sha256: ac5adce03df664d5081fc2879e25598d83a3121fdda601dc2f9feffcd174d4f2

Contents?: true

Size: 1.91 KB

Versions: 3

Compression:

Stored size: 1.91 KB

Contents

// Keeps count of all instances with arguments, stores in global var
// -------------------------------------------------------------------------------
// @dependence `get-value()`
// -------------------------------------------------------------------------------
// @param $key [string] : computed breakpoint of instance
// @param $span [number] : computed span of instance
// @param $context [number] : computed context of instance
// @param $gutter [number] : computed gutter of instance
// @param $shift [number] : computed shift of instance
// @param $outputWidth [number] : computed width of instance
// @param $outputMarginRight [number] : computed right margin of instance
// @param $outputMarginLeft [number] : computed left margin of instance
// -------------------------------------------------------------------------------
// @return instance map

@function instance($key, $span, $context, $gutter, $shift, $outputWidth, $outputMarginRight, $outputMarginLeft) {
	  // Increase the instance count
    $flint__instance-count: $flint__instance-count + 1 !global;
    // Lets clean up the selector a bit...
    $selector-string: selector_string();
    $selector-list: string-to-list($selector-string);
    $selector-cleaned: list-to-string($selector-list, " ");

    $flint__instance: (
		"#{$selector-cleaned}::#{$key}": (
			"instance-count": #{$flint__instance-count},
			"parent-selector": #{if(get-family-instance($key) != false, get-family-instance($key), none)},
			"key": #{$key},
			"breakpoint": #{get-value($key, breakpoint)},
			"columns": #{get-value($key, columns)},
			"span": #{$span},
			"context": #{if($context == "auto", get-instance-value($key, "span"), $context)},
			"gutter": #{$gutter},
			"shift": #{$shift},
			"output": (
				"width": #{$outputWidth},
				"margin-right": #{$outputMarginRight},
				"margin-left": #{$outputMarginLeft}
			)
		)
    );

    @return map-merge($flint__instances, $flint__instance);
}

Version data entries

3 entries across 3 versions & 1 rubygems

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