diff --git a/src/textual/css/_style_properties.py b/src/textual/css/_style_properties.py index e91282af3..10c8f9f8a 100644 --- a/src/textual/css/_style_properties.py +++ b/src/textual/css/_style_properties.py @@ -220,9 +220,9 @@ class ScalarListProperty: percent_unit: The dimension to which percentage scalars will be relative to. """ - def __init__(self, children: bool = False, percent_unit: Unit) -> None: - self.children = children + def __init__(self, percent_unit: Unit, children: bool = False) -> None: self.percent_unit = percent_unit + self.children = children def __set_name__(self, owner: Styles, name: str) -> None: self.name = name diff --git a/src/textual/css/styles.py b/src/textual/css/styles.py index 29cacf7cb..4a3691bcc 100644 --- a/src/textual/css/styles.py +++ b/src/textual/css/styles.py @@ -287,8 +287,8 @@ class StylesBase(ABC): content_align_vertical = StringEnumProperty(VALID_ALIGN_VERTICAL, "top") content_align = AlignProperty() - grid_rows = ScalarListProperty(children=True, percent_unit=Unit.HEIGHT) - grid_columns = ScalarListProperty(children=True, percent_unit=Unit.WIDTH) + grid_rows = ScalarListProperty(percent_unit=Unit.HEIGHT, children=True) + grid_columns = ScalarListProperty(percent_unit=Unit.WIDTH, children=True) grid_size_columns = IntegerProperty(default=1, layout=True, children=True) grid_size_rows = IntegerProperty(default=0, layout=True, children=True)