Skip to content

Commit

Permalink
feat(color/name): add color.name-add() function to add color name t…
Browse files Browse the repository at this point in the history
…o list of colors.
  • Loading branch information
sciborrudnicki committed Dec 2, 2023
1 parent 79ac36b commit d1d571b
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions color/functions/name/_name.add.function.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Modules.
@use '../../../list';

// Functions.
@use '../color.name.function' as *;
@use 'name.index.function' as *;

// Status: DONE
// The `color.name-add()` function.
// @param `$names`
// @arbitrary `$colors...`
// @returns
@function add($names, $colors...) {
@each $name in $colors {
@if not list.index($name, color) {
$name: name($name);
}

$names: list.append($names, $name, list.separator($names))
}
@return $names;
}

// Examples.
// @debug add((accent color, primary color, secondary color dark), secondary light, primary dark);
// @debug add((accent color, primary color, secondary color dark), secondary light, (primary dark, 5%));

0 comments on commit d1d571b

Please sign in to comment.