-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(variant/indicator): add submodule to handle + in variants.
- Loading branch information
1 parent
251d89d
commit 9fb0fca
Showing
4 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@forward 'indicator.index.function'; | ||
@forward 'indicator.remove.function'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Modules. | ||
@use '../../string'; | ||
|
||
// Status: DONE | ||
// The `indicator.index()` function. | ||
// @param `$item` | ||
// @param `$indicator` | ||
// @returns | ||
@function index($item, $indicator) { | ||
@each $value in $item { | ||
$index: string.index(#{$value}, $indicator); | ||
@if $index { | ||
@return $index > 0; | ||
} | ||
} | ||
@return false; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Sass. | ||
@use 'sass:list'; | ||
|
||
// Modules. | ||
@use '../../list/remove'; | ||
@use '../../string'; | ||
|
||
// Status: TODO: | ||
// The `indicator.remove()` function. | ||
// @param `$item` | ||
// @param `$indicator` | ||
// @returns | ||
@function remove($item, $indicator) { | ||
$i: 1; | ||
$item: remove.value($item, '+'); | ||
@each $value in $item { | ||
@if type-of($value) == string { | ||
$item: list.set-nth($item, $i, string.replace(#{$value}, all, $indicator, '')); | ||
} | ||
|
||
$i: $i + 1; | ||
} | ||
@return $item; | ||
} |