Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inproper styling of dataframes for myst-nb + pydata theme when contained in ipywidget (2) #1740

Open
ClementPinard opened this issue Mar 14, 2024 · 6 comments
Labels
tag: design Items related to design tasks or improvements

Comments

@ClementPinard
Copy link

ClementPinard commented Mar 14, 2024

Hi, this is a small continuation from #1063

Last time, there was a problem with the table collapsing, this is solved now (thank you !)

Now I am in search for a solution to style the dataframe in a widget the same way as directly outputted in the cell

image

As you can see, the dataframe in the tab widget does not have the same color (and the widget is not dark themed as well), and more problematic, the horizontal scroll bar is gone.

Note that contrary to the last problem, this one is present in both nbconvert and nb-sphinx

Also, note that the light mode has the right dataframe colors, but still does not have the scroll bar. As such, I am not sure the scroll bar disappearing is related to pydata theme

As for the last issue, you can recreate the problem in this (updated) repo : https://github.com/ClementPinard/pydata-nbsphinx-pandas-bug-example

Versions:

Sphinx = 5.3.0
jupyter = 1.0.0
pydata-sphinx-theme = 0.15.2
myst-nb = 1.0.0

In short, it would be nice to

  • style the widgets in dark theme
  • style the dataframe in widgets in dark theme
  • add a "overflow: auto" attribute somewhere instead of hidden
@trallard
Copy link
Collaborator

Thanks for sharing this feedback @ClementPinard.
We will look into this as we are also planning to make some overall improvements to tables styling and scrolling soon.

@trallard trallard added the tag: design Items related to design tasks or improvements label Mar 22, 2024
@trallard
Copy link
Collaborator

trallard commented Apr 5, 2024

Pinging @gabalafou who is looking into tables right now

@gabalafou
Copy link
Collaborator

gabalafou commented Apr 8, 2024

Ohhhh, this a deep rabbit hole.

From what I can tell, there are two separate issues here:

  1. Dark theme styles for ipywidget
  2. Horizontal scroll bar

I opened a PR (#1760) for the second issue based on what JupyterLab does. For the history of this change, see:

For the first issue, it seems to me like we need to make a decision about how we want to make ipywidgets look good on sites using PyData Sphinx theme with nbsphinx or myst-nb. We could write CSS in this repo or we could help write CSS in the ipywidgets repo. Here are a few relevant GitHub issues:

@gabalafou
Copy link
Collaborator

gabalafou commented Apr 8, 2024

JupyterLab PR #2737 may shine some light onto how JupyterLab styles ipywidgets for both light and dark mode

@trallard
Copy link
Collaborator

trallard commented Apr 8, 2024

Adjacent #745

Carreau pushed a commit that referenced this issue May 23, 2024
This addresses one of the issues in #1740: missing horizontal scrollbar.

- Add CSS rule to allow scrolling
- Add ipywidgets example to the examples/pydata page
gabalafou added a commit to gabalafou/pydata-sphinx-theme that referenced this issue May 24, 2024
This addresses one of the issues in pydata#1740: missing horizontal scrollbar.

- Add CSS rule to allow scrolling
- Add ipywidgets example to the examples/pydata page
Carreau pushed a commit that referenced this issue May 27, 2024
#1787)

One of many fixes for the failing accessibility tests (see #1428).

The accessibility tests were still reporting some violations of: 
 - Scrollable region must have keyboard access (https://dequeuniversity.com/rules/axe/4.8/scrollable-region-focusable) even after merging #1636 and #1777. 

These were due to Jupyter notebook outputs that have scrollable content. This PR extends the functionality of PRs #1636 and #1777 to such outputs.

- Adds a test for tabindex = 0 on notebook outputs after page load

This also addresses one of the issues in #1740: missing horizontal scrollbar by:

- Adding CSS rule to allow scrolling
- Add ipywidgets example to the examples/pydata page
@Carreau
Copy link
Collaborator

Carreau commented May 27, 2024

This might have been fixed by #1787

ivanov pushed a commit to ivanov/pydata-sphinx-theme that referenced this issue Jun 5, 2024
This addresses one of the issues in pydata#1740: missing horizontal scrollbar.

- Add CSS rule to allow scrolling
- Add ipywidgets example to the examples/pydata page
ivanov pushed a commit to ivanov/pydata-sphinx-theme that referenced this issue Jun 5, 2024
pydata#1787)

One of many fixes for the failing accessibility tests (see pydata#1428).

The accessibility tests were still reporting some violations of: 
 - Scrollable region must have keyboard access (https://dequeuniversity.com/rules/axe/4.8/scrollable-region-focusable) even after merging pydata#1636 and pydata#1777. 

These were due to Jupyter notebook outputs that have scrollable content. This PR extends the functionality of PRs pydata#1636 and pydata#1777 to such outputs.

- Adds a test for tabindex = 0 on notebook outputs after page load

This also addresses one of the issues in pydata#1740: missing horizontal scrollbar by:

- Adding CSS rule to allow scrolling
- Add ipywidgets example to the examples/pydata page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag: design Items related to design tasks or improvements
Projects
None yet
Development

No branches or pull requests

4 participants