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

Adjust margins in rendered endpoints #2081

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zecakeh
Copy link
Contributor

@zecakeh zecakeh commented Feb 22, 2025

It felt that there was a lot of wasted space in those because of the spacing between tables. There are 2 commits here:

  1. Use consistent spacing between tables and code blocks:

    Tables used 4 rem between 2 tables which is more than the margin above a h2 title, which seems excessive. We change it to 2 rem which matches the default margin of code blocks and info boxes. To make sure that this stays consistent we apply it to both tables and code blocks.

    I feel like we could probably reduce it further to 1.5 rem. That would require to change the default margins for code blocks and info boxes for consistency.

    We also remove the margin if it's the last item of a .rendered-data block because this is just wasted space.

    Before After
    image image
  2. Adjust spacing around h2 and h3 titles:

    Given that h2 titles are always preceded by an horizontal rule, we don't need a lot of space to separate them from the previous section.

    We also reduce the spacing when a h2 title is followed directly by a h3 title.

    Finally, we add a little spacing below both so that tables are less close to the title.

    Before After
    image image

Pull Request Checklist

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

Tables used `4 rem` which is more than the margin above a h2 title, which seems excessive. We change it to `2 rem` which matches the margin of code blocks and info boxes.

We also remove the margin on the last item of a `.rendered-data` block because this is just wasted space.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
Given that h2 titles are always preceded by an horizontal rule, we don't need a lot of space to separate them from the previous section.

We also reduce the spacing when a h2 title is followed directly by a h3 title.

Finally, we add a little spacing below both so that tables are less close to the title.

Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
@zecakeh zecakeh requested a review from a team as a code owner February 22, 2025 11:31
Signed-off-by: Kévin Commaille <zecakeh@tedomum.fr>
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.

1 participant