Skip to content

Adjust margins in rendered endpoints #2081

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 4 commits into from
Apr 15, 2025

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 <[email protected]>
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 <[email protected]>
@zecakeh zecakeh requested a review from a team as a code owner February 22, 2025 11:31
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.

LGTM

@richvdh richvdh merged commit 81273df into matrix-org:main Apr 15, 2025
12 checks passed
@zecakeh zecakeh deleted the reduce-table-margin branch April 15, 2025 17:43
Johennes pushed a commit to Johennes/matrix-spec that referenced this pull request May 30, 2025
* Use consistent spacing between tables and code blocks

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 <[email protected]>

* Adjust spacing around h2 and h3 titles in `.rendered-data`

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 <[email protected]>

* Add changelog

Signed-off-by: Kévin Commaille <[email protected]>

---------

Signed-off-by: Kévin Commaille <[email protected]>
Co-authored-by: Richard van der Hoff <[email protected]>
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.

2 participants