Sha256: ef9b22320c439903c2ea61d4266ec926ad0773320226dc960ff960802ed5fb71

Contents?: true

Size: 758 Bytes

Versions: 8

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

8 entries across 8 versions & 1 rubygems

Version Path
flint-gs-1.6.5 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.6.4 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.6.3 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.6.2 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.6.0 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.5.0 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.4.0 stylesheets/flint/functions/lib/_replace.scss
flint-gs-1.3.6 stylesheets/flint/functions/lib/_replace.scss