Sha256: 8829fd5a8dc794d78e426f1f7b900cdc9a716874777df206409f71847c2ee640

Contents?: true

Size: 1.91 KB

Versions: 4

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

4 entries across 4 versions & 1 rubygems

Version Path
flint-gs-1.6.2 stylesheets/flint/functions/lib/_instance.scss
flint-gs-1.6.0 stylesheets/flint/functions/lib/_instance.scss
flint-gs-1.5.0 stylesheets/flint/functions/lib/_instance.scss
flint-gs-1.4.0 stylesheets/flint/functions/lib/_instance.scss