Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add gap property to pn.FlexBox() #6350

Closed
OSuwaidi opened this issue Feb 15, 2024 · 3 comments · Fixed by #6354
Closed

Feature Request: Add gap property to pn.FlexBox() #6350

OSuwaidi opened this issue Feb 15, 2024 · 3 comments · Fixed by #6354
Labels
type: enhancement Minor feature or improvement to an existing feature
Milestone

Comments

@OSuwaidi
Copy link
Contributor

Panel's pn.FlexBox() is quite versatile.

However, it lacks one import property which is gap; and if I were to manually inject the gap CSS into the flexbox via:
pn.FlexBox(flex_direction='column', ..., styles={"gap": "1rem"}), it doesn't take effect.

Though if I were to switch pn.FlexBox() to pn.Column(), and apply the following CSS:

pn.Column(..., styles={
            "display": "flex",
            "flex-direction": "column",
            "align-items": "center",
            "justify-content": "center",
            "gap": "1rem"
            })

then it works fine!

@philippjfr philippjfr added the type: enhancement Minor feature or improvement to an existing feature label Feb 15, 2024
@philippjfr philippjfr added this to the v1.4.0 milestone Feb 15, 2024
@philippjfr
Copy link
Member

Would you be open to making a PR?

@philippjfr
Copy link
Member

Really just need to add the parameter and then update panel/layout/flex.html and add the gap:

<div id="flexbox" style="display: flex; flex-wrap: ${flex_wrap}; justify-content: ${justify_content}; flex-direction: ${flex_direction}; align-content: ${align_content}; align-items: ${align_items}; gap: ${gap}; height: 100%;">

@OSuwaidi
Copy link
Contributor Author

Would you be open to making a PR?

Sure, I would love to!

And thanks a lot for the hint 👍

@hoxbro hoxbro linked a pull request Feb 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement Minor feature or improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants