2020-03-07 19:45:13 +08:00
|
|
|
@import '../../style/themes/index';
|
2019-01-02 21:01:56 +08:00
|
|
|
@import '../../style/mixins/index';
|
2017-11-16 18:29:02 +08:00
|
|
|
|
2019-01-02 21:01:56 +08:00
|
|
|
@badge-prefix-cls: ~'@{ant-prefix}-badge';
|
|
|
|
@number-prefix-cls: ~'@{ant-prefix}-scroll-number';
|
2017-11-16 18:29:02 +08:00
|
|
|
|
|
|
|
.@{badge-prefix-cls} {
|
2020-12-27 14:50:32 +08:00
|
|
|
.reset-component();
|
2020-03-07 19:45:13 +08:00
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
2019-03-05 13:16:32 +08:00
|
|
|
line-height: 1;
|
2017-11-16 18:29:02 +08:00
|
|
|
|
|
|
|
&-count {
|
2021-06-07 17:35:03 +08:00
|
|
|
z-index: @zindex-badge;
|
2017-11-16 18:29:02 +08:00
|
|
|
min-width: @badge-height;
|
2019-03-05 13:16:32 +08:00
|
|
|
height: @badge-height;
|
2017-11-16 18:29:02 +08:00
|
|
|
padding: 0 6px;
|
2019-03-05 13:16:32 +08:00
|
|
|
color: @badge-text-color;
|
2018-02-22 15:09:03 +08:00
|
|
|
font-weight: @badge-font-weight;
|
2019-03-05 13:16:32 +08:00
|
|
|
font-size: @badge-font-size;
|
|
|
|
line-height: @badge-height;
|
2017-11-16 18:29:02 +08:00
|
|
|
white-space: nowrap;
|
2019-03-05 13:16:32 +08:00
|
|
|
text-align: center;
|
2021-06-07 17:35:03 +08:00
|
|
|
background: @badge-color;
|
2020-12-27 14:50:32 +08:00
|
|
|
border-radius: (@badge-height / 2);
|
2019-03-05 13:16:32 +08:00
|
|
|
box-shadow: 0 0 0 1px @shadow-color-inverse;
|
2022-03-12 09:56:32 +08:00
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
a,
|
|
|
|
a:hover {
|
2019-03-05 13:16:32 +08:00
|
|
|
color: @badge-text-color;
|
2017-11-16 18:29:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-07 17:35:03 +08:00
|
|
|
&-count-sm {
|
|
|
|
min-width: @badge-height-sm;
|
|
|
|
height: @badge-height-sm;
|
|
|
|
padding: 0;
|
|
|
|
font-size: @badge-font-size-sm;
|
|
|
|
line-height: @badge-height-sm;
|
|
|
|
border-radius: (@badge-height-sm / 2);
|
|
|
|
}
|
|
|
|
|
2018-01-16 11:13:22 +08:00
|
|
|
&-multiple-words {
|
|
|
|
padding: 0 8px;
|
|
|
|
}
|
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
&-dot {
|
2021-06-07 17:35:03 +08:00
|
|
|
z-index: @zindex-badge;
|
2017-11-16 18:29:02 +08:00
|
|
|
width: @badge-dot-size;
|
2021-06-07 17:35:03 +08:00
|
|
|
min-width: @badge-dot-size;
|
2019-03-05 13:16:32 +08:00
|
|
|
height: @badge-dot-size;
|
2017-11-16 18:29:02 +08:00
|
|
|
background: @highlight-color;
|
2019-03-05 13:16:32 +08:00
|
|
|
border-radius: 100%;
|
|
|
|
box-shadow: 0 0 0 1px @shadow-color-inverse;
|
2017-11-16 18:29:02 +08:00
|
|
|
}
|
|
|
|
|
2022-03-12 09:56:32 +08:00
|
|
|
// Tricky way to resolve https://github.com/ant-design/ant-design/issues/30088
|
|
|
|
&-dot.@{number-prefix-cls} {
|
|
|
|
transition: background 1.5s;
|
|
|
|
}
|
|
|
|
|
2018-09-16 21:36:22 +08:00
|
|
|
&-count,
|
2019-01-02 21:01:56 +08:00
|
|
|
&-dot,
|
|
|
|
.@{number-prefix-cls}-custom-component {
|
2018-09-16 21:36:22 +08:00
|
|
|
position: absolute;
|
2019-03-05 13:16:32 +08:00
|
|
|
top: 0;
|
2018-09-16 21:36:22 +08:00
|
|
|
right: 0;
|
2019-01-02 21:01:56 +08:00
|
|
|
transform: translate(50%, -50%);
|
2019-03-05 13:16:32 +08:00
|
|
|
transform-origin: 100% 0%;
|
2021-06-07 17:35:03 +08:00
|
|
|
|
|
|
|
&.@{iconfont-css-prefix}-spin {
|
|
|
|
animation: antBadgeLoadingCircle 1s infinite linear;
|
|
|
|
}
|
2019-01-02 21:01:56 +08:00
|
|
|
}
|
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
&-status {
|
|
|
|
line-height: inherit;
|
|
|
|
vertical-align: baseline;
|
|
|
|
|
|
|
|
&-dot {
|
2019-03-05 13:16:32 +08:00
|
|
|
position: relative;
|
|
|
|
top: -1px;
|
|
|
|
display: inline-block;
|
2018-01-16 11:13:22 +08:00
|
|
|
width: @badge-status-size;
|
|
|
|
height: @badge-status-size;
|
|
|
|
vertical-align: middle;
|
2019-03-05 13:16:32 +08:00
|
|
|
border-radius: 50%;
|
2017-11-16 18:29:02 +08:00
|
|
|
}
|
2022-03-12 09:56:32 +08:00
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
&-success {
|
|
|
|
background-color: @success-color;
|
|
|
|
}
|
2022-03-12 09:56:32 +08:00
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
&-processing {
|
|
|
|
position: relative;
|
2019-03-05 13:16:32 +08:00
|
|
|
background-color: @processing-color;
|
2022-03-12 09:56:32 +08:00
|
|
|
|
2019-03-05 13:16:32 +08:00
|
|
|
&::after {
|
2017-11-16 18:29:02 +08:00
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2018-01-16 11:13:22 +08:00
|
|
|
border: 1px solid @processing-color;
|
2019-03-05 13:16:32 +08:00
|
|
|
border-radius: 50%;
|
2017-11-16 18:29:02 +08:00
|
|
|
animation: antStatusProcessing 1.2s infinite ease-in-out;
|
2019-03-05 13:16:32 +08:00
|
|
|
content: '';
|
2017-11-16 18:29:02 +08:00
|
|
|
}
|
|
|
|
}
|
2022-03-12 09:56:32 +08:00
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
&-default {
|
|
|
|
background-color: @normal-color;
|
|
|
|
}
|
2022-03-12 09:56:32 +08:00
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
&-error {
|
|
|
|
background-color: @error-color;
|
|
|
|
}
|
2022-03-12 09:56:32 +08:00
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
&-warning {
|
|
|
|
background-color: @warning-color;
|
|
|
|
}
|
2020-03-07 19:45:13 +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();
|
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
&-text {
|
2019-03-05 13:16:32 +08:00
|
|
|
margin-left: 8px;
|
2017-11-16 18:29:02 +08:00
|
|
|
color: @text-color;
|
|
|
|
font-size: @font-size-base;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&-zoom-appear,
|
2018-01-16 11:13:22 +08:00
|
|
|
&-zoom-enter {
|
2021-06-07 17:35:03 +08:00
|
|
|
animation: antZoomBadgeIn @animation-duration-slow @ease-out-back;
|
2017-11-16 18:29:02 +08:00
|
|
|
animation-fill-mode: both;
|
|
|
|
}
|
|
|
|
|
2018-01-16 11:13:22 +08:00
|
|
|
&-zoom-leave {
|
2021-06-07 17:35:03 +08:00
|
|
|
animation: antZoomBadgeOut @animation-duration-slow @ease-in-back;
|
2017-11-16 18:29:02 +08:00
|
|
|
animation-fill-mode: both;
|
|
|
|
}
|
|
|
|
|
2018-11-14 21:33:56 +08:00
|
|
|
&-not-a-wrapper {
|
2021-06-07 17:35:03 +08:00
|
|
|
.@{badge-prefix-cls}-zoom-appear,
|
|
|
|
.@{badge-prefix-cls}-zoom-enter {
|
|
|
|
animation: antNoWrapperZoomBadgeIn @animation-duration-slow @ease-out-back;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{badge-prefix-cls}-zoom-leave {
|
|
|
|
animation: antNoWrapperZoomBadgeOut @animation-duration-slow @ease-in-back;
|
|
|
|
}
|
|
|
|
|
2020-03-07 19:45:13 +08:00
|
|
|
&:not(.@{badge-prefix-cls}-status) {
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
2018-09-05 21:28:54 +08:00
|
|
|
|
2022-03-12 09:56:32 +08:00
|
|
|
.@{number-prefix-cls}-custom-component,
|
|
|
|
.@{badge-prefix-cls}-count {
|
2021-06-07 17:35:03 +08:00
|
|
|
transform: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.@{number-prefix-cls}-custom-component,
|
2022-03-12 09:56:32 +08:00
|
|
|
.@{number-prefix-cls} {
|
2019-03-05 13:16:32 +08:00
|
|
|
position: relative;
|
2018-11-14 21:33:56 +08:00
|
|
|
top: auto;
|
|
|
|
display: block;
|
2021-06-07 17:35:03 +08:00
|
|
|
transform-origin: 50% 50%;
|
2018-11-14 21:33:56 +08:00
|
|
|
}
|
2017-11-16 18:29:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes antStatusProcessing {
|
|
|
|
0% {
|
|
|
|
transform: scale(0.8);
|
|
|
|
opacity: 0.5;
|
|
|
|
}
|
2022-03-12 09:56:32 +08:00
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
100% {
|
|
|
|
transform: scale(2.4);
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-06-07 17:35:03 +08:00
|
|
|
// Safari will blink with transform when inner element has absolute style.
|
|
|
|
.safari-fix-motion() {
|
2022-03-12 09:56:32 +08:00
|
|
|
/* stylelint-disable property-no-vendor-prefix */
|
2021-06-07 17:35:03 +08:00
|
|
|
-webkit-transform-style: preserve-3d;
|
|
|
|
-webkit-backface-visibility: hidden;
|
2022-03-12 09:56:32 +08:00
|
|
|
/* stylelint-enable property-no-vendor-prefix */
|
2021-06-07 17:35:03 +08:00
|
|
|
}
|
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
.@{number-prefix-cls} {
|
|
|
|
overflow: hidden;
|
2022-03-12 09:56:32 +08:00
|
|
|
direction: ltr;
|
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
&-only {
|
2021-06-07 17:35:03 +08:00
|
|
|
position: relative;
|
2017-11-16 18:29:02 +08:00
|
|
|
display: inline-block;
|
|
|
|
height: @badge-height;
|
2021-06-07 17:35:03 +08:00
|
|
|
transition: all @animation-duration-slow @ease-in-out;
|
|
|
|
.safari-fix-motion;
|
|
|
|
|
2020-03-07 19:45:13 +08:00
|
|
|
> p.@{number-prefix-cls}-only-unit {
|
2017-11-16 18:29:02 +08:00
|
|
|
height: @badge-height;
|
2018-01-16 11:13:22 +08:00
|
|
|
margin: 0;
|
2021-06-07 17:35:03 +08:00
|
|
|
.safari-fix-motion;
|
2017-11-16 18:29:02 +08:00
|
|
|
}
|
|
|
|
}
|
2020-03-07 19:45:13 +08:00
|
|
|
|
|
|
|
&-symbol {
|
|
|
|
vertical-align: top;
|
|
|
|
}
|
2017-11-16 18:29:02 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes antZoomBadgeIn {
|
|
|
|
0% {
|
2019-03-05 13:16:32 +08:00
|
|
|
transform: scale(0) translate(50%, -50%);
|
2017-11-16 18:29:02 +08:00
|
|
|
opacity: 0;
|
|
|
|
}
|
2022-03-12 09:56:32 +08:00
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
100% {
|
2019-03-05 13:16:32 +08:00
|
|
|
transform: scale(1) translate(50%, -50%);
|
2017-11-16 18:29:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes antZoomBadgeOut {
|
|
|
|
0% {
|
2019-03-05 13:16:32 +08:00
|
|
|
transform: scale(1) translate(50%, -50%);
|
2017-11-16 18:29:02 +08:00
|
|
|
}
|
2022-03-12 09:56:32 +08:00
|
|
|
|
2017-11-16 18:29:02 +08:00
|
|
|
100% {
|
2019-03-05 13:16:32 +08:00
|
|
|
transform: scale(0) translate(50%, -50%);
|
2017-11-16 18:29:02 +08:00
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
}
|
2021-02-25 13:39:39 +08:00
|
|
|
|
2021-06-07 17:35:03 +08:00
|
|
|
@keyframes antNoWrapperZoomBadgeIn {
|
|
|
|
0% {
|
|
|
|
transform: scale(0);
|
|
|
|
opacity: 0;
|
|
|
|
}
|
2022-03-12 09:56:32 +08:00
|
|
|
|
2021-06-07 17:35:03 +08:00
|
|
|
100% {
|
|
|
|
transform: scale(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes antNoWrapperZoomBadgeOut {
|
|
|
|
0% {
|
|
|
|
transform: scale(1);
|
|
|
|
}
|
2022-03-12 09:56:32 +08:00
|
|
|
|
2021-06-07 17:35:03 +08:00
|
|
|
100% {
|
|
|
|
transform: scale(0);
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@keyframes antBadgeLoadingCircle {
|
|
|
|
0% {
|
|
|
|
transform-origin: 50%;
|
|
|
|
}
|
|
|
|
|
|
|
|
100% {
|
|
|
|
transform: translate(50%, -50%) rotate(360deg);
|
|
|
|
transform-origin: 50%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-02-25 13:39:39 +08:00
|
|
|
@import './ribbon';
|
2021-06-07 17:35:03 +08:00
|
|
|
@import './rtl';
|