Skip to content

Commit

Permalink
Fix sass deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed Oct 17, 2024
1 parent 6ddb5af commit 36bdfaf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"mocha": "^10.4.0",
"rollup": "^4.16.4",
"rollup-plugin-istanbul": "^5.0.0",
"sass": "^1.79.0",
"sass": "^1.80.0",
"sinon": "^19.0.0",
"sinon-chai": "^3.7.0"
}
Expand Down
3 changes: 2 additions & 1 deletion src/scss/_color-scheme.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
@use "sass:color";
@use "sass:string";
@use "functions" as *;
@use "mixins" as *;

$scheme: '@primer/primitives/dist/styleLint/functional/themes/light.json' !default;

$enable-background-image-linear-gradient: str-index($scheme, '-high-contrast') == null !default;
$enable-background-image-linear-gradient: string.index($scheme, '-high-contrast') == null !default;

$btn-color: json($scheme, button-default-fgColor-rest, value) !default;
$btn-background-color-start: json($scheme, button-default-bgColor-rest, value) !default;
Expand Down
11 changes: 7 additions & 4 deletions src/scss/_mixins.scss
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
@use "sass:color";
@use "sass:map";
@use "sass:math";
@use "sass:meta";
@use "sass:string";
@use "functions" as *;

@mixin blend($args...) {
$declarations: keywords($args);
$background-color: map-get($declarations, "background-color");
$declarations: meta.keywords($args);
$background-color: map.get($declarations, "background-color");

@each $property, $value in $declarations {
@if type-of($value) == color and color.channel($value, "alpha") != 1 {
@if meta.type-of($value) == color and color.channel($value, "alpha") != 1 {
$color: $value;
$red: (1 - color.channel($color, "alpha")) * color.channel($background-color, "red") + color.channel($color, "alpha") * color.channel($color, "red");
$green: (1 - color.channel($color, "alpha")) * color.channel($background-color, "green") + color.channel($color, "alpha") * color.channel($color, "green");
Expand All @@ -31,7 +34,7 @@
$blue: color.channel($color-start, "blue") + math.div(color.channel($color-stop, "blue") - color.channel($color-start, "blue"), $color-stop-percentage) * 100%;
$color-stop: rgb($red, $green, $blue);

filter: unquote("progid:DXImageTransform.Microsoft.Gradient(startColorstr='#{color.ie-hex-str($color-start)}', endColorstr='#{color.ie-hex-str($color-stop)}')");
filter: string.unquote("progid:DXImageTransform.Microsoft.Gradient(startColorstr='#{color.ie-hex-str($color-start)}', endColorstr='#{color.ie-hex-str($color-stop)}')");

:root & {
filter: none;
Expand Down

0 comments on commit 36bdfaf

Please sign in to comment.