Skip to content

Commit 5bbe19e

Browse files
committed
chore: Use as_fill_item(as_fillable_container(main))
1 parent 0e01c66 commit 5bbe19e

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

shiny/ui/_page.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
from ._tag import consolidate_attrs
4242
from ._utils import get_window_title
4343
from .css import CssUnit, as_css_padding, as_css_unit
44-
from .fill._fill import add_fill_classes, as_fillable_container
44+
from .fill._fill import as_fill_item, as_fillable_container
4545

4646
page_sidebar_default: SidebarOpen = SidebarOpen(desktop="open", mobile="always")
4747

@@ -144,11 +144,8 @@ def page_sidebar(
144144

145145

146146
def page_main_container(*args: TagChild) -> Tag:
147-
return add_fill_classes(
148-
tags.main({"class": "bslib-page-main bslib-gap-spacing"}, *args),
149-
fill_item=True,
150-
fillable_container=True,
151-
)
147+
main = tags.main({"class": "bslib-page-main bslib-gap-spacing"}, *args)
148+
return as_fillable_container(as_fill_item(main))
152149

153150

154151
@no_example()

shiny/ui/fill/_fill.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,3 @@ def is_fill_item(tag: object) -> bool:
215215
# renders_to_tag_class(x, FILL_ITEM_CLASS, ".html-widget")
216216

217217
return isinstance(tag, Tag) and tag.has_class(FILL_ITEM_CLASS)
218-
219-
220-
def add_fill_classes(
221-
tag: Tag, fill_item: bool = True, fillable_container: bool = True
222-
) -> Tag:
223-
if fill_item:
224-
tag.add_class(FILL_ITEM_CLASS)
225-
if fillable_container:
226-
tag.add_class(FILL_CONTAINER_CLASS)
227-
if fill_item or fillable_container:
228-
tag.append(fill_dependency())
229-
return tag

0 commit comments

Comments
 (0)