Skip to content

Commit

Permalink
Merge pull request #3940 from SomethingNew71/sass-deprecation-fix
Browse files Browse the repository at this point in the history
Updates deprecated round functions in Sass Build
  • Loading branch information
jgthms authored Nov 27, 2024
2 parents 6374a80 + 125f8f8 commit 4ebf14b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions sass/utilities/css-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@
@mixin register-hsl($name, $value) {
@include register-var(
$name,
round(color.channel($value, "hue", $space: hsl)),
math.round(color.channel($value, "hue", $space: hsl)),
"",
"-h"
);
@include register-var(
$name,
round(color.channel($value, "saturation", $space: hsl)),
math.round(color.channel($value, "saturation", $space: hsl)),
"",
"-s"
);
@include register-var(
$name,
round(color.channel($value, "lightness", $space: hsl)),
math.round(color.channel($value, "lightness", $space: hsl)),
"",
"-l"
);
Expand Down Expand Up @@ -196,9 +196,9 @@
$light: null,
$dark: null
) {
$h: round(color.channel($base, "hue", $space: hsl)); // Hue
$s: round(color.channel($base, "saturation", $space: hsl)); // Saturation
$l: round(color.channel($base, "lightness", $space: hsl)); // Lightness
$h:math.round(color.channel($base, "hue", $space: hsl)); // Hue
$s:math.round(color.channel($base, "saturation", $space: hsl)); // Saturation
$l:math.round(color.channel($base, "lightness", $space: hsl)); // Lightness
$base-lum: fn.bulmaColorLuminance($base);
$l-base: math.round($l % 10); // Get lightness second digit: 53% -> 3%
$l-0: 0%; // 5% or less
Expand Down
6 changes: 3 additions & 3 deletions sass/utilities/functions.scss
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
@if meta.type-of($color) == "color" {
$luminance: bulmaColorLuminance($color);
$luminance-delta: 0.53 - $luminance;
$target-l: round($base-l + $luminance-delta * 53);
$target-l: math.round($base-l + $luminance-delta * 53);

@return color.change($color, $lightness: max($base-l, $target-l));
}
Expand Down Expand Up @@ -192,15 +192,15 @@
}

@function bulmaColorBrightness($n) {
$color-brightness: round(
$color-brightness: math.round(
math.div(
(color.channel($n, "red", $space: rgb) * 299) +
(color.channel($n, "green", $space: rgb) * 587) +
(color.channel($n, "blue", $space: rgb) * 114),
1000
)
);
$light-color: round(
$light-color: math.round(
math.div(
(color.channel(#ffffff, "red", $space: rgb) * 299) +
(color.channel(#ffffff, "green", $space: rgb) * 587) +
Expand Down

0 comments on commit 4ebf14b

Please sign in to comment.