2019-08-07 11:40:23 +08:00
|
|
|
@import './mixins/mixins.scss';
|
2019-09-17 19:21:07 +08:00
|
|
|
@import './themes/vars.scss';
|
2019-08-07 11:40:23 +08:00
|
|
|
|
2019-10-09 17:38:08 +08:00
|
|
|
@mixin badge-type-mixin ($type) {
|
|
|
|
@include m($type + '-type') {
|
|
|
|
@include b(badge-sup) {
|
2019-10-09 23:42:08 +08:00
|
|
|
background-color: map-get($map: $--badge-background-color, $key: $type);
|
|
|
|
@include e(ripple-mask) {
|
|
|
|
background-color: map-get($map: $--badge-background-color, $key: $type);
|
|
|
|
}
|
2019-10-08 19:06:23 +08:00
|
|
|
}
|
2019-10-09 17:38:08 +08:00
|
|
|
@include m(processing) {
|
|
|
|
@include b(badge-sup) {
|
2019-10-09 23:42:08 +08:00
|
|
|
&::before {
|
|
|
|
animation-duration: 2s, 2s;
|
2019-12-22 15:50:37 +08:00
|
|
|
animation-timing-function: $fast-in-cubic-bezier, $--n-ease-in-out-cubic-bezier;
|
2019-10-09 17:38:08 +08:00
|
|
|
animation-iteration-count: infinite, infinite;
|
2019-10-09 01:14:02 +08:00
|
|
|
}
|
2019-10-09 00:43:02 +08:00
|
|
|
}
|
2019-10-09 23:42:08 +08:00
|
|
|
@include not-m(dot) {
|
|
|
|
@include b(badge-sup) {
|
|
|
|
&::before {
|
|
|
|
animation-name: #{$theme}-#{$type}-badge-ripple--spread, #{$theme}-#{$type}-badge-ripple--opacity;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(processing) {
|
|
|
|
@include m(dot) {
|
|
|
|
@include b(badge-sup) {
|
|
|
|
&::before {
|
|
|
|
animation-name: #{$theme}-#{$type}-dot-badge-ripple--spread, #{$theme}-#{$type}-badge-ripple--opacity;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-08 19:06:23 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-09 17:38:08 +08:00
|
|
|
@mixin badge-ripple-mixin($type) {
|
|
|
|
@keyframes #{$theme}-#{$type}-badge-ripple--spread {
|
2019-10-09 23:42:08 +08:00
|
|
|
0% {
|
|
|
|
background-color: map-get($map: $--badge-rippling-color, $key: $type);
|
|
|
|
transform: scale(0);
|
2019-10-09 17:38:08 +08:00
|
|
|
}
|
2019-10-09 23:42:08 +08:00
|
|
|
25% {
|
|
|
|
background-color: map-get($map: $--badge-rippling-color, $key: $type);
|
|
|
|
transform: scale(1);
|
|
|
|
// box-shadow: 0 0 0 0px map-get($map: $--badge-rippling-color, $key: $type);
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
background-color: map-get($map: $--badge-rippling-color, $key: $type);
|
|
|
|
transform: scale(1.25);
|
|
|
|
// box-shadow: 0 0 0 4px map-get($map: $--badge-rippling-color, $key: $type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@keyframes #{$theme}-#{$type}-dot-badge-ripple--spread {
|
|
|
|
0% {
|
|
|
|
background-color: map-get($map: $--badge-rippling-color, $key: $type);
|
|
|
|
transform: scale(0);
|
|
|
|
}
|
|
|
|
25% {
|
|
|
|
background-color: map-get($map: $--badge-rippling-color, $key: $type);
|
|
|
|
transform: scale(1);
|
|
|
|
// box-shadow: 0 0 0 0px map-get($map: $--badge-rippling-color, $key: $type);
|
|
|
|
}
|
|
|
|
100% {
|
|
|
|
background-color: map-get($map: $--badge-rippling-color, $key: $type);
|
|
|
|
transform: scale(1.75);
|
|
|
|
// box-shadow: 0 0 0 4px map-get($map: $--badge-rippling-color, $key: $type);
|
2019-10-09 17:38:08 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@keyframes #{$theme}-#{$type}-badge-ripple--opacity {
|
2019-10-09 23:42:08 +08:00
|
|
|
0% {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
25% {
|
2019-10-09 18:11:54 +08:00
|
|
|
opacity: $--badge-rippling-start-opacity;
|
2019-10-09 17:38:08 +08:00
|
|
|
}
|
2019-10-09 23:42:08 +08:00
|
|
|
100% {
|
2019-10-09 17:38:08 +08:00
|
|
|
opacity: 0;
|
2019-10-08 14:36:04 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-10-09 17:38:08 +08:00
|
|
|
@include themes-mixin {
|
|
|
|
@include badge-ripple-mixin('default');
|
|
|
|
@include badge-ripple-mixin('info');
|
|
|
|
@include badge-ripple-mixin('success');
|
|
|
|
@include badge-ripple-mixin('warning');
|
|
|
|
@include badge-ripple-mixin('error');
|
|
|
|
@include b(badge) {
|
|
|
|
@include once {
|
|
|
|
display: inline-block;
|
|
|
|
position: relative;
|
|
|
|
vertical-align: middle;
|
2019-11-13 00:02:42 +08:00
|
|
|
@include m(as-is) {
|
|
|
|
display: inline-flex;
|
|
|
|
@include b(badge-sup) {
|
2019-12-06 17:05:40 +08:00
|
|
|
@include fade-in-scale-up-transition(badge, left bottom, $original-transform: translateX(0));
|
|
|
|
transform: translateX(0);
|
2019-11-13 00:02:42 +08:00
|
|
|
position: static;
|
|
|
|
}
|
|
|
|
}
|
2019-10-09 17:38:08 +08:00
|
|
|
@include m(dot) {
|
|
|
|
@include b(badge-sup) {
|
|
|
|
height: 8px;
|
|
|
|
width: 8px;
|
|
|
|
padding: 0;
|
|
|
|
min-width: 8px;
|
2019-11-22 13:21:32 +08:00
|
|
|
left: 100%;
|
2019-10-09 17:38:08 +08:00
|
|
|
bottom: calc(100% - 4px);
|
2019-10-09 23:42:08 +08:00
|
|
|
@include e(ripple-mask) {
|
|
|
|
border-radius: 4px;
|
|
|
|
}
|
|
|
|
&::before {
|
2019-10-09 17:38:08 +08:00
|
|
|
border-radius: 4px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include badge-type-mixin('default');
|
|
|
|
@include badge-type-mixin('info');
|
|
|
|
@include badge-type-mixin('success');
|
|
|
|
@include badge-type-mixin('warning');
|
|
|
|
@include badge-type-mixin('error');
|
|
|
|
}
|
|
|
|
@include once {
|
2019-10-08 14:36:04 +08:00
|
|
|
@include b(badge-sup) {
|
2019-12-06 17:05:40 +08:00
|
|
|
@include fade-in-scale-up-transition(badge, left bottom, $original-transform: (translateX(-50%)));
|
2019-12-22 15:50:37 +08:00
|
|
|
transition: background-color .3s $--n-ease-in-out-cubic-bezier, color .3s $--n-ease-in-out-cubic-bezier;
|
2019-10-09 17:38:08 +08:00
|
|
|
color: white;
|
|
|
|
position: absolute;
|
|
|
|
height: 18px;
|
|
|
|
line-height: 18px;
|
|
|
|
border-radius: 9px;
|
|
|
|
padding: 0 6px;
|
|
|
|
text-align: center;
|
|
|
|
font-size: 12px;
|
2019-11-22 13:21:32 +08:00
|
|
|
transform: translateX(-50%);
|
|
|
|
left: 100%;
|
2019-10-09 23:42:08 +08:00
|
|
|
bottom: calc(100% - 9px);
|
2019-12-23 16:48:49 +08:00
|
|
|
font-weight: 500;
|
2019-10-09 23:42:08 +08:00
|
|
|
@include e(ripple-mask) {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
border-radius: 9px;
|
|
|
|
}
|
|
|
|
&::before {
|
|
|
|
opacity: 0;
|
|
|
|
transform: scale(1);
|
2019-10-09 17:38:08 +08:00
|
|
|
border-radius: 9px;
|
|
|
|
content: "";
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
right: 0;
|
|
|
|
top: 0;
|
|
|
|
bottom: 0;
|
|
|
|
}
|
|
|
|
}
|
2019-08-07 11:40:23 +08:00
|
|
|
}
|
|
|
|
}
|