Skip to content

Conversation

@flying-sheep
Copy link
Contributor

Fixes #618

@flying-sheep flying-sheep marked this pull request as draft September 12, 2025 08:24
@flying-sheep flying-sheep reopened this Sep 12, 2025
@flying-sheep flying-sheep changed the title Fix broken table CSS Improve theme integration Sep 12, 2025
@flying-sheep flying-sheep marked this pull request as ready for review September 22, 2025 08:29
@tasansal
Copy link

Hi, I tried this with our docs that use ipywidgets progress bars via tqdm. The text around the progress bar still doesn't honor the color preference from the furo theme when rendered with myst-nb. I just modified the CSS with the one from this PR. Am I missing anything, or is there an issue?

@flying-sheep
Copy link
Contributor Author

flying-sheep commented Nov 20, 2025

This PR is just for preventing MyST-nb from messing up a theme’s table CSS. I re-titled #618 to be more clear.

For ipywidgets to work properly, the theme needs to integrate with them by setting --jp-widgets-color and so on or by hacking it with a light background.

E.g. sphinx-book-theme currently does

html[data-theme="dark"] .bd-content div.cell_output .text_html:not(:has(table.dataframe)),
html[data-theme="dark"] .bd-content div.cell_output .widget-subarea,
html[data-theme="dark"] .bd-content div.cell_output img {
  background-color: var(--some-light-color);
}

It would have to remove the second selector (.widget-subarea) and define all the --jp-widgets-* variables to really support ipywidgets.

But this PR is a very necessary pre-condition for anything to be able to work. MyST just injecting this CSS is really bad and needs to be fixed!

@flying-sheep
Copy link
Contributor Author

flying-sheep commented Nov 20, 2025

@bsipocz is there any recorded reason why that CSS exists?

If yes, we need to fix this in another way.

If not, we should really remove this without replacement, just setting styles for div.cell_output table is very bad manners for an extension.

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

Successfully merging this pull request may close these issues.

MyST-nb injects CSS for tables that ignores dark mode

2 participants