-
-
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(color.name-indicator-retrieve()): retrieve indicator or multiple…
… indicators from color name.
- Loading branch information
1 parent
d853f93
commit b5679c6
Showing
1 changed file
with
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Functions. | ||
@use '../../../list/list.indexes.function' as list-indexes; | ||
@use '../../../list/list.nth.function' as list-nth; | ||
@use '../adjustment/adjustment.has.function'; | ||
|
||
// Status: DONE | ||
// The `color.indicator-retrieve()` function. | ||
// @param `$color` | ||
// @param `$indicator` | ||
// @arbitrary `$indicators...` | ||
// @returns | ||
@function retrieve($color, $indicator, $indicators...) { | ||
$color: if(adjustment.has($color), list-nth.nth($color, 1), $color); | ||
@return list-nth.nth( | ||
$color, | ||
list-indexes.indexes($color, all, '~=', $indicator, $indicators...)... | ||
); | ||
} | ||
|
||
// Examples. | ||
// @debug retrieve(primary dark ':background', ':'); // :background | ||
// @debug retrieve(primary dark ':color', ':'); // :color | ||
|
||
// multiple | ||
// @debug retrieve(primary dark '!test' ':color', ':', '!'); // '":color" "!test" | ||
|
||
// adjustment | ||
// @debug retrieve((primary dark ':color', 5%), ':'); // :color |