From 6a75f89e4a13b3b31b37417e473fd762ae4631fc Mon Sep 17 00:00:00 2001 From: yutent Date: Fri, 17 Nov 2023 10:14:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96badge=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/badge/index.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/badge/index.js b/src/badge/index.js index b89b264..4de9a09 100644 --- a/src/badge/index.js +++ b/src/badge/index.js @@ -37,14 +37,13 @@ class Badge extends Component { .dot { position: absolute; z-index: 9; - left: calc(100% - 9px); - top: -8px; + left: calc(100% - 5px); + top: -6px; display: inline-flex; justify-content: center; align-items: center; - min-width: 14px; - height: 14px; - padding: 0 4px; + min-width: 10px; + min-height: 10px; border-radius: 10px; background: var(--color-red-1); -webkit-user-select: none; @@ -52,12 +51,18 @@ class Badge extends Component { } .num { + padding: 1px 3px; line-height: 12px; font-size: 12px; font-style: normal; + text-align: center; white-space: nowrap; font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; color: #fff; + + &:not(:empty) { + min-width: 14px; + } } :host([hidden-value]) .dot {