Sha256: 2d5ad216db231a6c8fda5e08c0a82d3ad6044a9ee3ecb0f9cfce7098892b6022

Contents?: true

Size: 758 Bytes

Versions: 24

Compression:

Stored size: 758 Bytes

Contents

// Replaces $old by $new in $list
// -------------------------------------------------------------------------------
// @documentation http://sassylists.com/documentation.html#replace
// -------------------------------------------------------------------------------
// @param $list [List] : list
// @param $old [Literal] : value to replace
// @param $value [Literal] : new value for $old
// -------------------------------------------------------------------------------
// @return [List]

@function replace($list, $old, $value) {
  $running: true;

	@while $running {
		$index: index($list, $old);

		@if not $index {
			$running: false;
		} @else {
			$list: set-nth($list, $index, $value);
		}
	}

	@return if(not is-true($value), purge($list), $list);
}

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
flint-gs-1.3.5 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.3.4 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.3.3 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.3.2 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.3.1 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.3.0 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.2.0 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.1.0 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.0.9 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.0.8 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.0.7 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.0.6 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.0.5 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.0.4 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.0.3 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.0.2 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.0.1 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.0.0 stylesheets/flint/functions/lib/_replace.scss
flint-gs-0.1.7 stylesheets/flint/functions/lib/_replace.scss
flint-gs-0.1.6 stylesheets/flint/functions/lib/_replace.scss