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.
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.
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.
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.