Skip to content

Commit

Permalink
fix(card): hide header container when it's empty (#1558)
Browse files Browse the repository at this point in the history
* fix(card): hide header container when it's empty

Fixes #1383

* style: review
  • Loading branch information
bennypowers authored May 21, 2024
1 parent c189569 commit 835a008
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .changeset/plenty-rabbits-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"@rhds/elements": patch
---
`<rh-card>`: hide header, body, or footer regions when they have no content
10 changes: 6 additions & 4 deletions elements/rh-card/rh-card.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ article {
flex-direction: column;
}

.empty {
display: none;
}

::slotted(*) {
line-height: inherit !important;
}
Expand Down Expand Up @@ -53,6 +49,12 @@ article {
margin-inline: var(--rh-space-xl, 24px);
}

#header.empty,
#footer.empty,
#body.empty {
display: none;
}

#header ::slotted(:is(h1, h2, h3, h4, h5, h6)),
#body ::slotted(:is(h1, h2, h3, h4, h5, h6)) {
font-family: var(--rh-font-family-heading, RedHatDisplay, "Red Hat Display", "Noto Sans Arabic", "Noto Sans Hebrew", "Noto Sans JP", "Noto Sans KR", "Noto Sans Malayalam", "Noto Sans SC", "Noto Sans TC", "Noto Sans Thai", Helvetica, Arial, sans-serif);
Expand Down

0 comments on commit 835a008

Please sign in to comment.