fix(adapter): Sass を 1.98.0 にアップデートし、非推奨の color 関数を修正#97
Merged
Conversation
Author
|
こちらと同じ内容です! |
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.
背景
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.jsonpackages/components-web/package.jsonpackages/stories-web/package.json2.
_helpers.scssの修正color.red/green/blueをcolor.channel()に置換:$space: rgbを明示することで、旧 API と同じく sRGB の各チャンネル値(0〜255)を返します。参考: https://sass-lang.com/documentation/breaking-changes/color-functions/
get-foreground-brightness関数を削除:自己再帰による無限ループかつ未使用の関数だったため削除しました。
ビルド確認
npm run buildを実行し、ビルドが通ることを確認しました。修正前に出ていた以下の警告も解消されています:
Deprecation color.red() is deprecatedDeprecation color.green() is deprecatedDeprecation color.blue() is deprecatedDeprecation [if-function]