Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use style props in mdx (gatsby) #151

Open
ftes opened this issue Mar 11, 2021 · 2 comments
Open

Unable to use style props in mdx (gatsby) #151

ftes opened this issue Mar 11, 2021 · 2 comments

Comments

@ftes
Copy link

ftes commented Mar 11, 2021

Input

// gatsby-config.js
...
plugins: [
  `gatsby-plugin-mdx`,
  `gatsby-plugin-reflexjs`,
]
<!-- src/pages/index.mdx -->
<div bg="red">Hello world!</div>

Output

<div class="css-0">Hello world!</div>

The bg style prop is ignored. No CSS class with background-color: red is added to the rendered div.

Expected output

The style prop should be applied via a generated CSS class.

Remarks

Can I override the jsx pragma used by gatsby-plugin-mdx with reflexs.jsx?

@shadcn
Copy link
Contributor

shadcn commented Apr 1, 2021

The style props are not enabled by default for MDX.

You can pass Box (import { Box } from "reflexjs"} to MDX component and use this for styling.

Can I override the jsx pragma used by gatsby-plugin-mdx with reflexs.jsx?

This should work too.

@ftes
Copy link
Author

ftes commented Apr 9, 2021

Can I override the jsx pragma used by gatsby-plugin-mdx with reflexs.jsx?

This should work too.

Have you done this before by any chance?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants