MyST-Parser
MyST-Parser copied to clipboard
Table cell alignment classes are incompatible with bootstrap 5
The "left" and "right" cell alignment options are handled by assigning text-left
or text-right
classes to the cell. I think this approach was relying on the styling of these classes in bootstrap, but bootstrap 5 removed these classes and replaced them with text-start
and text-end
. I'm guessing this was done to support right-to-left languages. The problem is currently visible in the MyST parser documentation.
.
For a Jupyter book, I've worked around the issue by adding
sphinx:
config:
html_static_path: ["_static"]
html_css_files: ["custom.css"]
to _config.yml
, and then adding
.text-left{
text-align: left !important;
}
.text-right{
text-align: right !important;
}
to _static/custom.css
.
Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:
Heya, myst-parser does not provide any CSS stylings, this is up to the html theme used.
This is in an issue that needs to be raised with sphinx-book-theme.
This is discussed in the "Aligning cells in Sphinx HTML themes" drop-down and, for example, is specifically accounted for in https://github.com/pradyunsg/furo/blob/80afa27a9a7bd0ac9259636239e349656c4726ab/src/furo/assets/styles/content/_tables.sass#L36
Heya, myst-parser does not provide any CSS stylings, this is up to the html theme used.
This is in an issue that needs to be raised with sphinx-book-theme.
Thanks for letting me know. I'll reraise the issue or submit a pull request there.
The MyST Parser is applying the class names text-left
and text-right
, and I'm wondering if those names are still the best choice. Bootstrap 3 and 4 included them, but 5 does not.
Heya, myst-parser does not provide any CSS stylings, this is up to the html theme used.
This is in an issue that needs to be raised with sphinx-book-theme.
Same trouble with PyData Shinx Theme.