Skip to content
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

Reinstate a smaller margin between struct tables #1178

Closed
wants to merge 2 commits into from
Closed

Reinstate a smaller margin between struct tables #1178

wants to merge 2 commits into from

Conversation

DMRobertson
Copy link
Contributor

@DMRobertson DMRobertson commented Jul 21, 2022

Without a margin, things look poor if the last row is blue: it then
merges into the caption at the top of the next table.

I've also added a small border because I think it helps to break things
up a little.

Before: Before
After: after

Xref: ea42cd3#r79080321 and #1166 (comment)

Preview: https://pr1178--matrix-spec-previews.netlify.app

David Robertson added 2 commits July 21, 2022 17:46
Without a margin, things look poor if the last row is blue: it then
merges into the caption at the top of the next table.

I've also added a small border because I think it helps to break things
up a little.
@DMRobertson DMRobertson marked this pull request as ready for review July 21, 2022 17:22
@DMRobertson DMRobertson requested a review from a team as a code owner July 21, 2022 17:23
Copy link
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

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

looks like a reasonable compromise, I guess.

It does mean that there is a bit of a gap before, for example, the AuthData table at https://pr1178--matrix-spec-previews.netlify.app/client-server-api/#backup-algorithm-mmegolm_backupv1curve25519-aes-sha2.

That lead me into a rabbithole of wondering why other definition tables don't have this problem, and that in turn led me to this bit of CSS. which overrides the margin for a table when it follows an h2 or h3:

h2 + table, h3 + table, h3 + div.highlight {
margin-top: 0;
}

I wonder if it would be better to flip this around and instead specify a margin only when a table is followed by another table? wdyt?

@richvdh
Copy link
Member

richvdh commented Aug 2, 2022

I wonder if it would be better to flip this around and instead specify a margin only when a table is followed by another table? wdyt?

I've done this over at #1192, since I was poking in the area.

I've also added a small border because I think it helps to break things up a little.

I don't disagree, but it also adds a second line after the 'Requires authentication' line, which looks a bit odd. I'm working on some other changes which I hope will make this easier.

@DMRobertson
Copy link
Contributor Author

Is this now superseded/made defunct by #1192?

It does mean that there is a bit of a gap before, for example, the AuthData table at pr1178--matrix-spec-previews.netlify.app/client-server-api/#backup-algorithm-mmegolm_backupv1curve25519-aes-sha2.

Arg, yes. Some more classes on the tables would help here.

That lead me into a rabbithole of wondering why other definition tables don't have this problem, and that in turn led me to this bit of CSS. which overrides the margin for a table when it follows an h2 or h3:

h2 + table, h3 + table, h3 + div.highlight {
margin-top: 0;
}

I wonder if it would be better to flip this around and instead specify a margin only when a table is followed by another table? wdyt?

I'm kind of surprised we need those kind of selectors, given that margin collapse is A Thing. But I'm naive and my CSS knowledge is largely stuck in the previous decade. No strong opinions though.

@richvdh
Copy link
Member

richvdh commented Aug 9, 2022

Is this now superseded/made defunct by #1192?

I think so? But up to you to figure out if there's anything here that you still want.

I'm kind of surprised we need those kind of selectors, given that margin collapse is A Thing. But I'm naive and my CSS knowledge is largely stuck in the previous decade.

You and me both. There may well be better ways to do this.

@DMRobertson
Copy link
Contributor Author

But up to you to figure out if there's anything here that you still want.

Looking at your changes as rendered on https://spec.matrix.org/unstable/client-server-api/ I'm happy---the original complaint is fixed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants