Closed tehfailsafe closed 8 years ago
css-layout is a library from Facebook, and I'm using it to calculate the flexbox layout positions for every layer.
LayerLayout is the helper class I've added to Framer so the layers positions can be recalculated for every property update. You can check the code on the flexbox branch of my Framer fork.
Got it. I'd really like to start tinkering with this. Do you plan for a different workflow than merging into framer source?
I just tried a much easier flow, and it works :) Download this repo and rename the folder to framer-flex.framer. Open it with Framer Studio, and start playing with it. If you don't have Framer Studio, let me know and I will add an easier way to play with it, as soon as I can.
The layout properties available on the Layer class are the same documented in css-layout readme: minWidth
, flex
, justifyContent
... You can animate them as well –only the numeric ones, of course–.
Don't hesitate to share any examples, questions, or anything related either here or on the FB group.
Yes, I did that on your example and it works quite well. What I mean though is adding the LayerLayout more like a module or some other include, rather than swapping framer.js to the different framer.debug.js that bundles it.
That way it's separate from the framer source, and can be used in other existing projects, etc.
I see what you mean now, that's a good idea. So I extracted the code from the original pull request and put it in a library. I did it very quickly, so let me know if it works for you as I might have done some mistakes in the process.
Wow, you are fast! Got it up and running and will be playing with it on older prototypes. I'll let you know how it goes!
So far looking at framer.debug.js I can see a few additional packages added like css-layout, but I can't find a few others like LayerLayout? Did you write this specifically for this use case?