Skip to content

fix(adapter): Sass を 1.98.0 にアップデートし、非推奨の color 関数を修正#97

Merged
piyoppi merged 3 commits into
pepabo:mainfrom
Colorful12:fix/update-sass-to-v1-2
Apr 10, 2026
Merged

fix(adapter): Sass を 1.98.0 にアップデートし、非推奨の color 関数を修正#97
piyoppi merged 3 commits into
pepabo:mainfrom
Colorful12:fix/update-sass-to-v1-2

Conversation

@Colorful12
Copy link
Copy Markdown

背景

packages/adapter/functions/_helpers.scss-compose-luminance 関数が Sass 1.79+ で非推奨となった color.red() / color.green() / color.blue() を使っているため、ビルド時に大量の警告が出ていました。

これを解消しようと別途 #94 を作成しましたが、color.channel() は Sass 1.79 で追加された関数であり、当時の Sass バージョン(1.62.1)では動作しないことが判明しました。
そのため、Sass 自体のバージョンアップも合わせて対応しました(#95 の出し直し)。

なお、以前 #78 で同様の修正が試みられましたが、同じ理由でリバート(#79)されていました。

変更内容

1. sass を 1.98.0 にアップデート

  • package.json
  • packages/components-web/package.json
  • packages/stories-web/package.json

2. _helpers.scss の修正

color.red/green/bluecolor.channel() に置換:

// Before
$red: -compose-linear-channel-value(color.red($color));
$green: -compose-linear-channel-value(color.green($color));
$blue: -compose-linear-channel-value(color.blue($color));

// After
$red: -compose-linear-channel-value(color.channel($color, "red", $space: rgb));
$green: -compose-linear-channel-value(color.channel($color, "green", $space: rgb));
$blue: -compose-linear-channel-value(color.channel($color, "blue", $space: rgb));

$space: rgb を明示することで、旧 API と同じく sRGB の各チャンネル値(0〜255)を返します。
参考: https://sass-lang.com/documentation/breaking-changes/color-functions/

get-foreground-brightness 関数を削除:

自己再帰による無限ループかつ未使用の関数だったため削除しました。

ビルド確認

npm run build を実行し、ビルドが通ることを確認しました。

Successfully ran target build for 4 projects

修正前に出ていた以下の警告も解消されています:

  • Deprecation color.red() is deprecated
  • Deprecation color.green() is deprecated
  • Deprecation color.blue() is deprecated
  • Deprecation [if-function]

@Colorful12
Copy link
Copy Markdown
Author

こちらと同じ内容です!

@Colorful12 Colorful12 marked this pull request as ready for review April 6, 2026 11:31
@Colorful12 Colorful12 requested a review from a team as a code owner April 6, 2026 11:31
Copy link
Copy Markdown
Contributor

@piyoppi piyoppi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます 🙏

@piyoppi piyoppi merged commit 4c0d4cb into pepabo:main Apr 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants