Skip to content

Commit

Permalink
Allow columns CSS property to accept int/str vals. (#86)
Browse files Browse the repository at this point in the history
The columns property allows int/strs according to
https://developer.mozilla.org/en-US/docs/Web/CSS/columns

We want to keep the int value for backwards compatibility.

Fixes #79
  • Loading branch information
richard-to authored Mar 28, 2024
1 parent fcabaae commit 2af4d05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions mesop/component_helpers/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class Style:
box_sizing: str | None = None
color: str | None = None
column_gap: int | str | None = None
columns: int | None = None
columns: int | str | None = None
cursor: str | None = None
display: Literal[
# precomposed values
Expand Down Expand Up @@ -273,7 +273,7 @@ def to_style_proto(s: Style) -> pb.Style:
box_sizing=s.box_sizing,
color=s.color,
column_gap=_px_str(s.column_gap),
columns=s.columns,
columns=str(s.columns),
cursor=s.cursor,
display=s.display,
flex_basis=s.flex_basis,
Expand Down
2 changes: 1 addition & 1 deletion mesop/protos/ui.proto
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ message Style {
optional string box_sizing = 47;
optional string color = 4;
optional string column_gap = 33;
optional int32 columns = 5;
optional string columns = 5;
optional string cursor = 46;
optional string display = 6;
optional string flex_basis = 7;
Expand Down

0 comments on commit 2af4d05

Please sign in to comment.