From 8473d99e1942b169aea164b5cd81f504e5649548 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Sat, 16 Mar 2024 21:14:26 -0400 Subject: [PATCH 1/3] feat(fill): Use a `@layer htmltools` --- inst/fill/fill.css | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/inst/fill/fill.css b/inst/fill/fill.css index 74ff612c..841ea9d5 100644 --- a/inst/fill/fill.css +++ b/inst/fill/fill.css @@ -1,19 +1,21 @@ -.html-fill-container { - display: flex; - flex-direction: column; - /* 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 */ - flex: 1 1 auto; - min-height: 0; - min-width: 0; -} -.html-fill-container > :not(.html-fill-item) { - /* Prevent shrinking or growing of non-fill items */ - flex: 0 0 auto; +@layer htmltools { + .html-fill-container { + display: flex; + flex-direction: column; + /* 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 */ + flex: 1 1 auto; + min-height: 0; + min-width: 0; + } + .html-fill-container > :not(.html-fill-item) { + /* Prevent shrinking or growing of non-fill items */ + flex: 0 0 auto; + } } From 456bbcbc281a24d1638087e19fbe79d5c84fd7e5 Mon Sep 17 00:00:00 2001 From: gadenbuie Date: Sun, 17 Mar 2024 01:36:29 +0000 Subject: [PATCH 2/3] `devtools::document()` (GitHub Actions) --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index a5d1fbbc..633f4d95 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -41,7 +41,7 @@ Config/Needs/check: knitr Config/Needs/website: rstudio/quillt, bench Encoding: UTF-8 Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 Collate: 'colors.R' 'fill.R' From c2ee205cc6d92b91f38a4c5eedb2b73883d91819 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Sat, 16 Mar 2024 21:38:21 -0400 Subject: [PATCH 3/3] docs: Add news item --- NEWS.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index e24e5b2e..aeec2449 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,12 @@ # htmltools (development version) +## Improvements + +* The fill CSS attached to fillable containers and fill items with `bindFillRole()` now uses a [CSS cascade layer](https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Cascade_layers) named `htmltools` to reduce the precedence order of the fill CSS. (#425) + ## Bug fixes -* `bindFillRole()` now attaches its `HTMLDependency()` to fill items, thus reducing the possibility of filling layout breaking due to missing CSS. (#421) +* `bindFillRole()` now attaches its `HTMLDependency()` to fill items, thus reducing the possibility of filling layout breaking due to missing CSS. (#421) # htmltools 0.5.7