-
Notifications
You must be signed in to change notification settings - Fork 56
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
feat: add gaps between panes #389
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for allotment-storybook ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for allotment-website canceled.
|
useEffect(() => { | ||
if (gap) { | ||
document.documentElement.style.setProperty("--gap-size", gap + "px"); | ||
} | ||
}, [gap]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If gap changed from say 5 to 0, this wouldn't change the --gap-size
back to 0. Maybe prefer a nullish check? Also I think for effects that modify style, useLayoutEffect
is preferred because it runs before paint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed on both points. I've not progressed this PR because it doesn't play nice with the 'real' dimensions of the panes. If you ask for a minSize of 10 then it won't account for the gap size. Which is a long-winded way of saying I need to go in and change the guts of how allotment works. Which I want to do but don't have the time right now.
The gap === 0
point is a really good one though. Just the sort of thing a code review would catch 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be really cool to implement this feature. I need a gap between panels in my designs. Do you have any plans to implement it?
No description provided.