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

fix(callouts): reduce inner bottom spacing #10944

Merged
merged 2 commits into from
Apr 19, 2024
Merged

fix(callouts): reduce inner bottom spacing #10944

merged 2 commits into from
Apr 19, 2024

Conversation

caugner
Copy link
Contributor

@caugner caugner commented Apr 17, 2024

Summary

Problem

Callouts had an unnecessary spacing after the last paragraph, because a specific CSS rule for p:last-child { margin-bottom: 2rem; } rule was overriding the p { margin: none } rule for the callout. In fact, that p:last-child rule is unnecessary, because we already define p { margin: 1rem 0 2rem; } more generally (which includes margin-bottom: 2rem;).

Solution

Remove the unnecessary CSS rule.

Note: At the same time, we can relax the margin for notecards, which was using the !important flag to workaround the issue.


Screenshots

Before After
image image

How did you test this change?

Ran yarn && yarn dev locally and looked at http://localhost:3000/en-US/docs/MDN/Writing_guidelines/Howto/Markdown_in_MDN#notes_warnings_and_callouts.

caugner added 2 commits April 18, 2024 00:19
We already add margins to all paragraphs, and this specific rule
caused trailing margin in callouts (previously also in noteblocks,
but this was overridden using !important).
This is no longer necessary, as the specific p:last-child rule is gone.
@caugner caugner requested a review from a team as a code owner April 17, 2024 22:28
@caugner caugner changed the title fix(layout): normalize callout spacing fix(callouts): reduce inner bottom spacing Apr 17, 2024
Copy link
Member

@LeoMcA LeoMcA left a comment

Choose a reason for hiding this comment

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

lgtm

@caugner caugner merged commit 5720ae0 into main Apr 19, 2024
14 checks passed
@caugner caugner deleted the fix-callout-spacing branch April 19, 2024 14:47
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