btn.less 5.3 KB
Newer Older
V
vben 已提交
1
// button reset
陈文彬 已提交
2
.ant-btn {
V
vben 已提交
3 4 5
  // display: inline-flex;
  // justify-content: center;
  // align-items: center;
V
vben 已提交
6 7 8 9 10 11
  // &.ant-btn-success:not(.ant-btn-link),
  // &.ant-btn-error:not(.ant-btn-link),
  // &.ant-btn-warning:not(.ant-btn-link),
  // &.ant-btn-primary:not(.ant-btn-link) {
  //   box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.12), 0 2px 4px 0 rgba(0, 0, 0, 0.08) !important;
  // }
V
vben 已提交
12 13 14 15 16
  // &-group {
  //   .ant-btn:not(:first-child) {
  //     bottom: 1px;
  //   }
  // }
17 18 19 20 21
  &-link:hover,
  &-link:focus,
  &-link:active {
    border-color: transparent !important;
  }
陈文彬 已提交
22 23 24 25 26 27 28 29

  &-primary {
    color: @white;
    background-color: @button-primary-color;
    border-width: 0;

    &:hover,
    &:focus {
V
vben 已提交
30
      color: @white !important;
陈文彬 已提交
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
      background-color: @button-primary-hover-color;
    }

    &[disabled],
    &[disabled]:hover {
      color: @white;
      background-color: fade(@button-primary-color, 40%);
    }
  }

  &-default {
    color: @button-cancel-color;
    background-color: @button-cancel-bg-color;
    border-color: @button-cancel-border-color;

    &:hover,
    &:focus {
      color: @button-cancel-hover-color;
      background-color: @button-cancel-hover-bg-color;
      border-color: @button-cancel-hover-border-color;
    }

53 54 55 56 57 58
    //&[disabled],
    //&[disabled]:hover {
    //  color: fade(@button-cancel-color, 40%);
    //  background: fade(@button-cancel-bg-color, 40%);
    //  border-color: fade(@button-cancel-border-color, 40%);
    //}
陈文彬 已提交
59 60
  }

61
  [data-theme='light'] &.ant-btn-link.is-disabled {
V
Vben 已提交
62
    color: rgba(0, 0, 0, 0.25);
陈文彬 已提交
63
    text-shadow: none;
V
Vben 已提交
64 65 66
    cursor: not-allowed !important;
    background-color: transparent !important;
    border-color: transparent !important;
陈文彬 已提交
67 68 69
    box-shadow: none;
  }

70 71 72 73 74 75 76 77 78
  [data-theme='dark'] &.ant-btn-link.is-disabled {
    color: rgba(255, 255, 255, 0.25) !important;
    text-shadow: none;
    cursor: not-allowed !important;
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none;
  }

陈文彬 已提交
79 80 81 82 83 84 85 86
  // color: @white;

  &-success.ant-btn-link:not([disabled='disabled']) {
    color: @button-success-color;

    &:hover,
    &:focus {
      color: @button-success-hover-color;
87
      border-color: transparent;
陈文彬 已提交
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
    }
  }

  &-success.ant-btn-link.ant-btn-loading,
  &-warning.ant-btn-link.ant-btn-loading,
  &-error.ant-btn-link.ant-btn-loading,
  &-background-ghost.ant-btn-link.ant-btn-loading,
  &.ant-btn-link.ant-btn-loading {
    &::before {
      background: transparent;
    }
  }

  &-success:not(.ant-btn-link) {
    color: @white;
    background-color: @button-success-color;
    border-color: @button-success-color;
    border-width: 0;

    &:hover,
    &:focus {
      color: @white;
      background-color: @button-success-hover-color;
      border-color: @button-success-hover-color;
    }

    &[disabled],
    &[disabled]:hover {
      color: @white;
      background-color: fade(@button-success-color, 40%);
      // background-color: @button-success-disabled-color;
      border-color: fade(@button-success-color, 40%);
    }
  }

  &-warning.ant-btn-link:not([disabled='disabled']) {
    color: @button-warn-color;

    &:hover,
    &:focus {
      color: @button-warn-hover-color;
129
      border-color: transparent;
陈文彬 已提交
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
    }
  }

  &-warning:not(.ant-btn-link) {
    color: @white;
    background-color: @button-warn-color;
    border-color: @button-warn-color;
    border-width: 0;

    &:hover,
    &:focus {
      color: @white;
      background-color: @button-warn-hover-color;
      border-color: @button-warn-hover-color;
    }

    &[disabled],
    &[disabled]:hover {
      color: @white;
      background-color: fade(@button-warn-color, 40%);
      border-color: fade(@button-warn-color, 40%);

      // background-color: @button-warn-disabled-color;
      // border-color: @button-warn-disabled-color ;
    }
  }

  &-error.ant-btn-link:not([disabled='disabled']) {
    color: @button-error-color;

    &:hover,
    &:focus {
      color: @button-error-hover-color;
163
      border-color: transparent;
陈文彬 已提交
164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
    }
  }

  &-error:not(.ant-btn-link) {
    color: @white;
    background-color: @button-error-color;
    border-color: @button-error-color;
    border-width: 0;

    &:hover,
    &:focus {
      color: @white;
      background-color: @button-error-hover-color;
      border-color: @button-error-hover-color;
    }

    &[disabled],
    &[disabled]:hover {
      color: @white;
      background-color: fade(@button-error-color, 40%);
      border-color: fade(@button-error-color, 40%);
    }
  }

  &-background-ghost.ant-btn-link,
  &.ant-btn-dashed:not([disabled='disabled']) {
    color: @text-color-call-out;

    &:hover {
      color: @button-primary-color;
    }
  }

V
Vben 已提交
197
  &-background-ghost {
陈文彬 已提交
198
    color: @button-ghost-color;
V
Vben 已提交
199
    background-color: transparent;
陈文彬 已提交
200 201 202 203 204
    border-color: @button-ghost-color;
    border-width: 1px;

    &:hover,
    &:focus {
V
Vben 已提交
205
      color: @button-ghost-hover-color !important;
陈文彬 已提交
206 207 208 209 210 211 212
      background-color: @button-ghost-hover-bg-color;
      border-color: @button-ghost-hover-color;
    }

    &[disabled],
    &[disabled]:hover {
      color: @button-ghost-color;
V
Vben 已提交
213
      background-color: fade(@white, 40%);
陈文彬 已提交
214 215 216
      border-color: fade(@button-ghost-color, 40%);
    }
  }
V
Vben 已提交
217 218 219 220 221 222 223 224 225 226

  &-ghost.ant-btn-link:not([disabled='disabled']) {
    color: @button-ghost-color;

    &:hover,
    &:focus {
      color: @button-ghost-hover-color;
      border-color: transparent;
    }
  }
陈文彬 已提交
227
}