Skip to content

Commit

Permalink
Remove trailing margin from HTML elements within markdown tables (#2365)
Browse files Browse the repository at this point in the history
* Remove trailing margin from last-child within a markdown table cell

* Add changeset

* Move new styles to table-specific file

* Disable `selector-max-compound-selectors` stylelint

Co-authored-by: simurai <simurai@github.com>
  • Loading branch information
jackbrewer and simurai authored Jan 24, 2023
1 parent 872a578 commit 4b94fbb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hot-parrots-shave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/css': patch
---

Remove trailing margin from last-child within a markdown table cell
8 changes: 7 additions & 1 deletion src/markdown/tables.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Needs refactoring
// stylelint-disable selector-max-type
// stylelint-disable selector-max-type, selector-max-compound-selectors
.markdown-body {
// Tables
table {
Expand All @@ -20,6 +20,12 @@
border: $border-width $border-style var(--color-border-default);
}

td {
> :last-child {
margin-bottom: 0;
}
}

tr {
background-color: var(--color-canvas-default);
border-top: $border-width $border-style var(--color-border-muted);
Expand Down

0 comments on commit 4b94fbb

Please sign in to comment.