rsnext/examples/with-mdx-remote/components/Layout.js
Daniel Eden a2d83952c1
Add with-mdx-remote example (#16613)
This change adds a new example, `with-mdx-remote`, which leverages [`next-mdx-remote`](https://github.com/hashicorp/next-mdx-remote) to use MDX files as content for a dynamic route.

In addition to the basic functionality, the example adds a note about somewhat advanced usage that allows the use of conditionally-loaded custom MDX components.

cc @jescalan
2020-08-29 01:22:35 +00:00

49 lines
938 B
JavaScript

export default function Layout({ children }) {
return (
<>
<div className="wrapper">{children}</div>
<style jsx>{`
.wrapper {
max-width: 36rem;
margin: 0 auto;
padding: 1.5rem;
}
`}</style>
<style jsx global>{`
* {
margin: 0;
padding: 0;
}
:root {
--site-color: royalblue;
--divider-color: rgba(0, 0, 0, 0.4);
}
html {
font: 100%/1.5 system-ui;
}
a {
color: inherit;
text-decoration-color: var(--divider-color);
text-decoration-thickness: 2px;
}
a:hover {
color: var(--site-color);
text-decoration-color: currentcolor;
}
h1,
p {
margin-bottom: 1.5rem;
}
code {
font-family: 'Menlo';
}
`}</style>
</>
)
}