AnswerDotAI / AnswerDotAI/MonsterUI
DivHStacked / DivVStacked don't accept a gap parameter
- Dominant language
- Jupyter Notebook
- Stars
- 522
- Forks
- 33
- Avg merge
- 1m
- Merged PRs (30d)
- 1
Description
## Summary
`DivHStacked` and `DivVStacked` don't accept a `gap` parameter, so callers that need a non-default gap must either write the Tailwind class manually or maintain wrapper components that do the translation.
## Reproduction
```python
from monsterui.franken import DivHStacked
DivHStacked(A, B, gap=4) # TypeError — unexpected keyword argument
```
## Expected behaviour
```python
DivHStacked(A, B, gap=4) # renders with class "gap-4" applied
DivVStacked(A, B, gap=2) # renders with class "gap-2" applied
```
## Current workaround
Downstream code maintains wrapper components solely to translate `gap=int` into the corresponding Tailwind class:
```python
def DivHStacked(*c, gap: int = 2, cls: str = "", **kwargs):
classes = [f"flex items-center gap-{gap}"]
if cls:
classes.append(cls)
return Div(*c, cls=" ".join(classes), **kwargs)
```
These wrappers exist only because the originals don't support `gap` — they add no semantic value of their own.
## Suggested fix
Accept an optional `gap: int | None = None` keyword on both `DivHStacked` and `DivVStacked` and append `f"gap-{gap}"` to the class list when provided.
Contributor guide
Research direction
Start at the definitions of DivHStacked and DivVStacked and inspect how their existing class lists and cls arguments are assembled. Verify the change with the reproduction cases: gap=4 and gap=2 should apply the corresponding Tailwind classes while omitting the class when gap is not provided.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tailwindcss
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100