Skip to content

Commit

Permalink
ability(functions/color): use the get-color-name() function in the …
Browse files Browse the repository at this point in the history
…`get-var-hue()` `get-var-saturation()` and `get-var-lightness()` functions to have the ability to pass the color code.
  • Loading branch information
sciborrudnicki committed Aug 6, 2022
1 parent 49b8a57 commit 6b3d888
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/functions/color/hsla/_get-var-hue.function.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use '../../../variables' as *;
@use '../get-color-name.function' as *;

// The function returns the CSS variable hue color of the given `$name` and `$prefix`.
@function get-var-hue($name, $prefix: $var-prefix) {
@return var(--#{$prefix}-#{$name}-#{$var-hue});
@return var(--#{$prefix}-#{get-color-name($name)}-#{$var-hue});
}
3 changes: 2 additions & 1 deletion src/functions/color/hsla/_get-var-lightness.function.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use '../../../variables' as *;
@use '../get-color-name.function' as *;

// The function returns the CSS variable lightness color of the given `$name` and `$prefix`.
@function get-var-lightness($name, $prefix: $var-prefix) {
@return var(--#{$prefix}-#{$name}-#{$var-lightness});
@return var(--#{$prefix}-#{get-color-name($name)}-#{$var-lightness});
}
3 changes: 2 additions & 1 deletion src/functions/color/hsla/_get-var-saturation.function.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@use '../../../variables' as *;
@use '../get-color-name.function' as *;

// The function returns the CSS variable saturation color of the given `$name` and `$prefix`.
@function get-var-saturation($name, $prefix: $var-prefix) {
@return var(--#{$prefix}-#{$name}-#{$var-saturation});
@return var(--#{$prefix}-#{get-color-name($name)}-#{$var-saturation});
}

0 comments on commit 6b3d888

Please sign in to comment.