@@ -37,8 +37,11 @@ class Layout(Widget):
37
37
'baseline' , 'stretch' ] + CSS_PROPERTIES , allow_none = True , help = "The align-items CSS attribute." ).tag (sync = True )
38
38
align_self = CaselessStrEnum (['auto' , 'flex-start' , 'flex-end' ,
39
39
'center' , 'baseline' , 'stretch' ] + CSS_PROPERTIES , allow_none = True , help = "The align-self CSS attribute." ).tag (sync = True )
40
+ border_top = Unicode (None , allow_none = True , help = "The border top CSS attribute." ).tag (sync = True )
41
+ border_right = Unicode (None , allow_none = True , help = "The border right CSS attribute." ).tag (sync = True )
42
+ border_bottom = Unicode (None , allow_none = True , help = "The border bottom CSS attribute." ).tag (sync = True )
43
+ border_left = Unicode (None , allow_none = True , help = "The border left CSS attribute." ).tag (sync = True )
40
44
bottom = Unicode (None , allow_none = True , help = "The bottom CSS attribute." ).tag (sync = True )
41
- border = Unicode (None , allow_none = True , help = "The border CSS attribute." ).tag (sync = True )
42
45
display = Unicode (None , allow_none = True , help = "The display CSS attribute." ).tag (sync = True )
43
46
flex = Unicode (None , allow_none = True , help = "The flex CSS attribute." ).tag (sync = True )
44
47
flex_flow = Unicode (None , allow_none = True , help = "The flex-flow CSS attribute." ).tag (sync = True )
@@ -75,6 +78,30 @@ class Layout(Widget):
75
78
grid_column = Unicode (None , allow_none = True , help = "The grid-column CSS attribute." ).tag (sync = True )
76
79
grid_area = Unicode (None , allow_none = True , help = "The grid-area CSS attribute." ).tag (sync = True )
77
80
81
+ def _get_border (self ):
82
+ """
83
+ `border` property getter. Return the common value of all side
84
+ borders if they are identical. Otherwise return None.
85
+
86
+ """
87
+ found = None
88
+ for side in ['top' , 'right' , 'bottom' , 'left' ]:
89
+ if not hasattr (self , "border_" + side ):
90
+ return
91
+ old , found = found , getattr (self , "border_" + side )
92
+ if found is None or (old is not None and found != old ):
93
+ return
94
+ return found
95
+
96
+ def _set_border (self , border ):
97
+ """
98
+ `border` property setter. Set all 4 sides to `border` string.
99
+ """
100
+ for side in ['top' , 'right' , 'bottom' , 'left' ]:
101
+ setattr (self , "border_" + side , border )
102
+
103
+ border = property (_get_border , _set_border )
104
+
78
105
79
106
class LayoutTraitType (Instance ):
80
107
0 commit comments