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: align internal link labels with surrounding text (#19322)

YuTengjing159a34dfcf11
diff --git a/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx b/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx
index 2d8565e9a91..81b58e7e3b1 100644
--- a/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx
+++ b/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx
@@ -30,10 +30,14 @@ import {
} from './InternalEntityPreview';
const styles = createStaticStyles(({ css, cssVar }) => ({
+ icon: css`
+ margin-inline-end: 4px;
+ color: ${cssVar.colorTextSecondary};
+ vertical-align: -0.15em;
+ `,
link: css`
- display: inline-flex;
- gap: 4px;
- align-items: center;
+ /* Keep the label on the surrounding text baseline instead of the icon's flex baseline. */
+ display: inline;
color: ${cssVar.colorText} !important;
@@ -59,11 +63,6 @@ const styles = createStaticStyles(({ css, cssVar }) => ({
outline: 2px solid ${cssVar.colorPrimaryBorder};
outline-offset: 2px;
}
-
- > svg {
- flex: none;
- color: ${cssVar.colorTextSecondary};
- }
`,
}));
@@ -223,7 +222,7 @@ export const InternalEntityLink = memo<InternalEntityLinkProps>(({ href, label,
target="_blank"
onClick={handleClick}
>
- {icon && <Icon icon={icon} size={14} />}
+ {icon && <Icon className={styles.icon} icon={icon} size={14} />}
{displayLabel}
</a>
);