Skip to content

Commit

Permalink
feat(color.palette-get()): add updated get() to use instead of old …
Browse files Browse the repository at this point in the history
…get function.
  • Loading branch information
sciborrudnicki committed Dec 13, 2023
1 parent f31cd3a commit 72d34cc
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions color/palette/_palette.get.new.function.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Functions.
@use '../name/name.index.function';

// Status: DONE
// The `palette.get()` function returns palette variant of `$name` or colors from variant `$class`.
// @param `$palette` Color palettes to get variant or variant color.
// @param `$name` Palette name or its part of `string` or `list` type to get from `$palette`.
// @param `$class` Variant class name or its part of `string` or `list` type to get from palette.
// @returns The returned value is palette variants or variant colors .
@function get($palette, $name, $class: null) {
@if $name {
@each $key, $value in $palette {
@if name.index($key, $name) {
@if $class {
@return get($value, $class);
} @else {
@return $value;
}
}
}
}
@return null;
}

0 comments on commit 72d34cc

Please sign in to comment.