refactor(editor): style links with brand color and subtle underline

- Use var(--brand) instead of var(--primary) for link color (blue vs
  near-black)
- Add default underline at 40% opacity, full opacity on hover
- Remove Tailwind HTMLAttributes from Link extensions — let CSS control
  all link styling uniformly
- Mention cards unaffected (a.issue-mention overrides with color: inherit)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Naiyuan Qing 2026-04-03 10:47:19 +08:00
parent eb355dbc9c
commit 30640436c4
2 changed files with 5 additions and 10 deletions

View file

@ -287,14 +287,15 @@
/* Links */
.rich-text-editor a {
color: var(--primary);
text-decoration: none;
color: var(--brand);
text-decoration: underline;
text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent);
text-underline-offset: 2px;
cursor: pointer;
}
.rich-text-editor a:hover {
text-decoration: underline;
text-underline-offset: 2px;
text-decoration-color: var(--brand);
}
/* Issue mention cards — inline cards that sit within text flow */

View file

@ -27,17 +27,11 @@ const LinkEditable = Link.extend({ inclusive: false }).configure({
openOnClick: true,
autolink: true,
linkOnPaste: false,
HTMLAttributes: {
class: "text-primary hover:underline cursor-pointer",
},
});
const LinkReadonly = Link.configure({
openOnClick: false,
autolink: false,
HTMLAttributes: {
class: "text-primary hover:underline cursor-pointer",
},
});
const ImageExtension = Image.extend({