2016-04-27 20:44:36 +08:00
|
|
|
@import "../../style/mixins/index";
|
|
|
|
|
2016-09-14 16:18:33 +08:00
|
|
|
.antCheckboxFn(@checkbox-prefix-cls: ~"@{ant-prefix}-checkbox") {
|
2016-04-27 20:44:36 +08:00
|
|
|
@checkbox-inner-prefix-cls: ~"@{checkbox-prefix-cls}-inner";
|
|
|
|
// 一般状态
|
|
|
|
.@{checkbox-prefix-cls} {
|
|
|
|
white-space: nowrap;
|
|
|
|
cursor: pointer;
|
|
|
|
outline: none;
|
|
|
|
display: inline-block;
|
|
|
|
line-height: 1;
|
|
|
|
position: relative;
|
|
|
|
vertical-align: middle;
|
|
|
|
|
2016-11-01 00:54:47 +08:00
|
|
|
.@{checkbox-prefix-cls}-wrapper:hover &,
|
2016-04-27 20:44:36 +08:00
|
|
|
&:hover,
|
2016-04-29 17:03:28 +08:00
|
|
|
&-focused {
|
2016-04-27 20:44:36 +08:00
|
|
|
.@{checkbox-inner-prefix-cls} {
|
2016-11-08 21:42:46 +08:00
|
|
|
border-color: @primary-color;
|
2016-04-27 20:44:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-inner {
|
2016-11-01 00:54:47 +08:00
|
|
|
position: relative;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
display: inline-block;
|
|
|
|
width: 14px;
|
|
|
|
height: 14px;
|
2017-01-31 16:05:10 +08:00
|
|
|
border: @border-width-base @border-style-base @border-color-base;
|
2017-02-08 14:21:29 +08:00
|
|
|
border-radius: @border-radius-sm;
|
2016-11-01 00:54:47 +08:00
|
|
|
background-color: #fff;
|
|
|
|
transition: all .3s;
|
|
|
|
|
2016-04-27 20:44:36 +08:00
|
|
|
&:after {
|
|
|
|
transform: rotate(45deg) scale(0);
|
|
|
|
position: absolute;
|
|
|
|
left: 4px;
|
|
|
|
top: 1px;
|
|
|
|
display: table;
|
|
|
|
width: 5px;
|
|
|
|
height: 8px;
|
|
|
|
border: 2px solid #fff;
|
|
|
|
border-top: 0;
|
|
|
|
border-left: 0;
|
|
|
|
content: ' ';
|
|
|
|
transition: all .1s @ease-in-back;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-input {
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
z-index: 1;
|
|
|
|
cursor: pointer;
|
|
|
|
.opacity(0);
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
right: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// 半选状态
|
2016-11-01 00:54:47 +08:00
|
|
|
.@{checkbox-prefix-cls}-indeterminate .@{checkbox-inner-prefix-cls}:after {
|
|
|
|
content: ' ';
|
|
|
|
transform: scale(1);
|
|
|
|
position: absolute;
|
|
|
|
left: 2px;
|
|
|
|
top: 5px;
|
|
|
|
width: 8px;
|
|
|
|
height: 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 选中状态
|
|
|
|
.@{checkbox-prefix-cls}-checked .@{checkbox-inner-prefix-cls}:after {
|
|
|
|
transform: rotate(45deg) scale(1);
|
|
|
|
position: absolute;
|
|
|
|
left: 4px;
|
|
|
|
top: 1px;
|
|
|
|
display: table;
|
|
|
|
width: 5px;
|
|
|
|
height: 8px;
|
|
|
|
border: 2px solid #fff;
|
|
|
|
border-top: 0;
|
|
|
|
border-left: 0;
|
|
|
|
content: ' ';
|
|
|
|
transition: all .2s @ease-out-back .1s;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{checkbox-prefix-cls}-checked,
|
2016-04-27 20:44:36 +08:00
|
|
|
.@{checkbox-prefix-cls}-indeterminate {
|
|
|
|
.@{checkbox-inner-prefix-cls} {
|
|
|
|
background-color: @primary-color;
|
2016-11-09 20:38:57 +08:00
|
|
|
border-color: @primary-color;
|
2016-04-27 20:44:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{checkbox-prefix-cls}-disabled {
|
|
|
|
&.@{checkbox-prefix-cls}-checked {
|
2016-11-01 00:54:47 +08:00
|
|
|
.@{checkbox-inner-prefix-cls}:after {
|
|
|
|
animation-name: none;
|
2017-01-01 22:20:06 +08:00
|
|
|
border-color: @disabled-color;
|
2016-04-27 20:44:36 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{checkbox-inner-prefix-cls} {
|
2016-11-01 00:54:47 +08:00
|
|
|
border-color: @border-color-base!important;
|
2016-04-27 20:44:36 +08:00
|
|
|
background-color: #f3f3f3;
|
|
|
|
&:after {
|
|
|
|
animation-name: none;
|
|
|
|
border-color: #f3f3f3;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-06-23 11:15:24 +08:00
|
|
|
& + span {
|
2017-01-01 22:20:06 +08:00
|
|
|
color: @disabled-color;
|
2016-11-08 20:45:56 +08:00
|
|
|
cursor: not-allowed;
|
2016-06-23 11:15:24 +08:00
|
|
|
}
|
2016-04-27 20:44:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.@{checkbox-prefix-cls}-wrapper {
|
|
|
|
cursor: pointer;
|
|
|
|
font-size: @font-size-base;
|
2016-06-22 18:08:52 +08:00
|
|
|
display: inline-block;
|
2016-11-23 17:47:15 +08:00
|
|
|
&:not(:last-child) {
|
|
|
|
margin-right: 8px;
|
2016-06-27 14:52:46 +08:00
|
|
|
}
|
2016-04-27 20:44:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.@{checkbox-prefix-cls}-wrapper + span,
|
|
|
|
.@{checkbox-prefix-cls} + span {
|
2016-11-01 00:54:47 +08:00
|
|
|
padding-left: 8px;
|
|
|
|
padding-right: 8px;
|
2016-04-27 20:44:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.@{checkbox-prefix-cls}-group {
|
|
|
|
font-size: @font-size-base;
|
|
|
|
&-item {
|
|
|
|
display: inline-block;
|
|
|
|
}
|
|
|
|
}
|
2016-06-23 12:30:45 +08:00
|
|
|
|
|
|
|
@ie8: \0screen;
|
|
|
|
|
|
|
|
// IE8 hack for https://github.com/ant-design/ant-design/issues/2148
|
|
|
|
@media @ie8 {
|
|
|
|
.@{checkbox-prefix-cls}-checked .@{checkbox-prefix-cls}-inner:before,
|
|
|
|
.@{checkbox-prefix-cls}-checked .@{checkbox-prefix-cls}-inner:after {
|
2016-09-18 09:54:47 +08:00
|
|
|
.iconfont-font("\e632");
|
2016-06-23 12:30:45 +08:00
|
|
|
font-weight: bold;
|
|
|
|
font-size: 8px;
|
|
|
|
border: 0;
|
|
|
|
color: #fff;
|
|
|
|
left: 2px;
|
|
|
|
top: 3px;
|
|
|
|
position: absolute;
|
|
|
|
}
|
|
|
|
}
|
2016-04-27 20:44:36 +08:00
|
|
|
}
|