-
Notifications
You must be signed in to change notification settings - Fork 28
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 more granular spacing options #84
Conversation
when Array | ||
DIRECTIONS.zip(values).to_h.each do |direction, value| | ||
styles["#{attribute}-#{direction}"] = Dimensions.length(value) | ||
end |
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.
Nit: What happens here if somebody sends in an array of three elements? Should we compact after the to_h
?
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.
Then only margin-left, margin-right, and margin-top will be set. We could compact here but the compact!
handles all cases so probably not needed.
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.
I benchmarked it real quick and the difference is fairly minor but a complex enough layout (100,000+ stacks) could see a speed boot (~100-200 ms) from compacting post to_h
so I'm going to make the change. Good call!
a complex enough layout (100,000+ stacks) could see a speed boot (~100-200 ms) from compacting post to_h
Adds multiple ways to set margin and/or padding on stacks and flows:
single value:
array of values:
hash with values:
keywords: