feat: add Badge component #6573

This commit is contained in:
chenjiahan
2020-10-02 16:46:57 +08:00
parent f75c8231c6
commit 475e60b282
17 changed files with 336 additions and 46 deletions
+15 -6
View File
@@ -1,9 +1,7 @@
@import '../style/var';
.van-badge {
position: absolute;
top: 0;
right: 0;
display: inline-block;
box-sizing: border-box;
min-width: @badge-size;
padding: @badge-padding;
@@ -15,9 +13,15 @@
text-align: center;
background-color: @badge-background-color;
border: @badge-border-width solid @white;
border-radius: @badge-size;
transform: translate(50%, -50%);
transform-origin: 100%;
border-radius: @border-radius-max;
&--fixed {
position: absolute;
top: 0;
right: 0;
transform: translate(50%, -50%);
transform-origin: 100%;
}
&--dot {
width: @badge-dot-size;
@@ -26,4 +30,9 @@
background-color: @badge-dot-color;
border-radius: 100%;
}
&__wrapper {
position: relative;
display: inline-block;
}
}