PHP Classes

File: engine/modules/contrib/foundation/source/_vendor/sassy-lists/stylesheets/functions/_replace.scss

Recommend this page to a friend!
  Classes of Aldo Tripiciano   Quanta CMS   engine/modules/contrib/foundation/source/_vendor/sassy-lists/stylesheets/functions/_replace.scss   Download  
File: engine/modules/contrib/foundation/source/_vendor/sassy-lists/stylesheets/functions/_replace.scss
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Quanta CMS
Manage content that works without a database
Author: By
Last change:
Date: 5 years ago
Size: 917 bytes
 

Contents

Class file image Download
/// /// Replaces `$old` by `$new` in `$list`. /// /// @ignore Documentation: http://at-import.github.io/SassyLists/documentation/#function-sl-replace /// /// @requires sl-is-true /// @requires sl-purge /// @requires sl-to-list /// /// @param {List} $list - list to update /// @param {*} $old - value to replace /// @param {*} $value - new value for $old /// /// @example /// sl-replace(a b c, b, z) /// // a z c /// /// @example /// sl-replace(a b c, y, z) /// // a b c /// /// @return {List} /// @function sl-replace($list, $old, $value) { $_: sl-missing-dependencies('sl-is-true', 'sl-purge', 'sl-to-list'); $running: true; @while $running { $index: index($list, $old); @if not $index { $running: false; } @else { $list: set-nth($list, $index, $value); } } $list: if(sl-is-true($value), $list, sl-purge($list)); @return sl-to-list($list); }