2019-05-06 12:04:39 +08:00
|
|
|
@import '../../style/themes/index';
|
2018-12-07 20:02:01 +08:00
|
|
|
@import '../../style/mixins/index';
|
|
|
|
@import './mixin';
|
2016-04-27 20:44:36 +08:00
|
|
|
|
2018-12-07 20:02:01 +08:00
|
|
|
@btn-prefix-cls: ~'@{ant-prefix}-btn';
|
2015-06-09 15:21:44 +08:00
|
|
|
|
2018-07-06 14:08:37 +08:00
|
|
|
// for compatible
|
2017-08-04 17:58:32 +08:00
|
|
|
@btn-ghost-color: @text-color;
|
|
|
|
@btn-ghost-bg: transparent;
|
|
|
|
@btn-ghost-border: @border-color-base;
|
2017-01-23 22:24:36 +08:00
|
|
|
|
2015-06-09 15:21:44 +08:00
|
|
|
// Button styles
|
|
|
|
// -----------------------------
|
2015-08-20 16:55:42 +08:00
|
|
|
.@{btn-prefix-cls} {
|
2019-12-03 18:06:07 +08:00
|
|
|
// Fixing https://github.com/ant-design/ant-design/issues/12978
|
|
|
|
// Fixing https://github.com/ant-design/ant-design/issues/20058
|
|
|
|
// Fixing https://github.com/ant-design/ant-design/issues/19972
|
|
|
|
// Fixing https://github.com/ant-design/ant-design/issues/18107
|
|
|
|
// Fixing https://github.com/ant-design/ant-design/issues/13214
|
|
|
|
// It is a render problem of chrome, which is only happened in the codesandbox demo
|
2022-01-02 12:59:40 +08:00
|
|
|
// 0.001px solution works and I don't know why
|
2020-08-04 19:56:10 +08:00
|
|
|
line-height: @btn-line-height;
|
2020-12-22 11:08:12 +08:00
|
|
|
.btn();
|
|
|
|
.btn-default();
|
2020-06-01 13:33:29 +08:00
|
|
|
|
2020-05-20 23:32:38 +08:00
|
|
|
// Fix loading button animation
|
|
|
|
// https://github.com/ant-design/ant-design/issues/24323
|
|
|
|
> span {
|
|
|
|
display: inline-block;
|
|
|
|
}
|
2017-08-16 17:43:56 +08:00
|
|
|
|
2015-06-09 15:21:44 +08:00
|
|
|
&-primary {
|
2020-12-22 11:08:12 +08:00
|
|
|
.btn-primary();
|
2015-06-12 19:41:30 +08:00
|
|
|
|
2015-08-20 16:55:42 +08:00
|
|
|
.@{btn-prefix-cls}-group &:not(:first-child):not(:last-child) {
|
2015-07-09 10:56:28 +08:00
|
|
|
border-right-color: @btn-group-border;
|
|
|
|
border-left-color: @btn-group-border;
|
2016-12-30 14:27:23 +08:00
|
|
|
|
|
|
|
&:disabled {
|
|
|
|
border-color: @btn-default-border;
|
|
|
|
}
|
2015-06-09 15:21:44 +08:00
|
|
|
}
|
|
|
|
|
2015-08-20 16:55:42 +08:00
|
|
|
.@{btn-prefix-cls}-group &:first-child {
|
2015-06-09 15:21:44 +08:00
|
|
|
&:not(:last-child) {
|
2015-07-09 10:56:28 +08:00
|
|
|
border-right-color: @btn-group-border;
|
2020-01-02 19:10:16 +08:00
|
|
|
|
2016-01-25 21:06:32 +08:00
|
|
|
&[disabled] {
|
|
|
|
border-right-color: @btn-default-border;
|
|
|
|
}
|
2015-06-09 15:21:44 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-01-25 21:06:32 +08:00
|
|
|
.@{btn-prefix-cls}-group &:last-child:not(:first-child),
|
2016-12-30 14:27:23 +08:00
|
|
|
.@{btn-prefix-cls}-group & + & {
|
2015-07-09 10:56:28 +08:00
|
|
|
border-left-color: @btn-group-border;
|
2020-01-02 19:10:16 +08:00
|
|
|
|
2016-01-25 21:06:32 +08:00
|
|
|
&[disabled] {
|
|
|
|
border-left-color: @btn-default-border;
|
|
|
|
}
|
2015-07-08 16:21:04 +08:00
|
|
|
}
|
2015-06-09 15:21:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-ghost {
|
2020-12-22 11:08:12 +08:00
|
|
|
.btn-ghost();
|
2015-06-09 15:21:44 +08:00
|
|
|
}
|
|
|
|
|
2015-11-30 18:26:44 +08:00
|
|
|
&-dashed {
|
2020-12-22 11:08:12 +08:00
|
|
|
.btn-dashed();
|
2015-11-30 18:26:44 +08:00
|
|
|
}
|
|
|
|
|
2019-11-22 15:32:11 +08:00
|
|
|
// type="danger" will deprecated
|
|
|
|
// use danger instead
|
2017-01-23 22:24:36 +08:00
|
|
|
&-danger {
|
2020-12-22 11:08:12 +08:00
|
|
|
.btn-danger();
|
2017-01-23 22:24:36 +08:00
|
|
|
}
|
|
|
|
|
2019-11-22 15:32:11 +08:00
|
|
|
&-link {
|
2020-12-22 11:08:12 +08:00
|
|
|
.btn-link();
|
2019-11-22 15:32:11 +08:00
|
|
|
}
|
|
|
|
|
2020-05-06 10:15:33 +08:00
|
|
|
&-text {
|
2020-12-22 11:08:12 +08:00
|
|
|
.btn-text();
|
2020-05-06 10:15:33 +08:00
|
|
|
}
|
|
|
|
|
2019-11-22 15:32:11 +08:00
|
|
|
&-dangerous {
|
2020-12-22 11:08:12 +08:00
|
|
|
.btn-danger-default();
|
2019-05-06 12:04:39 +08:00
|
|
|
}
|
|
|
|
|
2019-11-22 15:32:11 +08:00
|
|
|
&-dangerous&-primary {
|
2020-12-22 11:08:12 +08:00
|
|
|
.btn-danger();
|
2019-11-22 12:02:35 +08:00
|
|
|
}
|
|
|
|
|
2019-11-22 15:32:11 +08:00
|
|
|
&-dangerous&-link {
|
2020-12-22 11:08:12 +08:00
|
|
|
.btn-danger-link();
|
2019-11-22 13:59:20 +08:00
|
|
|
}
|
|
|
|
|
2020-06-01 13:33:29 +08:00
|
|
|
&-dangerous&-text {
|
2020-12-22 11:08:12 +08:00
|
|
|
.btn-danger-text();
|
2020-06-01 13:33:29 +08:00
|
|
|
}
|
|
|
|
|
2019-08-25 21:04:10 +08:00
|
|
|
&-icon-only {
|
|
|
|
.btn-square(@btn-prefix-cls);
|
2021-08-11 12:59:14 +08:00
|
|
|
vertical-align: -3px;
|
|
|
|
|
|
|
|
> .@{iconfont-css-prefix} {
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
2022-06-22 12:58:56 +08:00
|
|
|
|
|
|
|
.@{iconfont-css-prefix}-loading {
|
|
|
|
padding: 0 !important;
|
|
|
|
}
|
2019-08-25 21:04:10 +08:00
|
|
|
}
|
|
|
|
|
2021-10-02 12:35:50 +08:00
|
|
|
// https://github.com/ant-design/ant-design/issues/32365
|
|
|
|
a&-icon-only {
|
|
|
|
vertical-align: -1px;
|
|
|
|
|
|
|
|
> .@{iconfont-css-prefix} {
|
|
|
|
display: inline;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-10 11:15:43 +08:00
|
|
|
&-round {
|
|
|
|
.btn-round(@btn-prefix-cls);
|
2019-08-25 21:04:10 +08:00
|
|
|
&.@{btn-prefix-cls}-icon-only {
|
|
|
|
width: auto;
|
|
|
|
}
|
2019-01-10 11:15:43 +08:00
|
|
|
}
|
|
|
|
|
2020-10-16 15:50:19 +08:00
|
|
|
&-circle {
|
2015-08-20 16:55:42 +08:00
|
|
|
.btn-circle(@btn-prefix-cls);
|
2015-06-09 15:21:44 +08:00
|
|
|
}
|
|
|
|
|
2019-02-15 10:48:07 +08:00
|
|
|
&::before {
|
2016-04-15 16:21:08 +08:00
|
|
|
position: absolute;
|
2021-01-16 17:50:56 +08:00
|
|
|
top: -@btn-border-width;
|
|
|
|
right: -@btn-border-width;
|
|
|
|
bottom: -@btn-border-width;
|
|
|
|
left: -@btn-border-width;
|
2019-02-15 10:48:07 +08:00
|
|
|
z-index: 1;
|
|
|
|
display: none;
|
2018-12-04 13:11:31 +08:00
|
|
|
background: @component-background;
|
2016-04-15 16:21:08 +08:00
|
|
|
border-radius: inherit;
|
2019-02-15 10:48:07 +08:00
|
|
|
opacity: 0.35;
|
2018-12-07 20:02:01 +08:00
|
|
|
transition: opacity 0.2s;
|
2019-02-15 10:48:07 +08:00
|
|
|
content: '';
|
2019-04-15 22:44:51 +08:00
|
|
|
pointer-events: none;
|
2016-04-15 16:21:08 +08:00
|
|
|
}
|
|
|
|
|
2017-04-15 14:57:05 +08:00
|
|
|
.@{iconfont-css-prefix} {
|
2018-12-07 20:02:01 +08:00
|
|
|
transition: margin-left 0.3s @ease-in-out;
|
2018-12-26 18:48:47 +08:00
|
|
|
|
|
|
|
// Follow icon blur under windows. Change the render.
|
|
|
|
// https://github.com/ant-design/ant-design/issues/13924
|
|
|
|
&.@{iconfont-css-prefix}-plus,
|
|
|
|
&.@{iconfont-css-prefix}-minus {
|
|
|
|
> svg {
|
2022-01-24 11:26:26 +08:00
|
|
|
shape-rendering: optimizespeed;
|
2018-12-26 18:48:47 +08:00
|
|
|
}
|
|
|
|
}
|
2017-04-15 14:57:05 +08:00
|
|
|
}
|
|
|
|
|
2019-04-13 22:18:26 +08:00
|
|
|
&&-loading {
|
|
|
|
position: relative;
|
2021-09-14 15:31:42 +08:00
|
|
|
cursor: default;
|
2020-01-02 19:10:16 +08:00
|
|
|
|
2020-04-10 15:39:07 +08:00
|
|
|
&::before {
|
|
|
|
display: block;
|
2015-12-28 13:49:58 +08:00
|
|
|
}
|
2015-07-29 22:23:55 +08:00
|
|
|
}
|
|
|
|
|
2020-04-10 15:39:07 +08:00
|
|
|
& > &-loading-icon {
|
2021-12-08 18:17:01 +08:00
|
|
|
transition: width 0.3s @ease-in-out, opacity 0.3s @ease-in-out;
|
2020-01-02 19:10:16 +08:00
|
|
|
|
2020-04-30 17:18:24 +08:00
|
|
|
.@{iconfont-css-prefix} {
|
2020-11-16 18:05:00 +08:00
|
|
|
padding-right: @padding-xs;
|
|
|
|
animation: none;
|
|
|
|
// for smooth button padding transition
|
|
|
|
svg {
|
|
|
|
animation: loadingCircle 1s infinite linear;
|
|
|
|
}
|
2020-04-30 17:18:24 +08:00
|
|
|
}
|
2015-07-29 22:23:55 +08:00
|
|
|
}
|
|
|
|
|
2015-06-09 15:21:44 +08:00
|
|
|
&-group {
|
2015-08-20 16:55:42 +08:00
|
|
|
.btn-group(@btn-prefix-cls);
|
2015-06-09 15:21:44 +08:00
|
|
|
}
|
2015-09-27 16:30:35 +08:00
|
|
|
|
2017-03-05 20:12:36 +08:00
|
|
|
// http://stackoverflow.com/a/21281554/3040605
|
|
|
|
&:focus > span,
|
|
|
|
&:active > span {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
2015-09-27 16:30:35 +08:00
|
|
|
// To ensure that a space will be placed between character and `Icon`.
|
2015-11-26 19:32:55 +08:00
|
|
|
> .@{iconfont-css-prefix} + span,
|
|
|
|
> span + .@{iconfont-css-prefix} {
|
2020-03-29 10:39:46 +08:00
|
|
|
margin-left: @margin-xs;
|
2015-09-27 16:30:35 +08:00
|
|
|
}
|
2016-02-18 16:08:48 +08:00
|
|
|
|
2021-08-13 09:31:38 +08:00
|
|
|
&&-background-ghost {
|
2019-11-26 14:42:37 +08:00
|
|
|
color: @btn-default-ghost-color;
|
|
|
|
border-color: @btn-default-ghost-border;
|
2021-09-24 19:39:48 +08:00
|
|
|
|
2021-08-04 18:35:37 +08:00
|
|
|
&,
|
|
|
|
&:hover,
|
|
|
|
&:active,
|
|
|
|
&:focus {
|
|
|
|
background: @btn-default-ghost-bg;
|
|
|
|
}
|
2021-09-24 19:39:48 +08:00
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
color: @primary-color-hover;
|
|
|
|
border-color: @primary-color-hover;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:active {
|
|
|
|
color: @primary-color-active;
|
|
|
|
border-color: @primary-color-active;
|
|
|
|
}
|
|
|
|
|
|
|
|
&[disabled] {
|
|
|
|
color: @disabled-color;
|
|
|
|
background: @btn-default-ghost-bg;
|
|
|
|
border-color: @btn-default-border;
|
|
|
|
}
|
2017-01-23 22:24:36 +08:00
|
|
|
}
|
|
|
|
|
2017-01-31 21:27:23 +08:00
|
|
|
&-background-ghost&-primary {
|
2021-09-01 10:56:50 +08:00
|
|
|
.button-variant-ghost(@btn-primary-bg, @btn-primary-bg, @primary-color-hover, @primary-color-active);
|
2017-03-18 16:33:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-background-ghost&-danger {
|
2021-09-01 10:56:50 +08:00
|
|
|
.button-variant-ghost(@btn-danger-border, @btn-danger-border, @error-color-hover, @error-color-active);
|
2017-01-23 22:24:36 +08:00
|
|
|
}
|
2018-01-02 16:27:59 +08:00
|
|
|
|
2019-11-29 15:09:17 +08:00
|
|
|
&-background-ghost&-dangerous {
|
2021-09-01 10:56:50 +08:00
|
|
|
.button-variant-ghost(@btn-danger-border, @btn-danger-border, @error-color-hover, @error-color-active);
|
2019-11-29 15:09:17 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-background-ghost&-dangerous&-link {
|
2021-09-01 10:56:50 +08:00
|
|
|
.button-variant-ghost(@btn-danger-border, transparent, @error-color-hover, @error-color-active);
|
2019-11-29 15:09:17 +08:00
|
|
|
}
|
|
|
|
|
2019-02-15 10:48:07 +08:00
|
|
|
&-two-chinese-chars::first-letter {
|
2018-12-07 20:02:01 +08:00
|
|
|
letter-spacing: 0.34em;
|
2018-01-02 16:27:59 +08:00
|
|
|
}
|
|
|
|
|
2018-10-30 19:07:08 +08:00
|
|
|
&-two-chinese-chars > *:not(.@{iconfont-css-prefix}) {
|
2018-12-07 20:02:01 +08:00
|
|
|
margin-right: -0.34em;
|
2019-02-15 10:48:07 +08:00
|
|
|
letter-spacing: 0.34em;
|
2018-01-02 16:27:59 +08:00
|
|
|
}
|
2018-07-29 06:54:54 +08:00
|
|
|
|
2022-01-27 21:33:45 +08:00
|
|
|
&&-block {
|
2018-07-29 06:54:54 +08:00
|
|
|
width: 100%;
|
|
|
|
}
|
2018-09-10 11:22:26 +08:00
|
|
|
|
2018-10-17 11:07:25 +08:00
|
|
|
// https://github.com/ant-design/ant-design/issues/12681
|
2020-03-21 14:30:40 +08:00
|
|
|
// same method as Select
|
2018-10-17 11:07:25 +08:00
|
|
|
&:empty {
|
2020-03-21 14:30:40 +08:00
|
|
|
display: inline-block;
|
|
|
|
width: 0;
|
|
|
|
visibility: hidden;
|
|
|
|
content: '\a0';
|
2018-10-17 11:07:25 +08:00
|
|
|
}
|
2016-02-18 16:08:48 +08:00
|
|
|
}
|
|
|
|
|
2017-11-29 11:20:22 +08:00
|
|
|
a.@{btn-prefix-cls} {
|
2019-08-07 14:55:14 +08:00
|
|
|
// Fixing https://github.com/ant-design/ant-design/issues/12978
|
2021-04-03 22:27:46 +08:00
|
|
|
// https://github.com/ant-design/ant-design/issues/29978
|
2019-08-07 14:55:14 +08:00
|
|
|
// It is a render problem of chrome, which is only happened in the codesandbox demo
|
|
|
|
// 0.1px for padding-top solution works and I don't why
|
2021-04-03 22:27:46 +08:00
|
|
|
padding-top: 0.01px !important;
|
2019-08-09 17:16:06 +08:00
|
|
|
line-height: @btn-height-base - 2px;
|
2019-08-07 14:55:14 +08:00
|
|
|
|
2022-06-10 17:58:58 +08:00
|
|
|
&-disabled {
|
|
|
|
.btn-href-disabled();
|
|
|
|
}
|
|
|
|
|
2018-11-11 18:11:19 +08:00
|
|
|
&-lg {
|
2017-11-29 11:20:22 +08:00
|
|
|
line-height: @btn-height-lg - 2px;
|
|
|
|
}
|
2021-10-13 15:38:59 +08:00
|
|
|
|
2018-11-11 18:11:19 +08:00
|
|
|
&-sm {
|
2017-11-29 11:20:22 +08:00
|
|
|
line-height: @btn-height-sm - 2px;
|
|
|
|
}
|
|
|
|
}
|
2020-03-19 12:13:24 +08:00
|
|
|
|
2022-10-18 16:23:10 +08:00
|
|
|
@import './space-compact';
|
2020-03-19 12:13:24 +08:00
|
|
|
@import './rtl';
|