Skip to content

Commit

Permalink
fix(@clayui/css): Global Functions use Clay Color Functions that supp…
Browse files Browse the repository at this point in the history
…ort CSS Custom Properties with fallback value
  • Loading branch information
pat270 committed Oct 1, 2021
1 parent 189e281 commit e7b1abf
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions packages/clay-css/src/scss/functions/_global-functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/// @group globals
////

@import '_color-functions.scss';
@import '_lx-icons-generated.scss';
@import '_type-conversion-functions.scss';

Expand Down Expand Up @@ -176,7 +177,7 @@
} @else {
@return linear-gradient(
180deg,
mix(clay-get-fallback($body-bg), $gradient, 15%),
clay-mix($body-bg, $gradient, 15%),
$gradient
);
}
Expand Down Expand Up @@ -459,9 +460,13 @@
/// @param {Color} $light[$yiq-text-light] - The color to return if `$color` < `$yiq-contrasted-threshold`

@function color-yiq($color, $dark: null, $light: null, $threshold: null) {
$r: red($color);
$g: green($color);
$b: blue($color);
@if (is-css-var($color)) {
$color: clay-get-fallback($color);
}

$r: clay-red($color);
$g: clay-green($color);
$b: clay-blue($color);

$yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;

Expand Down Expand Up @@ -558,7 +563,7 @@
$color-interval
);

@return mix($color-base, $color, $level * $color-interval);
@return clay-mix($color-base, $color, $level * $color-interval);
}

/// A Bootstrap 4 function that returns a CSS `calc` addition expression. This is their workaround for returning a valid calc value with `null` variables.
Expand Down

0 comments on commit e7b1abf

Please sign in to comment.