Skip to content

Instantly share code, notes, and snippets.

@SaraVieira SaraVieira/cssx.js
Last active Feb 4, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.