キーフレームを使用すると、css-modulesで次の問題が見つかりました。
元のCSSコード:
<strong i="7">@keyframes</strong> rotating {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
.rotating-item {
animation: 5s linear 0 infinite rotating;
}
次のコードにコンパイルされます。
@-webkit-keyframes rotating___3vsQl {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
<strong i="11">@keyframes</strong> rotating___3vsQl {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.rotating-item___3pALh {
-webkit-animation: 5s linear 0 infinite :local(rotating);
animation: 5s linear 0 infinite :local(rotating);
}
私は正しいものは次のようにすべきだと思います:
@-webkit-keyframes rotating___3vsQl {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
<strong i="15">@keyframes</strong> rotating___3vsQl {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.rotating-item___3pALh {
-webkit-animation: 5s linear 0 infinite rotating___3vsQl;
animation: 5s linear 0 infinite rotating___3vsQl;
}
それがcss-modulesのバグなのか、webpackの設定の問題なのかわかりません。
注意:
- dva-cliで作成されたプロジェクトは、webpack構成を変更しませんでした。
- 最初はあまり書いていませんでしたが、cssに変更してもうまくいきませんでした。
書き込みが少ない場合は、
<strong i="25">@keyframes</strong> :global(rotating)
がエラーを報告することを示しますツールのバージョンは次のとおりです。
ノード。js@ 6.9.0
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- [email protected]
https://github.com/css-modules/css-modules/issues/141#issuecomment -243011699
これはあなたの問題を解決できますか?
ありがとう🙏!
はい、これは問題ありませんが、問題は
animation: name .6s ease; // 这样是可以的
animation: .6s ease name; // 而这样就不会被识别到了
mozillaのドキュメントに穴をあけられました😂
<single-animation> = <time> || <single-timing-function> || <time> || <single-animation-iteration-count> || <single- animation-direction> || <single-animation-fill-mode> || <single-animation-play-state> || [ none | <keyframes-name> ] /* <strong i="11">@keyframes</strong> duration | timing-function | delay | iteration-count | direction | fill-mode | play-state | name */ animation: 3s ease-in 1s 2 reverse both paused slidein; /* <strong i="12">@keyframes</strong> duration | timing-function | delay | name */ animation: 3s linear 1s slidein; /* <strong i="13">@keyframes</strong> duration | name */ animation: 3s slidein;
最も参考になるコメント
ありがとう🙏!
はい、これは問題ありませんが、問題は
mozillaのドキュメントに穴をあけられました😂