stylesheets/flint/functions/lib/_get-substring.scss in flint-gs-1.6.1 vs stylesheets/flint/functions/lib/_get-substring.scss in flint-gs-1.6.2

- old
+ new

@@ -1,24 +1,24 @@ -// Gets substring from string -// ------------------------------------------------------------------------------- -// @dependence `string-to-list()` -// ------------------------------------------------------------------------------- -// @param $full-string [string] : string that contains substring -// @param $depth [number | string] : depth of substring -// ------------------------------------------------------------------------------- -// @return [string] - -@function get-substring($full-string, $depth) { - @if is-string($full-string) { - $get-substring: string-to-list($full-string); - - @if $depth == "last" { - @return nth($get-substring, length($get-substring)); - } @else if $depth == "first" { - @return nth($get-substring, 1); - } @else { - @return nth($get-substring, $depth); - } - } @else { - @return "You did not input a valid string: #{$full-string}"; - } +// Gets substring from string +// ------------------------------------------------------------------------------- +// @dependence `string-to-list()` +// ------------------------------------------------------------------------------- +// @param $full-string [string] : string that contains substring +// @param $depth [number | string] : depth of substring +// ------------------------------------------------------------------------------- +// @return [string] + +@function get-substring($full-string, $depth) { + @if is-string($full-string) { + $get-substring: string-to-list($full-string); + + @if $depth == "last" { + @return nth($get-substring, length($get-substring)); + } @else if $depth == "first" { + @return nth($get-substring, 1); + } @else { + @return nth($get-substring, $depth); + } + } @else { + @return "You did not input a valid string: #{$full-string}"; + } } \ No newline at end of file