Skip to content

Commit

Permalink
[v3] fix theme-blog heading styles in post layout (#3117)
Browse files Browse the repository at this point in the history
* [v3] fix theme-blog heading styles in post layout

* remove more `_not-prose`

* small fix

---------

Co-authored-by: Dimitri POSTOLOV <[email protected]>
  • Loading branch information
87xie and dimaMachina authored Aug 21, 2024
1 parent 799174f commit 49a9627
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/seven-melons-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'nextra-theme-blog': patch
---

fix theme-blog heading styles in post layout
10 changes: 5 additions & 5 deletions packages/nextra-theme-blog/src/mdx-theme.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function HeadingLink({
<Tag
className={
// can be added by footnotes
className === 'sr-only' ? '_sr-only' : `_not-prose subheading-${Tag}`
className === 'sr-only' ? '_sr-only' : `subheading-${Tag}`
}
{...props}
>
Expand All @@ -47,7 +47,7 @@ function HeadingLink({
<a
href={`#${id}`}
id={id}
className="subheading-anchor"
className="_not-prose subheading-anchor"
aria-label="Permalink for this section"
/>
)}
Expand Down Expand Up @@ -81,9 +81,9 @@ export const components: MDXComponents = {
h6: props => <HeadingLink tag="h6" {...props} />,
a: A,
pre: ({ children, ...props }) => (
<div className="_not-prose">
<Pre {...props}>{children}</Pre>
</div>
<Pre className="_not-prose" {...props}>
{children}
</Pre>
),
tr: Tr,
th: Th,
Expand Down
6 changes: 3 additions & 3 deletions packages/nextra-theme-blog/src/meta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ export default function Meta(): ReactElement {
'_mb-8 _flex _gap-3 ' + (readingTime ? '_items-start' : '_items-center')
}
>
<div className="_grow dark:_text-gray-400 _text-gray-600">
<div className="_not-prose _flex _flex-wrap _items-center _gap-1">
<div className="_not-prose _grow dark:_text-gray-400 _text-gray-600">
<div className="_flex _flex-wrap _items-center _gap-1">
{author}
{author && date && ','}
{dateObj && (
Expand All @@ -58,7 +58,7 @@ export default function Meta(): ReactElement {
{readingTime || tagsEl}
</div>
{readingTime && (
<div className="_not-prose _mt-1 _flex _flex-wrap _items-center _gap-1">
<div className="_mt-1 _flex _flex-wrap _items-center _gap-1">
{tagsEl}
</div>
)}
Expand Down

0 comments on commit 49a9627

Please sign in to comment.