From dce2fd876da0038dcd08c5877fff5302d1bdade4 Mon Sep 17 00:00:00 2001 From: Xiao Yijun Date: Thu, 26 Oct 2023 10:21:30 +0800 Subject: [PATCH] style(experience): remove the margin of dividers without a label (#4747) --- .../src/components/Divider/index.module.scss | 12 +++++++----- packages/experience/src/components/Divider/index.tsx | 6 ++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/experience/src/components/Divider/index.module.scss b/packages/experience/src/components/Divider/index.module.scss index 3a31bc8d2..964739418 100644 --- a/packages/experience/src/components/Divider/index.module.scss +++ b/packages/experience/src/components/Divider/index.module.scss @@ -11,12 +11,14 @@ height: 1px; background: var(--color-line-divider); - &:first-child { - margin-right: _.unit(4); - } + &.withLabel { + &:first-child { + margin-right: _.unit(4); + } - &:last-child { - margin-left: _.unit(4); + &:last-child { + margin-left: _.unit(4); + } } } } diff --git a/packages/experience/src/components/Divider/index.tsx b/packages/experience/src/components/Divider/index.tsx index 245afee97..e33c369c3 100644 --- a/packages/experience/src/components/Divider/index.tsx +++ b/packages/experience/src/components/Divider/index.tsx @@ -11,13 +11,15 @@ type Props = { }; const Divider = ({ className, label }: Props) => { + const lineStyle = classNames(styles.line, label && styles.withLabel); + return (
- + {label && ( <> - + )}