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

Conversation

GuillaumeGomez
Copy link
Member

Fixes #51454.

r? @QuietMisdreavus

Before:

screen shot 2018-06-10 at 22 43 52

After:

screen shot 2018-06-10 at 23 33 16

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 10, 2018
}

.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.

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Jun 11, 2018

screen shot 2018-06-11 at 23 11 47

As I was afraid of, colors don't render well... So here come the change with dash!

@QuietMisdreavus
Copy link
Member

I'm not sure about having the table header's border be dashed like that. Having that border be lighter than the others makes it look like the header is sort of "spilling over" into the first row, which is probably not what we want. Can you switch them up, have the general borders be dashed but the header border be solid?

@GuillaumeGomez
Copy link
Member Author

Like this:

screen shot 2018-06-13 at 21 11 20

?

@QuietMisdreavus
Copy link
Member

Yeah, that looks nice! Is that the current state of the PR now?

@@ -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!


.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.

}
.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.

@killercup
Copy link
Member

I'm super confused, @GuillaumeGomez. There is a .content table:not(.table-display) { border-collapse: separate; }. Isn't the easiest fix to not apply that to content tables? With the light design it's also #dddddd on #ffffff and I'm with fine that contrast. #dddddd on #353535 (dark theme) is way to much, though!

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Jun 13, 2018

Yeah, that looks nice! Is that the current state of the PR now?

Yes.

@killercup: Hum... I didn't see that until you pointed me but it still doesn't bother me. If more people agree with you, I'm fine with making/accepting this change though.

@pietroalbini
Copy link
Member

Ping from triage! What's the status of this?

@GuillaumeGomez
Copy link
Member Author

Need to update it.

@GuillaumeGomez
Copy link
Member Author

Let's get this in then.

@bors: r=QuietMisdreavus

@bors
Copy link
Collaborator

bors commented Jun 22, 2018

📌 Commit de97464 has been approved by QuietMisdreavus

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 22, 2018
@bors
Copy link
Collaborator

bors commented Jun 22, 2018

⌛ Testing commit de97464 with merge b0e41f1...

bors added a commit that referenced this pull request Jun 22, 2018
Greatly improve tables display in docs

Fixes #51454.

r? @QuietMisdreavus

Before:

<img width="1440" alt="screen shot 2018-06-10 at 22 43 52" src="https://user-images.githubusercontent.com/3050060/41206138-cc61b2b4-6cff-11e8-9b6f-0b1e435d4b1b.png">

After:

<img width="1440" alt="screen shot 2018-06-10 at 23 33 16" src="https://user-images.githubusercontent.com/3050060/41207049-d455c03c-6d0e-11e8-968f-d4fccaeb4265.png">
@bors
Copy link
Collaborator

bors commented Jun 23, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: QuietMisdreavus
Pushing b0e41f1 to master...

@bors bors merged commit de97464 into rust-lang:master Jun 23, 2018
@GuillaumeGomez GuillaumeGomez deleted the table-display branch June 23, 2018 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants