ant-design/style/components/badge.less

95 lines
1.7 KiB
Plaintext
Raw Normal View History

2015-09-01 13:59:07 +08:00
@badge-prefix-cls: ~"@{css-prefix}badge";
2015-11-23 22:58:11 +08:00
@number-prefix-cls: ~"@{css-prefix}scroll-number";
2015-09-01 13:59:07 +08:00
.@{badge-prefix-cls} {
position: relative;
display: inline-block;
2015-09-18 17:24:14 +08:00
line-height: 1;
2015-09-01 13:59:07 +08:00
&-count {
position: absolute;
transform: translateX(-50%);
top: -10px;
height: 20px;
border-radius: 10px;
min-width: 20px;
background: @error-color;
color: #fff;
line-height: 20px;
text-align: center;
padding: 0 7px;
font-size: 12px;
white-space: nowrap;
2015-11-18 23:42:01 +08:00
transform-origin: -10% center;
2015-09-01 13:59:07 +08:00
z-index: 10;
font-family: tahoma;
2015-09-01 17:26:06 +08:00
box-shadow: 0 0 0 1px #fff;
2015-11-26 19:32:55 +08:00
a,
a:hover {
2015-09-01 13:59:07 +08:00
color: #fff;
}
}
&-dot {
position: absolute;
2015-11-18 23:42:01 +08:00
transform: translateX(-50%);
transform-origin: 0px center;
2015-09-01 13:59:07 +08:00
top: -4px;
height: 8px;
width: 8px;
border-radius: 100%;
background: @error-color;
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
&-zoom-appear,
&-zoom-enter {
animation: antZoomBadgeIn .3s @ease-out-back;
animation-fill-mode: both;
}
&-zoom-leave {
animation: antZoomBadgeOut .3s @ease-in-back;
animation-fill-mode: both;
}
2015-09-01 13:59:07 +08:00
}
2015-09-01 17:16:51 +08:00
a .@{badge-prefix-cls} {
&-count:hover {
background: tint(@error-color, 20%);
}
&-count:active {
background: shade(@error-color, 5%);
}
}
2015-11-18 23:42:01 +08:00
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;
2015-11-24 15:29:57 +08:00
transition: transform .3s @ease-in-out;
2015-11-19 16:58:56 +08:00
}
}
2015-11-19 00:13:16 +08:00
@keyframes antZoomBadgeIn {
0% {
opacity: 0;
transform: scale(0) translateX(-50%);
}
100% {
transform: scale(1) translateX(-50%);
}
}
@keyframes antZoomBadgeOut {
0% {
transform: scale(1) translateX(-50%);
}
100% {
opacity: 0;
transform: scale(0) translateX(-50%);
}
}
2015-11-23 22:58:11 +08:00