2323
2424
2525def row (* args : TagChildArg , ** kwargs : TagAttrArg ) -> Tag :
26- return div (* args , class_ = "row" , ** kwargs )
26+ return div ({ "class" : "row" }, * args , ** kwargs )
2727
2828
2929def column (
@@ -38,7 +38,7 @@ def column(
3838 # https://github.com/twbs/bootstrap/blob/74b8fe7/docs/4.3/migration/index.html#L659
3939 off = str (offset )
4040 cls += f" offset-md-{ off } col-sm-offset-{ off } "
41- return div (* args , class_ = cls , ** kwargs )
41+ return div ({ "class" : cls }, * args , ** kwargs )
4242
4343
4444# TODO: also accept a generic list (and wrap in panel in that case)
@@ -49,23 +49,23 @@ def layout_sidebar(
4949
5050
5151def panel_well (* args : TagChildArg , ** kwargs : TagAttrArg ) -> Tag :
52- return div (* args , class_ = "well" , ** kwargs )
52+ return div ({ "class" : "well" }, * args , ** kwargs )
5353
5454
5555def panel_sidebar (* args : TagChildArg , width : int = 4 , ** kwargs : TagAttrArg ) -> Tag :
5656 return div (
57+ {"class" : "col-sm-" + str (width )},
5758 # A11y semantic landmark for sidebar
58- tags .form (* args , role = "complementary" , class_ = "well" , ** kwargs ),
59- class_ = "col-sm-" + str (width ),
59+ tags .form ({"class" : "well" }, * args , role = "complementary" , ** kwargs ),
6060 )
6161
6262
6363def panel_main (* args : TagChildArg , width : int = 8 , ** kwargs : TagAttrArg ) -> Tag :
6464 return div (
65+ {"class" : "col-sm-" + str (width )},
6566 # A11y semantic landmark for main region
6667 * args ,
6768 role = "main" ,
68- class_ = "col-sm-" + str (width ),
6969 ** kwargs ,
7070 )
7171
@@ -131,4 +131,4 @@ def panel_absolute(
131131
132132
133133def help_text (* args : TagChildArg , ** kwargs : TagAttrArg ) -> Tag :
134- return span (* args , class_ = "help-block" , ** kwargs )
134+ return span ({ "class" : "help-block" }, * args , ** kwargs )
0 commit comments