Skip to content

Commit a1078be

Browse files
authored
Merge pull request #3269 from ibdafna/border_fix
Set border property upon construction
2 parents be47046 + 3de5490 commit a1078be

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ipywidgets/widgets/widget_layout.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class Layout(Widget):
2424
- ``flex-wrap`` and ``flex-direction`` are bound to ``flex-flow``.
2525
- ``margin-[top/bottom/left/right]`` values are bound to ``margin``, etc.
2626
"""
27-
2827
_view_name = Unicode('LayoutView').tag(sync=True)
2928
_view_module = Unicode('@jupyter-widgets/base').tag(sync=True)
3029
_view_module_version = Unicode(__jupyter_widgets_base_version__).tag(sync=True)
@@ -78,6 +77,14 @@ class Layout(Widget):
7877
grid_column = Unicode(None, allow_none=True, help="The grid-column CSS attribute.").tag(sync=True)
7978
grid_area = Unicode(None, allow_none=True, help="The grid-area CSS attribute.").tag(sync=True)
8079

80+
def __init__(self, **kwargs):
81+
if 'border' in kwargs:
82+
border = kwargs.pop('border')
83+
for side in ['top', 'right', 'bottom', 'left']:
84+
kwargs.setdefault(f'border_{side}', border)
85+
86+
super().__init__(**kwargs)
87+
8188
def _get_border(self):
8289
"""
8390
`border` property getter. Return the common value of all side

0 commit comments

Comments
 (0)