扩展或定制ANTD的LESS Mixins

问题描述

是否可以为ANTD扩展或定制LESS Mixins?

例如,我希望我的按钮在悬停时变暗(而不变亮)。查看代码,我看到有一个mixin可以做到这一点。

https://github.com/ant-design/ant-design/blob/master/components/button/style/mixin.less#L28-L62

.button-variant-primary(@color; @background) {
  .button-color(@color; @background; @background);

  text-shadow: @btn-text-shadow;
  Box-shadow: @btn-primary-shadow;

  &:hover,&:focus {
    & when (@theme = dark) {
      .button-color(
        @color; ~`colorPalette('@{background}',7) `; ~`colorPalette('@{background}',7) `
      );
    }
    & when not (@theme = dark) {
      .button-color(
        @color; ~`colorPalette('@{background}',5) `; ~`colorPalette('@{background}',5) `
      );
    }
  }

我尝试用自己的覆盖该mixin,并在导入AntD Less文件之前和之后放置它,但这没用。

这可能吗?

解决方法

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

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

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