小编sta*_*des的帖子

Material-UI JSS中的闪烁动画

我正在使用Material-UI构建一个GatsbyJS网站。使用withStyles HoC,是否可以制作闪烁的动画?我尝试在提供动画styles

const styles = theme => ({
        '@keyframes blinker': {
            from: {opacity: 1},
            to: {opacity: 0}
        },
        headerGT: {
            color: 'white',
            animation: ['blinker', '1s', 'linear', 'infinite'],
            '-webkit-animation': ['blinker', '1s', 'linear', 'infinite'],
            '-moz-animation': ['blinker', '1s', 'linear', 'infinite'],
        }
    })
Run Code Online (Sandbox Code Playgroud)

我可以看到在构建DOM时可以识别类和关键帧,并且headerGT具有动画方法,但是动画不会触发。有任何想法吗?

animation material-ui gatsby jss

6
推荐指数
3
解决办法
1400
查看次数

标签 统计

animation ×1

gatsby ×1

jss ×1

material-ui ×1