Skip to content
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# htmltools (development version)

* Empty Shiny text and UI outputs are now hidden by default in fillable containers. (#435)

# htmltools 0.5.8

## Improvements
Expand Down
14 changes: 10 additions & 4 deletions inst/fill/fill.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
.html-fill-container {
display: flex;
flex-direction: column;
/* Prevent the container from expanding vertically or horizontally beyond its
parent's constraints. */
/* Prevent the container from expanding vertically or horizontally beyond
* its parent's constraints. */
min-height: 0;
min-width: 0;
}
.html-fill-container > .html-fill-item {
/* Fill items can grow and shrink freely within
available vertical space in fillable container */
/* Fill items can grow and shrink freely within available vertical space in
* fillable container */
flex: 1 1 auto;
min-height: 0;
min-width: 0;
Expand All @@ -18,4 +18,10 @@
/* Prevent shrinking or growing of non-fill items */
flex: 0 0 auto;
}
.html-fill-container > .shiny-html-output:empty,
.html-fill-container > .shiny-text-output:empty {
Comment on lines +21 to +22
Copy link
Member Author

@gadenbuie gadenbuie Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of targeting shiny output classes specifically, we could generically target empty elements

Suggested change
.html-fill-container > .shiny-html-output:empty,
.html-fill-container > .shiny-text-output:empty {
.html-fill-container > :empty {

/* Remove empty ui and text outputs from the document flow so that extra
* space in the flex container is not allocated for them. */
position: absolute
}
}