ant-design/components/badge/style/index.less

178 lines
3.3 KiB
Plaintext
Raw Normal View History

2018-12-07 16:17:45 +08:00
@import '../../style/themes/default';
@import '../../style/mixins/index';
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} {
.reset-component;
2015-09-01 13:59:07 +08:00
position: relative;
display: inline-block;
2015-09-18 17:24:14 +08:00
line-height: 1;
2018-08-14 12:26:53 +08:00
color: unset;
2015-09-01 13:59:07 +08:00
&-count {
2018-08-20 14:53:58 +08:00
top: -@badge-height / 2;
height: @badge-height;
border-radius: @badge-height / 2;
min-width: @badge-height;
2016-11-09 21:30:02 +08:00
background: @highlight-color;
2015-09-01 13:59:07 +08:00
color: #fff;
line-height: @badge-height;
2015-09-01 13:59:07 +08:00
text-align: center;
padding: 0 6px;
font-size: @badge-font-size;
2018-02-14 12:35:52 +08:00
font-weight: @badge-font-weight;
2015-09-01 13:59:07 +08:00
white-space: nowrap;
box-shadow: 0 0 0 1px #fff;
2018-11-14 23:44:38 +08:00
z-index: 10;
2015-11-26 19:32:55 +08:00
a,
a:hover {
2015-09-01 13:59:07 +08:00
color: #fff;
}
}
2017-10-18 17:19:42 +08:00
&-multiple-words {
padding: 0 8px;
}
2015-09-01 13:59:07 +08:00
&-dot {
2018-08-20 14:53:58 +08:00
top: -@badge-dot-size / 2;
height: @badge-dot-size;
width: @badge-dot-size;
2015-09-01 13:59:07 +08:00
border-radius: 100%;
2016-11-09 21:30:02 +08:00
background: @highlight-color;
2015-09-01 13:59:07 +08:00
z-index: 10;
2015-09-01 17:26:06 +08:00
box-shadow: 0 0 0 1px #fff;
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,
&-dot,
.@{number-prefix-cls}-custom-component {
2018-08-20 14:53:58 +08:00
position: absolute;
right: 0;
transform: translateX(50%);
transform-origin: 100%;
}
.@{number-prefix-cls}-custom-component {
transform: translate(50%, -50%);
}
&-status {
2016-10-12 19:42:10 +08:00
line-height: inherit;
vertical-align: baseline;
2016-10-12 19:42:10 +08:00
&-dot {
width: @badge-status-size;
height: @badge-status-size;
2016-10-12 19:42:10 +08:00
display: inline-block;
border-radius: 50%;
vertical-align: middle;
position: relative;
top: -1px;
2016-10-12 19:42:10 +08:00
}
&-success {
background-color: @success-color;
}
&-processing {
background-color: @processing-color;
position: relative;
&:after {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border-radius: 50%;
border: 1px solid @processing-color;
2018-12-07 16:17:45 +08:00
content: '';
animation: antStatusProcessing 1.2s infinite ease-in-out;
}
}
&-default {
background-color: @normal-color;
}
&-error {
background-color: @error-color;
}
&-warning {
background-color: @warning-color;
}
&-text {
color: @text-color;
2017-08-08 14:23:50 +08:00
font-size: @font-size-base;
2016-10-12 19:42:10 +08:00
margin-left: 8px;
}
}
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;
}
&-not-a-wrapper {
vertical-align: middle;
2018-03-23 11:45:39 +08:00
.@{ant-prefix}-scroll-number {
top: auto;
display: block;
position: relative;
}
.@{badge-prefix-cls}-count {
transform: none;
}
}
2015-09-01 13:59:07 +08:00
}
2015-09-01 17:16:51 +08:00
@keyframes antStatusProcessing {
0% {
transform: scale(0.8);
opacity: 0.5;
2017-02-13 15:01:02 +08:00
}
100% {
transform: scale(2.4);
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;
2018-12-07 16:17:45 +08:00
transition: all 0.3s @ease-in-out;
height: @badge-height;
> p {
height: @badge-height;
margin: 0;
}
2015-11-19 16:58:56 +08:00
}
}
2015-11-19 00:13:16 +08:00
@keyframes antZoomBadgeIn {
0% {
opacity: 0;
2018-08-20 14:53:58 +08:00
transform: scale(0) translateX(50%);
2015-11-19 00:13:16 +08:00
}
100% {
2018-08-20 14:53:58 +08:00
transform: scale(1) translateX(50%);
2015-11-19 00:13:16 +08:00
}
}
@keyframes antZoomBadgeOut {
0% {
2018-08-20 14:53:58 +08:00
transform: scale(1) translateX(50%);
2015-11-19 00:13:16 +08:00
}
100% {
opacity: 0;
2018-08-20 14:53:58 +08:00
transform: scale(0) translateX(50%);
2015-11-19 00:13:16 +08:00
}
}