diff --git a/.changeset/hungry-files-drive.md b/.changeset/hungry-files-drive.md new file mode 100644 index 0000000000..866252c3e8 --- /dev/null +++ b/.changeset/hungry-files-drive.md @@ -0,0 +1,7 @@ +--- +'nextra': patch +'nextra-theme-blog': patch +'nextra-theme-docs': patch +--- + +add `overflow-x-scroll` for tables diff --git a/.changeset/wise-fireants-hunt.md b/.changeset/wise-fireants-hunt.md new file mode 100644 index 0000000000..348026eb92 --- /dev/null +++ b/.changeset/wise-fireants-hunt.md @@ -0,0 +1,5 @@ +--- +'nextra-theme-docs': patch +--- + +reuse nextra's scrollbar-y styles for scrollbar-x, adjust sidebar's scrollbar-y diff --git a/examples/blog/pages/posts/table.mdx b/examples/blog/pages/posts/table.mdx index 68f0977091..4ac777209b 100644 --- a/examples/blog/pages/posts/table.mdx +++ b/examples/blog/pages/posts/table.mdx @@ -8,8 +8,8 @@ author: Dimitri POSTOLOV ## Test table -| Left | Center | Right | -| ---- | :----: | ----: | -| ss2 | 333 | 3232 | -| | 222 | 3232 | -| | 23 | | +| Left | Center | Right | Right | Right | Right | Right | Right | Right | Right | +| ---- | :----: | ----: | ----: | ----: | ----: | ----: | ----: | ----: | ----: | +| ss2 | 333 | 3232 | 3232 | 3232 | 3232 | 3232 | 3232 | 3232 | 3232 | +| | 222 | 3232 | 3232 | 3232 | 3232 | 3232 | 3232 | 3232 | 3232 | +| | 23 | | | | | | | | | diff --git a/packages/nextra-theme-blog/src/mdx-theme.tsx b/packages/nextra-theme-blog/src/mdx-theme.tsx index 9fc97fc5c1..cff01524c0 100644 --- a/packages/nextra-theme-blog/src/mdx-theme.tsx +++ b/packages/nextra-theme-blog/src/mdx-theme.tsx @@ -12,7 +12,7 @@ import React, { import { MDXProvider } from '@mdx-js/react' import Link from 'next/link' import { createPortal } from 'react-dom' -import { Code, Pre, Td, Th, Tr } from 'nextra/components' +import { Code, Pre, Table, Td, Th, Tr } from 'nextra/components' import { useBlogContext } from './blog-context' export const HeadingContext = createContext< @@ -68,19 +68,17 @@ const components = { h5: createHeaderLink('h5'), h6: createHeaderLink('h6'), a: A, - pre({ children, ...props }: ComponentProps<'pre'>) { - return ( -
{children}-
{children}+