Extend or Customize LESS Mixins for ANTD

Viewed 339

Is it possible to extend or customize the LESS Mixins for ANTD?

For example, I want my buttons to get darker on hover (not lighter). Looking though the code, I see there is a mixin to do this.

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) `
      );
    }
  }

I tried overwriting this mixin with my own and placing it before and after importing AntD Less files, but that didn't work.

Is this possible?

0 Answers
Related