Last active
February 4, 2019 21:20
-
-
Save SaraVieira/0ab9e0746c5408f62cbf1db1d95113f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { MDXProvider } from '@mdx-js/tag' | |
import { Global, css } from '@emotion/core' | |
const code = ({ className, children }) => { | |
if (className === 'language-cssx') { | |
return ( | |
<Global | |
styles={css` | |
${children} | |
`} | |
/> | |
) | |
} | |
return <code>{children}</code> | |
} | |
export default ({ children, components }) => ( | |
<MDXProvider components={{ ...components, code }}>{children}</MDXProvider> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment