pydata / pydata-sphinx-theme

A clean, three-column Sphinx theme with Bootstrap for the PyData community
https://pydata-sphinx-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
557 stars 299 forks source link

genindex.html, Hlists (and possibly more table-based items) become funky after 0.15.3 upgrade #1855

Closed abjarna closed 3 weeks ago

abjarna commented 4 weeks ago

This page uses version 0.15.3: https://pydata-sphinx-theme.readthedocs.io/en/v0.15.3/genindex.html

This page uses version 0.15.2: https://pydata-sphinx-theme.readthedocs.io/en/v0.15.2/genindex.html

The style in genindex.html is as expected in version 0.15.2, but in version 0.15.3 the indextable has dark grey color and purple color when hovering.

See attached screenshots:

Screenshot 2024-06-04 at 12 10 06 Screenshot 2024-06-04 at 12 10 22

trallard commented 4 weeks ago

Thanks for raising this @abjarna. This was introduced in https://github.com/pydata/pydata-sphinx-theme/pull/1757, when the table styling was improved. So while not a bug it is an unexpected result from this PR.

Adding a screenshot of the dark version:

Index_—_PyData_Theme_0_15_3_documentation

I do not think the grey background is an issue since this is a table (albeit a special case of a table), but perhaps the hover colour (purple) could be removed as the focus item for interaction will be the links inside a given cell.

Thoughts @gabalafou @smeragoel

abjarna commented 4 weeks ago

Ok, thank you! I wasn't aware of #1757, but in my opinion this makes the genindex.html look really bad. In addition, the genindex.html now looks totally different from previous versions, which was probably not the intention of #1757.

Also, the grey background either overlaps between left and right column, or creates a thin table border. This results in a thin line in front of the right column in the genindex.html. See attachment. Screenshot 2024-06-04 at 13 51 45

I haven't yet tried to fix this in my custom.css, but it's probably an easy fix.

However, I recommend a more permanent fix to prevent the above changes to genindex.html.

abjarna commented 4 weeks ago

I also found similar issues when using Hlists.

This page uses version 0.15.3: https://pydata-sphinx-theme.readthedocs.io/en/v0.15.3/examples/kitchen-sink/lists.html

This page uses version 0.15.2: https://pydata-sphinx-theme.readthedocs.io/en/v0.15.2/examples/kitchen-sink/lists.html

Screenshot 2024-06-04 at 16 00 25 Screenshot 2024-06-04 at 15 59 44

Are you @trallard aware of any ways to disable these grey colors and purple color when hovering, besides using custom CSS?

trallard commented 4 weeks ago

Aha! Another item we did not realise was a table.

Edit the correct PR that introduced this is https://github.com/pydata/pydata-sphinx-theme/pull/1757

Are you @trallard aware of any ways to disable these grey colors and purple color when hovering, besides using custom CSS?

Unfortunately, right now, you'd need to add custom styles specifically to override these lines https://github.com/pydata/pydata-sphinx-theme/blob/97e60ba3e90a2b3b03c8b38413d68c53fdb4f3f1/src/pydata_sphinx_theme/assets/styles/abstracts/_mixins.scss#L44-L55

tough this would affect all tables on your site. However, it seems we'd need to make some further improvements to these at the theme level anyway.

abjarna commented 4 weeks ago

Thank you for the quick response @trallard !

And also thanks for all your hard work on the PyData theme. Best Sphinx theme out there by far! 🙏

trallard commented 4 weeks ago

Thank you for reporting these style mishaps 🙏🏽

I am tagging @gabalafou and @smeragoel here as they were the main folks working on tables restyling: folks let's chat about this and scope any further improvements needed

gabalafou commented 4 weeks ago

Quick fix: #1864.

Ideally, we would change the output for both hlists and the index page to not use tables. These are using tables only for layout, not semantically to actually communicate tabular data.

drammock commented 4 weeks ago

Ideally, we would change the output for both hlists and the index page to not use tables.

Are you suggesting we do that in the theme? Or as an upstream change to sphinx?

gabalafou commented 4 weeks ago

Upstream, if we can

trallard commented 4 weeks ago

So that would more than likely be at the Sphinx level

abjarna commented 3 weeks ago

Hi again, I see this has been fixed in the latest version (v0.15.4dev0).

Both the latest version (v0.15.4dev0) and version 0.15.3, show table-hover behaviour in "kitchen-sink/tables.html": https://pydata-sphinx-theme.readthedocs.io/en/v0.15.3/examples/kitchen-sink/tables.html https://pydata-sphinx-theme.readthedocs.io/en/latest/examples/kitchen-sink/tables.html

And only version 0.15.3 show table-hover behaviour in "genindex.html", but NOT the latest version (v0.15.4dev0): https://pydata-sphinx-theme.readthedocs.io/en/v0.15.3/genindex.html https://pydata-sphinx-theme.readthedocs.io/en/latest/genindex.html

And finally, only version 0.15.3 show table-hover behaviour in "kitchen-sink/lists.html", but NOT the latest version (v0.15.4dev0): https://pydata-sphinx-theme.readthedocs.io/en/v0.15.3/examples/kitchen-sink/lists.html https://pydata-sphinx-theme.readthedocs.io/en/latest/examples/kitchen-sink/lists.html

I've been trying to replicate the quick fix #1864 from @gabalafou in my local environment, by removing the line "@include table-colors;" from _tables.scss in my virtual environment folder, and then rebuilding with "make clean && make html", but still no luck 😢

Am I missing something obvious, or are there additional steps I need to make to replicate the behaviour in latest version (v0.15.4dev0)?

abjarna commented 3 weeks ago

And a quick note to other users who might also be struggling with the same issue, this addition to custom.css temporarily undoes the table-hover behaviour in "genindex.html":

table.indextable.genindextable {
    border: none !important;
}

table.indextable.genindextable td {
    border-left: none !important;
}

table.indextable.genindextable tr {
    background-color: inherit !important;
}
drammock commented 3 weeks ago

I've been trying to replicate the quick fix #1864 from @gabalafou in my local environment, by removing the line "@include table-colors;" from _tables.scss in my virtual environment folder, and then rebuilding with "make clean && make html", but still no luck 😢

the .scss files need to get compiled into .css files for the changes to propogate to the built site. make clean && make html won't do that; it's handled (along with minifying our javascript assets) by webpack.

If you're testing on the theme's own website, you could do tox -e docs-dev for example, which will run webpack first. To do it for your own site, you'd need to figure out what CSS rules the @include actually includes, and then remove them manually from the relevant spot(s) in the compiled .css file

abjarna commented 3 weeks ago

Thank you @drammock! In that case, I’ll stick to the custom.css in my previous comment for now.