Skip to content

Commit

Permalink
fix(ui): fix typography of anchor in heading
Browse files Browse the repository at this point in the history
  • Loading branch information
tszhong0411 committed Feb 6, 2025
1 parent d000e75 commit 4c0a9c4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-maps-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@tszhong0411/ui': patch
---

Fix typography of anchor in heading
2 changes: 1 addition & 1 deletion apps/docs/src/components/mdx/heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Heading = <T extends Types = 'h1'>(props: HeadingProps<T>) => {

return (
<Component className={cn('scroll-m-32', className)} id={id} {...rest}>
<a href={`#${id}`} className='not-prose group'>
<a href={`#${id}`} className='group'>
{children}
<LinkIcon
aria-label='Link to section'
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/components/mdx/heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Heading = <T extends Types = 'h1'>(props: HeadingProps<T>) => {

return (
<Component className={cn('scroll-m-32', className)} id={id} {...rest}>
<a href={`#${id}`} className='not-prose group'>
<a href={`#${id}`} className='group'>
{children}
<LinkIcon
aria-label={t('mdx.link-to-section')}
Expand Down
14 changes: 14 additions & 0 deletions packages/ui/styles/typography.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,18 @@
margin-top: 16px;
margin-bottom: 16px;
}

:is(
:where(h1, h2, h3, h4, h5, h6, th):not(:where([class~='not-prose'], [class~='not-prose'] *))
) {
& a {
text-decoration: none;
font-weight: inherit;
color: inherit;
}

& code {
font-size: inherit;
}
}
}

0 comments on commit 4c0a9c4

Please sign in to comment.