python / python/python-docs-theme

Improving readability of documentation tables

Open
#311 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
90
Forks
78
Avg merge
2d 19h
Merged PRs (30d)
4

Description

Documentation

I was reading through the documentation and I thought of a way you could make it read better.
You could do the thing thats done with tables where you alternate the background color to make the elements easier to distinguish at a glance.

I made a quick example using inspect element to color every other method in the documentation.
Image

vs what it looks like currently.
Image

My quick test was done by adding

.py.method:nth-child(odd) {
  background-color: #2d2d2d;
}

And replacing the margin on the dl elements with padding so the background color would fill it.

I originally used dl:nth-child(odd) but .py.method:nth-child(odd) worked better, but it would probably be better to add a new class to the elements you want highlight instead, because dl:nth-child(odd) highlights too much and .py.method:nth-child(odd) doesnt highlight all of the elements you would probably want highlighted.

*:is(.py.method, .describe):nth-child(odd of *:is(.py.method, .describe)) {
   background-color: #2b2b2b;
}

Should work but adding a new class is probably easier to maintain and you could reuse it in more places.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the documentation theme CSS and markup using the .py.method and .describe selectors mentioned in the issue. Compare the current table styling with the supplied examples, then verify that alternating backgrounds and adjusted spacing improve readability without highlighting unintended elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
design, documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.