Merge "Make paragraph spacing 0.5em top and 1em bottom by default, handle adjacent inline elements manually"

This commit is contained in:
jenkins-bot 2024-06-05 19:42:38 +00:00 committed by Gerrit Code Review
commit e1a73d9956

View file

@ -145,12 +145,18 @@ pre,
}
p {
// T351754 Use padding to avoid margin collapsing between adjacent <p> elements
// creating an effective margin-bottom: 1em
padding-bottom: 0.5em;
// Top margin is needed because many elements rely on adjacent <p> elements
// for extra spacing, i.e. lists and headings
margin: 0.5em 0 0 0;
margin: 0.5em 0 1em 0;
}
p + ul,
p + ol,
p + table,
p + dl,
p + blockquote {
// Inline elements should have 0.5em total top spacing
// Use negative margin to account for 1em bottom margin on paragraphs
// This will not work for floated elements
margin-top: -0.5em;
}
blockquote {
@ -166,12 +172,6 @@ pre,
margin-bottom: 0;
}
}
ul,
ol {
// Override default spacing so that lists entirely rely on adjacent sibling elements for spacing
margin-top: 0;
}
}
// T335625 - Move siteSub into common.less to prevent it from being feature-flagged