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

Give rendered-data sections a background and some padding #1195

Merged
merged 9 commits into from
Aug 4, 2022

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Aug 2, 2022

Not sure if everyone will like this, but it gives definition sections for APIs, events, etc a background and a small indent, which I find very helpful to guide the eye.

Suggest reviewing commit-by-commit as I had to move some stuff out of the way first.

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

Now that only object and request tables get the stripes, there is no
need to reset it for basic-info
instead, only do the stripes for rows in the tbody, not the thead.
@richvdh richvdh requested a review from a team as a code owner August 2, 2022 22:51
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

overall I think this is a good improvement for readability. The two interactions in the review are easily fixed too, I think.

@@ -270,7 +270,9 @@ footer {

/* Styles for sections that are rendered from data, such as HTTP APIs and event schemas */
.rendered-data {
margin: 1rem 0 3rem 0;
background-color: $secondary-lightest-background;
Copy link
Member

Choose a reason for hiding this comment

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

This seems to have a jarring reaction with the arrow on the details section:

image

(accented for visibility)

Copy link
Member

Choose a reason for hiding this comment

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

This can be fixed with list-style-position: inside; on the summary (rule just below here)

}
&.object-table, &.response-table {
caption, tbody tr {
background-color: $table-row-default;
Copy link
Member

Choose a reason for hiding this comment

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

table rows now blend in with the background:

image

Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest making $table-row-alternate be white instead, as it makes #f4fafc pop more. Alternatively, don't bother with striping and play around with table layout some more, though this is more involved and requires a bunch of awkward CSS to get right (we'd want to change various alignments and justifications, possibly copy changes as well).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I'd noticed that, but decided I would rather live with it than have the alternate table rows be lighter than the background, which looks really odd to me.

How about we give the table a light border? Done in b62be51 - I think it looks quite good, though ymmv

Copy link
Member

Choose a reason for hiding this comment

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

image

it feels a bit like the table is now bleeding into the background instead of being the background, but also a border is a marked enough improvement for now. Typically we avoid table borders as it can feel overly restricting, though here it seems to fit well enough to break up the pages and pages of text.

Feels like a thing someone else can PR if they don't like it, now.

@richvdh richvdh requested a review from turt2live August 3, 2022 08:32
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

lgtm either way - thanks!

assets/scss/custom.scss Outdated Show resolved Hide resolved
@richvdh richvdh enabled auto-merge (squash) August 4, 2022 09:43
@richvdh richvdh merged commit ef384f1 into main Aug 4, 2022
@richvdh richvdh deleted the rav/rendered_data_colours branch August 4, 2022 09:46
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