File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 4141from ._tag import consolidate_attrs
4242from ._utils import get_window_title
4343from .css import CssUnit , as_css_padding , as_css_unit
44- from .fill ._fill import as_fillable_container
44+ from .fill ._fill import add_fill_classes , as_fillable_container
4545
4646page_sidebar_default : SidebarOpen = SidebarOpen (desktop = "open" , mobile = "always" )
4747
@@ -128,7 +128,7 @@ def page_sidebar(
128128 navbar_title ,
129129 layout_sidebar (
130130 sidebar ,
131- * children ,
131+ page_main_container ( * children ) ,
132132 attrs ,
133133 fillable = fillable ,
134134 border = False ,
@@ -143,6 +143,14 @@ def page_sidebar(
143143 )
144144
145145
146+ 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+ )
152+
153+
146154@no_example ()
147155def page_navbar (
148156 * args : NavSetArg | MetadataNode | Sequence [MetadataNode ],
Original file line number Diff line number Diff line change @@ -215,3 +215,15 @@ 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
You can’t perform that action at this time.
0 commit comments