問題
SASS と Tailwind CSS を使用している Angular プロジェクトで、次のビルド警告が発生します:
sass_deprecation_warning.txt
▲ [WARNING] Deprecation [plugin angular-sass]
src/styles.sass:2:8:
2 │ @import "tailwindcss";
╵ ^
Sass @import rules are deprecated and will be removed in Dart Sass 3.0.0.
More info and automated migrator: https://sass-lang.com/d/import
The plugin "angular-sass" was triggered by this import
angular:styles/global:styles:1:8:
1 │ @import 'src/styles.sass';
╵ ~~~~~~~~~~~~~~~~~解決策
まず、通常はこの警告を無視できることを知っておくことが重要です。
それでも修正方法を示します。styles.sass または Tailwind CSS をインポートした場所で次の行を見つけます:
styles.sass
@import "tailwindcss";そして次に置き換えます:
styles.sass
@use "tailwindcss";@use ルールはファイルの先頭にある他のスタイルやインポートの前に配置する必要があります。
この記事が役に立った場合は、TechOverflow での新しい記事の調査と公開を支援するため、「Buy Me a Coffee」でのご支援、または PayPal 経由でのご寄付をご検討ください