Fix colors in dark mode in VS Code and rendered HTML notebooks#122
Conversation
|
Thank you, this is wonderful! I’m a big proponent for dark mode, but I only have it active in the evening haha. I’d go this route:
I think this might be good colors: --si-table-fg1:
var(--jp-ui-font-color1,
var(--vscode-editor-foreground,
light-dark(rgba(0, 0, 0, 0.87), rgba(255, 255, 255, 0.87))));
--si-table-bg0:
var(--jp-layout-color0,
var(--vscode-editor-background,
light-dark(white, #111)));
--si-table-bg3:
var(--jp-rendermime-table-row-background,
var(--vscode-tree-tableOddRowsBackground,
light-dark(#bdbdbd, #616161))); |
|
OK, on further investigation, there are a lot of issues:
To fix this, either
or we just add a white background to all output cells containing ipywidgets (like the pydata sphinx theme does) |
|
Hi, yes, there are multiple problems that lead to the current PR:
In summary, we can likely never provide a perfect solution so I would prioritize readability as long as choices we make can be superseded by user choices, if desired. The current PR should fulfill these criteria. |
|
I generally agree!
I think this is the only part where I disagree with you. No extension should just add styles for tables in the cell output. That’s the jobs for themes! MyST-NB needs to get rid of this.
You’re right! Where did you test it? Jupyterlab, VS Code, and which Sphinx themes? |
|
Thanks! |
|
Thank you! This was a really annoying situation. |
Small pet peeve of mine, but the table colors are broken (dark on dark and light on light) in dark mode, especially when "ipywidgets" is not installed. Affects both HTML rendering and VS Code (not tested in other editors). This PR applies CSS variables to rows as well (previously used for the header) with fallback options that ensure readability.