From 4f7de2b82782857003e86c973e0de40e9cffe9a4 Mon Sep 17 00:00:00 2001
From: Garrick Aden-Buie <garrick@adenbuie.com>
Date: Mon, 10 Jun 2024 11:40:46 -0400
Subject: [PATCH 1/4] fix: Don't add `bslib-gap-spacing` when card body is not
 fillable

---
 R/card.R | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/R/card.R b/R/card.R
index 39da272fd..e782c738f 100644
--- a/R/card.R
+++ b/R/card.R
@@ -197,7 +197,8 @@ card_body <- function(..., fillable = TRUE, min_height = NULL, max_height = NULL
   }
 
   tag <- div(
-    class = "card-body bslib-gap-spacing",
+    class = "card-body",
+    class = if (fillable) "bslib-gap-spacing",
     style = css(
       min_height = validateCssUnit(min_height),
       "--bslib-card-body-max-height" = validateCssUnit(max_height),

From 6c21425da32eb32242bd4848b522f7048a4ec089 Mon Sep 17 00:00:00 2001
From: Garrick Aden-Buie <garrick@adenbuie.com>
Date: Mon, 10 Jun 2024 11:45:50 -0400
Subject: [PATCH 2/4] docs: add news

---
 NEWS.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/NEWS.md b/NEWS.md
index 9ee177f07..5afb7ea51 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -20,6 +20,8 @@
 
 * The main content area of `page_sidebar()` and `page_navbar()` with a `sidebar` now have a minimum height and width to avoid squashed content in fillable layouts. The minimum height and width are controllable via Sass and CSS variables (see the pull requests for details). (#1057, #1059)
 
+* When `card_body(fillable = FALSE)`, bslib now preserves flow-layout margin bottom settings. (#1073)
+
 # bslib 0.7.0
 
 This large release includes many improvements and bug fixes for newer UI components like `layout_columns()`, `card()`, and `sidebar()`. In addition, the new `input_task_button()` offers a drop-in replacement for `shiny::actionButton()` (to prevent multiple submissions of the same operation) as well as pairing nicely with the new `shiny::ExtendedTask` for implementing truly non-blocking operations in Shiny.

From 0966371db50281e834d9e1ff4b025cb02188e5a9 Mon Sep 17 00:00:00 2001
From: Carson <cpsievert1@gmail.com>
Date: Mon, 10 Jun 2024 11:23:20 -0500
Subject: [PATCH 3/4] Catch one more case where we should be conditionally
 adding bslib-gap-spacing

---
 R/layout.R | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/R/layout.R b/R/layout.R
index 1e9c0fa5f..c85c067e9 100644
--- a/R/layout.R
+++ b/R/layout.R
@@ -389,7 +389,8 @@ row_heights_css_vars <- function(x) {
 grid_item_container <- function(el, ..., fillable = TRUE) {
   div(
     ...,
-    class = "bslib-grid-item bslib-gap-spacing",
+    class = "bslib-grid-item",
+    class = if (fillable) "bslib-gap-spacing",
     if (fillable) as_fillable_container(),
     el
   )

From 883c9c39b22586c9491abaf1ca5548cda8b44ad4 Mon Sep 17 00:00:00 2001
From: Garrick Aden-Buie <garrick@adenbuie.com>
Date: Mon, 10 Jun 2024 12:59:42 -0400
Subject: [PATCH 4/4] test: accept snap

---
 tests/testthat/_snaps/layout.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/testthat/_snaps/layout.md b/tests/testthat/_snaps/layout.md
index 90ac78a0f..c1bd61cc2 100644
--- a/tests/testthat/_snaps/layout.md
+++ b/tests/testthat/_snaps/layout.md
@@ -92,7 +92,7 @@
     Code
       grid_item_container(div(class = "layout-column-child-element"), fillable = FALSE)
     Output
-      <div class="bslib-grid-item bslib-gap-spacing">
+      <div class="bslib-grid-item">
         <div class="layout-column-child-element"></div>
       </div>