Describe the bug
The styled MDX is unaligned, regardless of how you specify it.
To Reproduce
Steps to reproduce the behavior:
| Left | Centre | Right |
|:-----|:------:|------:|
| 1 | 2 | 3 |
Expected behavior
The th, and td elements should have the align attribute correctly set.
In addition it seems the class attribute is set strangely class="css-0".
Additional context
Add any other context about the problem here.
Initially reported in the MDX here: https://github.com/mdx-js/mdx/issues/930
Thanks! This sounds like a bug. If anyone wants to open a PR with a failing test case, please feel free to do so
Hello,
I saw the same issue. Personally I solve the problem by customize MDX tags <th /> and <td /> like this :
// /src/gatsby-plugin-theme-ui/components.js
/** @jsx jsx */
import { jsx, Styled } from "theme-ui"
import Prism from "@theme-ui/prism"
export default {
th: ({ align, ...props }) => (
<Styled.th style={align && { textAlign: align }} {...props} />
),
td: ({ align, ...props }) => (
<Styled.td style={align && { textAlign: align }} {...props} />
),
}
Fixed with #1347
Most helpful comment
Hello,
I saw the same issue. Personally I solve the problem by customize MDX tags
<th />and<td />like this :