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(styles): remove margin only on first or last element in table cell #377

Merged
merged 1 commit into from
Feb 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 13 additions & 18 deletions src/scss/_common.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
@import 'variables';

@mixin removeMarginForEdgeChildren {
& > *:first-child {
margin-top: 0;
}

& > *:last-child {
margin-bottom: 0;
}
}

.yfm {
font-family: var(--yfm-font-family-sans);
font-size: 15px;
Expand Down Expand Up @@ -186,10 +196,7 @@
text-overflow: ellipsis;
border: 1px solid $borderColor;

p {
padding: 0;
margin: 0;
}
@include removeMarginForEdgeChildren();
}

td {
Expand Down Expand Up @@ -237,25 +244,13 @@
padding-left: 12px;
border-left: 3px solid $accentColor;

& > *:first-child {
margin-top: 0;
}

& > *:last-child {
margin-bottom: 0;
}
@include removeMarginForEdgeChildren();
}

dl {
padding: 0;

& > *:first-child {
margin-top: 0;
}

& > *:last-child {
margin-bottom: 0;
}
@include removeMarginForEdgeChildren();

dt {
margin-bottom: 5px;
Expand Down
Loading