Skip to content

Improving readability of documentation tables #311

@Vwert

Description

@Vwert

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions