MaterialUI中的CSS过渡

问题描述

我正在尝试在我的整个应用程序中实现MaterialUI主题。到目前为止,我已经拥有了,除了transition属性之外的所有东西都可以正常工作。 Chrome DevTools显示该属性处于活动状态,但悬停时没有后台过渡。显然,我找不到合适的位置,因为在任何地方都找不到这个话题。

import { createMuiTheme } from '@material-ui/core/styles';
import blueGrey from '@material-ui/core/colors/blueGrey';

const primaryStop0 = blueGrey[500]
const primaryStop1 = blueGrey[900]

export const theme = createMuiTheme({
    overrides: {
        MuiButton: {
            root: {
                fontWeight: 'bold',margin: '50px'
            },containedPrimary: {
                background: `linear-gradient(to right,${primaryStop0},${primaryStop1})`,transition: 'background 0.2s ease','&:hover': {
                    background: `linear-gradient(to left,${primaryStop1})`
                }
            }
        }
    } 
})

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)