naive-ui/styles/Badge.scss
2019-10-08 19:06:23 +08:00

138 lines
2.8 KiB
SCSS

@import './mixins/mixins.scss';
@import './themes/vars.scss';
@keyframes n-number-fade-up-in {
from {
transform: translateY(60%);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
@keyframes n-number-fade-down-in {
from {
transform: translateY(-60%);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}
@keyframes n-number-fade-up-out {
from {
transform: translateY(0%);
opacity: 1;
}
to {
transform: translateY(-60%);
opacity: 0;
}
}
@keyframes n-number-fade-down-out {
from {
transform: translateY(0%);
opacity: 1;
}
to {
transform: translateY(60%);
opacity: 0;
}
}
@include b(scroll-numbers) {
white-space: nowrap;
@include b(scroll-number) {
@include fade-up-width-expand-transition($duration: 2s);
display: inline-block;
position: relative;
@include e(old-number) {
display: inline-block;
opacity: 0;
@include m(top) {
position: absolute;
left: 0;
transform: translateY(-100%);
}
@include m(bottom) {
position: absolute;
left: 0;
transform: translateY(100%);
}
@include m(down-scroll) {
animation: n-number-fade-down-out 2s $fast-in-cubic-bezier;
animation-iteration-count: 1
}
@include m(up-scroll) {
animation: n-number-fade-up-out 2s $fast-in-cubic-bezier;
animation-iteration-count: 1
}
}
@include e(new-number) {
display: inline-block;
opacity: 1;
transform: translateY(0);
@include m(down-scroll) {
animation: n-number-fade-down-in 2s $fast-in-cubic-bezier;
animation-iteration-count: 1
}
@include m(up-scroll) {
animation: n-number-fade-up-in 2s $fast-in-cubic-bezier;
animation-iteration-count: 1
}
}
}
}
@mixin badge-type-mixin ($type) {
@include m($type + '-type') {
@include b(badge-sup) {
background-color: rgba(9, 133, 91, 1);
}
}
}
@include b(badge) {
display: inline-block;
position: relative;
vertical-align: middle;
@include m(dot) {
@include b(badge-sup) {
height: 8px;
width: 8px;
padding: 0;
min-width: 8px;
left: calc(100% - 4px);
bottom: calc(100% - 4px);
}
}
@include badge-type-mixin('info');
@include badge-type-mixin('success');
@include badge-type-mixin('warning');
@include badge-type-mixin('error');
}
@include b(badge-sup) {
@include fade-in-scale-up-transition(badge, left bottom);
overflow: hidden;
color: white;
user-select: none;
position: absolute;
height: 18px;
line-height: 18px;
border-radius: 9px;
background-color: rgba(186, 45, 67, 1);
padding: 0 6px;
text-align: center;
font-size: 12px;
left: calc(100% - 8px);
bottom: calc(100% - 8px);
font-weight: bold;
}