2019-05-06 12:04:39 +08:00
|
|
|
@import '../../style/themes/index';
|
2018-12-07 16:17:45 +08:00
|
|
|
@import '../../style/mixins/index';
|
2016-04-27 20:44:36 +08:00
|
|
|
|
2018-12-07 16:17:45 +08:00
|
|
|
@badge-prefix-cls: ~'@{ant-prefix}-badge';
|
|
|
|
@number-prefix-cls: ~'@{ant-prefix}-scroll-number';
|
2015-09-01 13:59:07 +08:00
|
|
|
|
|
|
|
.@{badge-prefix-cls} {
|
2017-09-22 18:33:29 +08:00
|
|
|
.reset-component;
|
2019-04-15 10:52:00 +08:00
|
|
|
|
2015-09-01 13:59:07 +08:00
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
2018-08-14 12:26:53 +08:00
|
|
|
color: unset;
|
2019-02-15 10:48:07 +08:00
|
|
|
line-height: 1;
|
2015-09-01 13:59:07 +08:00
|
|
|
|
|
|
|
&-count {
|
2019-02-15 10:48:07 +08:00
|
|
|
z-index: @zindex-badge;
|
2017-02-03 14:20:42 +08:00
|
|
|
min-width: @badge-height;
|
2019-02-15 10:48:07 +08:00
|
|
|
height: @badge-height;
|
2015-12-18 17:27:22 +08:00
|
|
|
padding: 0 6px;
|
2019-02-15 10:48:07 +08:00
|
|
|
color: @badge-text-color;
|
2018-02-14 12:35:52 +08:00
|
|
|
font-weight: @badge-font-weight;
|
2019-02-15 10:48:07 +08:00
|
|
|
font-size: @badge-font-size;
|
|
|
|
line-height: @badge-height;
|
2015-09-01 13:59:07 +08:00
|
|
|
white-space: nowrap;
|
2019-02-15 10:48:07 +08:00
|
|
|
text-align: center;
|
|
|
|
background: @highlight-color;
|
|
|
|
border-radius: @badge-height / 2;
|
2018-12-04 13:11:31 +08:00
|
|
|
box-shadow: 0 0 0 1px @shadow-color-inverse;
|
2015-11-26 19:32:55 +08:00
|
|
|
a,
|
|
|
|
a:hover {
|
2018-12-04 13:11:31 +08:00
|
|
|
color: @badge-text-color;
|
2015-09-01 13:59:07 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-10-18 17:19:42 +08:00
|
|
|
&-multiple-words {
|
|
|
|
padding: 0 8px;
|
|
|
|
}
|
|
|
|
|
2015-09-01 13:59:07 +08:00
|
|
|
&-dot {
|
2019-02-15 10:48:07 +08:00
|
|
|
z-index: @zindex-badge;
|
2017-02-03 14:20:42 +08:00
|
|
|
width: @badge-dot-size;
|
2019-02-15 10:48:07 +08:00
|
|
|
height: @badge-dot-size;
|
2016-11-09 21:30:02 +08:00
|
|
|
background: @highlight-color;
|
2019-02-15 10:48:07 +08:00
|
|
|
border-radius: 100%;
|
2019-01-06 13:34:41 +08:00
|
|
|
box-shadow: 0 0 0 1px @shadow-color-inverse;
|
2015-09-01 13:59:07 +08:00
|
|
|
}
|
2015-11-19 00:13:16 +08:00
|
|
|
|
2018-08-20 14:53:58 +08:00
|
|
|
&-count,
|
2018-10-16 15:07:24 +08:00
|
|
|
&-dot,
|
|
|
|
.@{number-prefix-cls}-custom-component {
|
2018-08-20 14:53:58 +08:00
|
|
|
position: absolute;
|
2018-12-26 18:58:52 +08:00
|
|
|
top: 0;
|
2019-02-15 10:48:07 +08:00
|
|
|
right: 0;
|
2018-10-16 15:07:24 +08:00
|
|
|
transform: translate(50%, -50%);
|
2018-12-26 18:58:52 +08:00
|
|
|
transform-origin: 100% 0%;
|
2018-10-16 15:07:24 +08:00
|
|
|
}
|
|
|
|
|
2016-08-20 17:43:46 +08:00
|
|
|
&-status {
|
2016-10-12 19:42:10 +08:00
|
|
|
line-height: inherit;
|
|
|
|
vertical-align: baseline;
|
2016-08-20 17:43:46 +08:00
|
|
|
|
2016-10-12 19:42:10 +08:00
|
|
|
&-dot {
|
2019-02-15 10:48:07 +08:00
|
|
|
position: relative;
|
|
|
|
top: -1px;
|
|
|
|
display: inline-block;
|
2017-09-27 22:32:49 +08:00
|
|
|
width: @badge-status-size;
|
|
|
|
height: @badge-status-size;
|
|
|
|
vertical-align: middle;
|
2019-02-15 10:48:07 +08:00
|
|
|
border-radius: 50%;
|
2016-10-12 19:42:10 +08:00
|
|
|
}
|
2016-08-20 17:43:46 +08:00
|
|
|
&-success {
|
|
|
|
background-color: @success-color;
|
|
|
|
}
|
|
|
|
&-processing {
|
2017-02-13 14:49:03 +08:00
|
|
|
position: relative;
|
2019-02-15 10:48:07 +08:00
|
|
|
background-color: @processing-color;
|
|
|
|
&::after {
|
2017-02-13 14:49:03 +08:00
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2017-11-11 14:15:16 +08:00
|
|
|
border: 1px solid @processing-color;
|
2019-02-15 10:48:07 +08:00
|
|
|
border-radius: 50%;
|
2017-02-13 14:49:03 +08:00
|
|
|
animation: antStatusProcessing 1.2s infinite ease-in-out;
|
2019-02-15 10:48:07 +08:00
|
|
|
content: '';
|
2017-02-13 14:49:03 +08:00
|
|
|
}
|
2016-08-20 17:43:46 +08:00
|
|
|
}
|
|
|
|
&-default {
|
|
|
|
background-color: @normal-color;
|
|
|
|
}
|
|
|
|
&-error {
|
|
|
|
background-color: @error-color;
|
|
|
|
}
|
|
|
|
&-warning {
|
|
|
|
background-color: @warning-color;
|
|
|
|
}
|
2019-03-31 20:21:20 +08:00
|
|
|
|
|
|
|
// mixin to iterate over colors and create CSS class for each one
|
|
|
|
.make-color-classes(@i: length(@preset-colors)) when (@i > 0) {
|
|
|
|
.make-color-classes(@i - 1);
|
|
|
|
@color: extract(@preset-colors, @i);
|
|
|
|
@darkColor: '@{color}-6';
|
|
|
|
&-@{color} {
|
|
|
|
background: @@darkColor;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.make-color-classes();
|
|
|
|
|
2016-08-20 17:43:46 +08:00
|
|
|
&-text {
|
2019-02-15 10:48:07 +08:00
|
|
|
margin-left: 8px;
|
2016-08-20 17:43:46 +08:00
|
|
|
color: @text-color;
|
2017-08-08 14:23:50 +08:00
|
|
|
font-size: @font-size-base;
|
2016-08-20 17:43:46 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-19 00:13:16 +08:00
|
|
|
&-zoom-appear,
|
|
|
|
&-zoom-enter {
|
2018-12-07 16:17:45 +08:00
|
|
|
animation: antZoomBadgeIn 0.3s @ease-out-back;
|
2015-11-19 00:13:16 +08:00
|
|
|
animation-fill-mode: both;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-zoom-leave {
|
2018-12-07 16:17:45 +08:00
|
|
|
animation: antZoomBadgeOut 0.3s @ease-in-back;
|
2015-11-19 00:13:16 +08:00
|
|
|
animation-fill-mode: both;
|
|
|
|
}
|
2015-12-18 17:27:22 +08:00
|
|
|
|
2018-10-08 17:19:30 +08:00
|
|
|
&-not-a-wrapper {
|
2019-03-14 12:15:56 +08:00
|
|
|
&:not(.@{badge-prefix-cls}-status) {
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
2018-03-23 11:45:39 +08:00
|
|
|
|
2018-10-08 17:19:30 +08:00
|
|
|
.@{ant-prefix}-scroll-number {
|
2019-02-15 10:48:07 +08:00
|
|
|
position: relative;
|
2018-10-08 17:19:30 +08:00
|
|
|
top: auto;
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{badge-prefix-cls}-count {
|
|
|
|
transform: none;
|
|
|
|
}
|
2015-12-18 17:27:22 +08:00
|
|
|
}
|
2015-09-01 13:59:07 +08:00
|
|
|
}
|
2015-09-01 17:16:51 +08:00
|
|
|
|
2016-08-20 17:43:46 +08:00
|
|
|
@keyframes antStatusProcessing {
|
2017-02-13 14:49:03 +08:00
|
|
|
0% {
|
|
|
|
transform: scale(0.8);
|
|
|
|
opacity: 0.5;
|
2017-02-13 15:01:02 +08:00
|
|
|
}
|
|
|
|
100% {
|
2017-02-13 14:49:03 +08:00
|
|
|
transform: scale(2.4);
|
2016-08-20 17:43:46 +08:00
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-26 19:32:55 +08:00
|
|
|
.@{number-prefix-cls} {
|
2015-11-19 16:58:56 +08:00
|
|
|
overflow: hidden;
|
2015-11-26 19:32:55 +08:00
|
|
|
&-only {
|
2015-11-19 16:58:56 +08:00
|
|
|
display: inline-block;
|
2017-02-03 14:20:42 +08:00
|
|
|
height: @badge-height;
|
2019-02-15 10:48:07 +08:00
|
|
|
transition: all 0.3s @ease-in-out;
|
2017-02-03 14:20:42 +08:00
|
|
|
> p {
|
|
|
|
height: @badge-height;
|
2017-09-27 22:32:49 +08:00
|
|
|
margin: 0;
|
2017-02-03 14:20:42 +08:00
|
|
|
}
|
2015-11-19 16:58:56 +08:00
|
|
|
}
|
2019-04-02 19:01:12 +08:00
|
|
|
|
|
|
|
&-symbol {
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
2015-11-19 16:58:56 +08:00
|
|
|
}
|
|
|
|
|
2015-11-19 00:13:16 +08:00
|
|
|
@keyframes antZoomBadgeIn {
|
|
|
|
0% {
|
2018-12-26 18:58:52 +08:00
|
|
|
transform: scale(0) translate(50%, -50%);
|
2019-02-15 10:48:07 +08:00
|
|
|
opacity: 0;
|
2015-11-19 00:13:16 +08:00
|
|
|
}
|
|
|
|
100% {
|
2018-12-26 18:58:52 +08:00
|
|
|
transform: scale(1) translate(50%, -50%);
|
2015-11-19 00:13:16 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes antZoomBadgeOut {
|
|
|
|
0% {
|
2018-12-26 18:58:52 +08:00
|
|
|
transform: scale(1) translate(50%, -50%);
|
2015-11-19 00:13:16 +08:00
|
|
|
}
|
|
|
|
100% {
|
2018-12-26 18:58:52 +08:00
|
|
|
transform: scale(0) translate(50%, -50%);
|
2019-02-15 10:48:07 +08:00
|
|
|
opacity: 0;
|
2015-11-19 00:13:16 +08:00
|
|
|
}
|
|
|
|
}
|