From 44e27799e62efcb3a15809ba86cf9d33f5529dd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=9C=E9=A3=8E=E4=BD=BF=E5=91=BD=E5=BF=85=E8=BE=BE?= <1664677472@qq.com> Date: Mon, 9 Sep 2024 23:47:31 -0700 Subject: [PATCH] feat(badge): [badge] Adapting to the SMB theme (#2087) * feat(badge): [badge] Adapting to the SMB theme * feat(badge): [badge] Adapting to the SMB theme * feat(badge): [badge] Adapting to the SMB theme --- packages/theme/src/badge/index.less | 2 +- packages/theme/src/badge/smb-theme.js | 3 ++- packages/theme/src/badge/vars.less | 1 + packages/vue/src/badge/src/pc.vue | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/theme/src/badge/index.less b/packages/theme/src/badge/index.less index 46cfaa9426..2039ae7283 100644 --- a/packages/theme/src/badge/index.less +++ b/packages/theme/src/badge/index.less @@ -33,7 +33,7 @@ vertical-align: baseline; white-space: nowrap; text-align: center; - margin-left: 4px; + margin-left: var(--ti-badge-margin-left); border: var(--ti-badge-border) solid #FFFFFF; &:empty { diff --git a/packages/theme/src/badge/smb-theme.js b/packages/theme/src/badge/smb-theme.js index e3a2d83a10..a70b51702d 100644 --- a/packages/theme/src/badge/smb-theme.js +++ b/packages/theme/src/badge/smb-theme.js @@ -6,5 +6,6 @@ export const tinyBadgeSmbTheme = { 'ti-badge-text-color': 'var(--ti-base-color-bg-7)', 'ti-badge-border-radius': 'var(--ti-common-border-radius-4)', 'ti-badge-border': 'var(--ti-common-border-weight-normal)', - 'ti-badge-font-weight': 'var(--ti-common-font-weight-normal)' + 'ti-badge-font-weight': 'var(--ti-common-font-weight-normal)', + 'ti-badge-margin-left': '0' } diff --git a/packages/theme/src/badge/vars.less b/packages/theme/src/badge/vars.less index 9b5b5a6795..50c49afadb 100644 --- a/packages/theme/src/badge/vars.less +++ b/packages/theme/src/badge/vars.less @@ -27,4 +27,5 @@ --ti-badge-danger-bg-color: var(--ti-base-color-error-3, #f66f6a); --ti-badge-info-bg-color: var(--ti-common-color-info-normal, #252b3a); --ti-badge-border: 0; + --ti-badge-margin-left: 4px; } diff --git a/packages/vue/src/badge/src/pc.vue b/packages/vue/src/badge/src/pc.vue index c2bdd2a3e4..e111ecbd01 100644 --- a/packages/vue/src/badge/src/pc.vue +++ b/packages/vue/src/badge/src/pc.vue @@ -22,7 +22,7 @@ type ? 'tiny-badge--' + type : '', badgeClass || '' ]" - :style="state.transform" + :style="!isDot ? state.transform : ''" > {{ state.content }}