Skip to content

Commit

Permalink
hide header descriptions when they're empty
Browse files Browse the repository at this point in the history
so that the title is fill the header
  • Loading branch information
Sean Wilson committed Aug 31, 2023
1 parent 173171f commit d0e16bf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/controls/ArrayControl.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,12 @@
</IconButton>
{/if}
<span class="control-array-title">{title ?? ""}</span>
<span slot="description">{description ?? ""}</span>
<svelte:fragment slot="description">{description ?? ""}</svelte:fragment>
<div slot="icon">
{#if canAddItem}
<IconButton type="button" class="material-icons" on:click={headerAddItem}>add</IconButton>
<IconButton type="button" class="material-icons" on:click={headerAddItem} size="button">add</IconButton>
{/if}
<IconButton type="button" toggle pressed={open}>
<IconButton type="button" toggle pressed={open} size="button">
<Icon class="material-icons" on>expand_less</Icon>
<Icon class="material-icons">expand_more</Icon>
</IconButton>
Expand Down
15 changes: 15 additions & 0 deletions src/theme/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,18 @@ $separator-color: #707070;
padding: 0.5rem 0;
}
}

.smui-accordion .smui-accordion__panel > .smui-accordion__header {
> .smui-accordion__header__title.smui-accordion__header__title--with-description {
flex: 1;
max-width: unset;
}

> .smui-accordion__header__description {
min-width: 60%;

&:empty {
display: none;
}
}
}

0 comments on commit d0e16bf

Please sign in to comment.