Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style(tab-bar): add Chrome-style divider between inactive tabs (#14892)

Arvin Xu1cc92db5e22c
diff --git a/src/features/Electron/titlebar/TabBar/TabItem.tsx b/src/features/Electron/titlebar/TabBar/TabItem.tsx
index 725848ca8c8..b66fad40afb 100644
--- a/src/features/Electron/titlebar/TabBar/TabItem.tsx
+++ b/src/features/Electron/titlebar/TabBar/TabItem.tsx
@@ -100,6 +100,7 @@ const TabItem = memo<TabItemProps>(
horizontal
align="center"
className={cx(electronStylish.nodrag, styles.tab, isActive && styles.tabActive)}
+ data-active={isActive ? 'true' : undefined}
gap={6}
onClick={handleClick}
>
diff --git a/src/features/Electron/titlebar/TabBar/index.tsx b/src/features/Electron/titlebar/TabBar/index.tsx
index 089fc866163..a7e8dcf638f 100644
--- a/src/features/Electron/titlebar/TabBar/index.tsx
+++ b/src/features/Electron/titlebar/TabBar/index.tsx
@@ -19,7 +19,7 @@ import { useStyles } from './styles';
import TabItem from './TabItem';
const TAB_WIDTH = 180;
-const TAB_GAP = 2;
+const TAB_GAP = 0;
const TabBar = () => {
const styles = useStyles;
diff --git a/src/features/Electron/titlebar/TabBar/styles.ts b/src/features/Electron/titlebar/TabBar/styles.ts
index b50be8141ad..5a78e8e60e6 100644
--- a/src/features/Electron/titlebar/TabBar/styles.ts
+++ b/src/features/Electron/titlebar/TabBar/styles.ts
@@ -68,6 +68,29 @@ export const useStyles = createStaticStyles(({ css, cssVar }) => ({
&:hover {
background-color: ${cssVar.colorFillTertiary};
}
+
+ & + &::before {
+ content: '';
+
+ position: absolute;
+ inset-block-start: 50%;
+ inset-inline-start: 0;
+ transform: translateY(-50%);
+
+ width: 1px;
+ height: 16px;
+
+ background-color: ${cssVar.colorBorderSecondary};
+
+ transition: opacity 0.15s ${cssVar.motionEaseInOut};
+ }
+
+ &:hover::before,
+ &[data-active='true']::before,
+ &:hover + &::before,
+ &[data-active='true'] + &::before {
+ opacity: 0;
+ }
`,
tabActive: css`
background-color: ${cssVar.colorBgElevated};