Skip to content
This repository was archived by the owner on Sep 11, 2021. It is now read-only.

Commit 5d1a941

Browse files
authored
Merge pull request #18 from tailwindcss/next
Replace customization API
2 parents a0c04a6 + f1bc953 commit 5d1a941

File tree

10 files changed

+818
-219
lines changed

10 files changed

+818
-219
lines changed

docs/components/CodeBlock.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import Highlight from 'react-highlight'
2+
3+
export default ({ children, className }) => (
4+
<div className="rounded-lg p-6 bg-gray-800 overflow-x-auto text-gray-400 text-sm">
5+
<Highlight className={`language-${className.replace(/language-/, '')}`}>{children}</Highlight>
6+
</div>
7+
)

docs/components/Layout.jsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import '../static/css/tailwind.css'
22
import { MDXProvider } from '@mdx-js/react'
33
import Head from 'next/head'
4+
import CodeBlock from './CodeBlock'
5+
6+
const components = {
7+
code: CodeBlock,
8+
}
49

510
export default ({ meta, children }) => {
611
return (
@@ -9,9 +14,11 @@ export default ({ meta, children }) => {
914
<title>{meta.title}</title>
1015
</Head>
1116
<div className="max-w-3xl w-full mx-auto px-6 py-12">
12-
<div className="markdown">
13-
{ children }
14-
</div>
17+
<MDXProvider components={components}>
18+
<div className="markdown">
19+
{ children }
20+
</div>
21+
</MDXProvider>
1522
</div>
1623
</div>
1724
)

0 commit comments

Comments
 (0)