Add missing help text for granular spacing properties

This commit is contained in:
Darren Burns
2022-04-26 13:27:21 +01:00
parent 5b24bcefd9
commit 124bb0a45c
2 changed files with 2 additions and 2 deletions

View File

@@ -124,7 +124,7 @@ def _spacing_examples(property_name: str) -> ContextSpecificBullets:
"In Textual CSS, supply 1, 2 or 4 integers separated by a space", "In Textual CSS, supply 1, 2 or 4 integers separated by a space",
examples=[ examples=[
Example(f"{property_name}: 1;"), Example(f"{property_name}: 1;"),
Example(f"{property_name}: 1 2; [dim]# Vertical, horizontal"), Example(f"{property_name}: 1 2; [dim]# Vertical, horizontal"),
Example( Example(
f"{property_name}: 1 2 3 4; [dim]# Top, right, bottom, left" f"{property_name}: 1 2 3 4; [dim]# Top, right, bottom, left"
), ),

View File

@@ -343,7 +343,7 @@ class StylesBuilder:
def _process_space_partial(self, name: str, tokens: list[Token]) -> None: def _process_space_partial(self, name: str, tokens: list[Token]) -> None:
"""Process granular margin / padding declarations.""" """Process granular margin / padding declarations."""
if len(tokens) != 1: if len(tokens) != 1:
self.error(name, tokens[0], "expected a single token here") self.error(name, tokens[0], spacing_invalid_value(name, context="css"))
_EDGE_SPACING_MAP = {"top": 0, "right": 1, "bottom": 2, "left": 3} _EDGE_SPACING_MAP = {"top": 0, "right": 1, "bottom": 2, "left": 3}
token = tokens[0] token = tokens[0]