【问题标题】:how can I override the Chakra-UI button theme when I am in an 'isLoading' state?当我处于 \'isLoading\' 状态时,如何覆盖 Chakra-UI 按钮主题?
【发布时间】:2022-08-23 11:25:47
【问题描述】:

这是我当前的覆盖,效果很好,但是当我通过 isLoading 道具时,主题太轻了。

solid: {
      bgGradient: \"linear(to-r, primary.600, primary.500)\",
      color: \"white\",
      _active: {},
      _hover: {
        transform: \"scale(0.98)\",
        bgGradient: \"linear(to-r, primary.500, primary.400)\",
      },
      _focus: {},
    },

    标签: button chakra-ui


    【解决方案1】:

    使用_loading 键并将opacity 设置为1

    solid: {
          bgGradient: "linear(to-r, primary.600, primary.500)",
          color: "white",
          _active: {},
          _hover: {
            transform: "scale(0.98)",
            bgGradient: "linear(to-r, primary.500, primary.400)",
          },
          _focus: {},
          _loading: { opacity: 1 }
        },
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-01
      • 1970-01-01
      • 2019-05-21
      • 2019-03-14
      • 1970-01-01
      相关资源
      最近更新 更多