Skip to content

Commit f1815ac

Browse files
wayne-shihdimaMachina
andauthoredOct 16, 2024··
fix(mdx-components): link no underline hover (#3465)
* fix(mdx-components): link no underline hover * Create cold-cooks-train.md --------- Co-authored-by: Dimitri POSTOLOV <dmytropostolov@gmail.com>
1 parent 98ae8aa commit f1815ac

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
 

Diff for: ‎.changeset/cold-cooks-train.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"nextra-theme-docs": patch
3+
---
4+
5+
From an accessibility POV (WCAG G13) there's a need of additional visual differentiation factor for hovers. Article achieves this but mdx doesn't.
6+
7+
So changing the mdx link behaviour so on hover the underline disappears.

Diff for: ‎packages/nextra-theme-docs/src/mdx-components.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export const Link = ({ href = '', className, ...props }: AnchorProps) => (
212212
href={href}
213213
newWindow={EXTERNAL_HREF_REGEX.test(href)}
214214
className={cn(
215-
'_text-primary-600 _underline _decoration-from-font [text-underline-position:from-font]',
215+
'_text-primary-600 _underline hover:_no-underline _decoration-from-font [text-underline-position:from-font]',
216216
className
217217
)}
218218
{...props}

0 commit comments

Comments
 (0)
Please sign in to comment.