Sha256: 35c628d158531509d528481144ddd3c166741be939fd4b9f4cb16b96a269a02d

Contents?: true

Size: 1.43 KB

Versions: 3

Compression:

Stored size: 1.43 KB

Contents

// Prints debug properties
// -------------------------------------------------------------------------------
// @dependence `printInstance()`
// -------------------------------------------------------------------------------
// @param $calcKey [string] : breakpoint key to search for instance
// -------------------------------------------------------------------------------
// @output instance map

@mixin debugPrintInstance($calcKey) {
  // 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, " ");

	@if get-value(settings, debug-mode) {
		$printKey: "#{$selector-cleaned}" + "::" + "#{$calcKey}";
		@include printInstance( map-get( $flint__instances, unquote($printKey) ) );
	}
}

// Prints all contents of instance
// -------------------------------------------------------------------------------
// @param $instance [map] : instance
// -------------------------------------------------------------------------------
// @output instance map

@mixin printInstance($instance) {

	// Loop through each property in passed instance
	@each $property, $value in $instance {

		// Check if value is output map
		@if is-map($value) {
			@each $mod_property, $mod_value in $value {
				-flint-output-#{$mod_property}: #{$mod_value};
			}
		// Else, print values as flagged comments
		} @else {
			-flint-#{$property}: #{$value};
		}
	}
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
flint-gs-1.6.5 stylesheets/flint/mixins/lib/_print-instance.scss
flint-gs-1.6.4 stylesheets/flint/mixins/lib/_print-instance.scss
flint-gs-1.6.3 stylesheets/flint/mixins/lib/_print-instance.scss