Skip to content

Commit

Permalink
fix(alert): hide empty header
Browse files Browse the repository at this point in the history
Fixes #1530
  • Loading branch information
bennypowers committed Sep 19, 2024
1 parent a9ae0fb commit d510d97
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .changeset/mean-months-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
"@rhds/elements": patch
---
`<rh-alert>`: hide header when it is empty
4 changes: 4 additions & 0 deletions elements/rh-alert/rh-alert.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
max-width: var(--_max-width, initial);
}

[hidden] {
display: none !important;
}

header {
display: flex;
align-items: center;
Expand Down
2 changes: 1 addition & 1 deletion elements/rh-alert/rh-alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export class RhAlert extends LitElement {
<rh-icon id="icon" set="ui" icon="${this.icon}"></rh-icon>
</div>
<div id="middle-column">
<header>
<header ?hidden="${this.#slots.isEmpty('header')}">
<div id="header">
<slot name="header"></slot>
</div>${!this.dismissable && this.variant !== 'toast' ? '' : html`
Expand Down

0 comments on commit d510d97

Please sign in to comment.