Skip to content

Greatly improve tables display in docs #51482

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

Merged
merged 1 commit into from
Jun 23, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/librustdoc/html/static/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -407,31 +407,27 @@ h4 > code, h3 > code, .invisible > code {

.content table:not(.table-display) {
border-spacing: 0 5px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this line is necessary any more with border-collapse: separate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh true!

border-collapse: separate;
}
.content td { vertical-align: top; }
.content td:first-child { padding-right: 20px; }
.content td p:first-child { margin-top: 0; }
.content td h1, .content td h2 { margin-left: 0; font-size: 1.1em; }
.content tr:first-child td { border-top: 0; }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this line do?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prevent to have a "double" border.


.docblock table {
border: 1px solid;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry to be difficult. It is just good to see tables improving 😄.

Is a solid border around the table not nice to have?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cells have borders, it'd be a duplicate.

margin: .5em 0;
border-collapse: collapse;
width: 100%;
}

.docblock table td {
padding: .5em;
border-top: 1px dashed;
border-bottom: 1px dashed;
border: 1px dashed;
}

.docblock table th {
padding: .5em;
text-align: left;
border-top: 1px solid;
border-bottom: 1px solid;
border: 1px solid;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice if there still was some way to differentiate between the header and normal rows. How about a 2px line at the bottom of the header? Or to just keep a dashed line between the normal rows?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nitpick-y, but I'd probably change the general border color to have less of a contrast with the background, and then keep the current color for the thead's border-bottom

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure playing with colors will render well... I'll try but I don't much expectations from it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for thickening the border below the header. I can go either way about changing the border color.

}

.fields + table {
Expand Down