reflexjs icon indicating copy to clipboard operation
reflexjs copied to clipboard

Unable to use style props in mdx (gatsby)

Open ftes opened this issue 4 years ago • 2 comments

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?

ftes avatar Mar 11 '21 11:03 ftes

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.

shadcn avatar Apr 01 '21 12:04 shadcn

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?

ftes avatar Apr 09 '21 19:04 ftes