Skip to content

Commit

Permalink
feat: style argument of ColumnsReactive also accept a dict
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed Jun 28, 2023
1 parent eaba66f commit bc81d7d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions solara/components/columns.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import itertools
from typing import Dict, List, Optional, Union
from typing import Dict, List, Union

import reacton.ipyvuetify as rv

Expand Down Expand Up @@ -91,7 +91,7 @@ def ColumnsResponsive(
gutters=True,
gutters_dense=False,
classes: List[str] = [],
style: Optional[str] = None,
style: Union[str, Dict[str, str], None] = None,
):
"""Lay our children in columns, on a 12 point grid system that is responsive to screen size.
Expand Down Expand Up @@ -141,7 +141,8 @@ def cycle(value):
raise ValueError(f"Invalid value for columns: {value}, should be None, int, or list/tuple.")

class_ = _combine_classes([*(["flex-nowrap"] if not wrap else []), *classes])
with rv.Row(class_=class_ if not wrap else "", style_=style, no_gutters=not gutters, dense=gutters_dense) as main:
style_flat = solara.util._flatten_style(style)
with rv.Row(class_=class_ if not wrap else "", style_=style_flat, no_gutters=not gutters, dense=gutters_dense) as main:
for child, xsmall, small, medium, large, xlarge in zip(children, cycle(default), cycle(small), cycle(medium), cycle(large), cycle(xlarge)):
with rv.Col(
cols=xsmall,
Expand Down

0 comments on commit bc81d7d

Please sign in to comment.