fix(adapter): 非推奨の Sass color 関数を color.channel に置換#94
Closed
Colorful12 wants to merge 3 commits into
Closed
Conversation
Author
|
Sass のバージョンアップが必要であることが判明したため、こちらの PR はクローズします。対応は #95 で進めています。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Sass 1.79+ で
color.red()/color.green()/color.blue()が非推奨になりました。packages/adapter/functions/_helpers.scssの-compose-luminance関数内でこれらを使用しており、ビルド時に大量の警告が出ています。-compose-luminanceは adapter を@useしているコンポーネントのコンパイルごとに呼び出されるため、ログが大量に膨らみます。Claude Code などの AI ツールを使いながら開発している場合、この大量出力がコンテキストウィンドウのトークンを消費するという問題もあります。
また、Sass 2.0 ではこれらの関数が削除されるため、現状は警告ですが将来的にビルドエラーになります。(ref)
変更内容
-compose-luminance関数内の3行を置換:color.channel()は Sass の移行ガイドで推奨されている代替手段です。$space: rgbを明示することで、旧 API(color.red()等)と同じく sRGB の各チャンネル値(0〜255)を返します。(ref)別途確認したいこと
get-foreground-brightness関数に TODO コメントを追加しました。自己再帰による無限ループと Sass 1.85+ で非推奨の
if()を含んでいます。削除したいのですが、残っている理由がありそうなので、削除前に確認した方が良さそうと思いました。
残っている理由は何ですか?