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

Add support for asymmetrical padding #630

Merged
merged 7 commits into from
Jun 1, 2021

Conversation

blefevre
Copy link
Contributor

This adds support for asymmetrical padding allowing each of the four sides to have a different padding value if desired.

The padding function now accepts a type of Into<Padding> which is implement by u16, [u16;2] and [u16;4].
This allows paddings to specified in the following ways:

// Non breaking, keeps current behavior of 20px on all sides
Row::new().padding(20);

// 10px on the top and bottom, 20px on the left and right, 
Row::new().padding([10, 20]);

// 5px on the top, 10px on the right, 15px on the bottom, 20px on the left
Row::new().padding([5, 10, 15, 20]);

Closes: #519

@hecrj hecrj added the feature New feature or request label Nov 25, 2020
@hecrj hecrj added this to the 0.3.0 milestone Feb 19, 2021
@hecrj hecrj modified the milestones: 0.3.0, 0.4.0 Mar 31, 2021
@hecrj hecrj force-pushed the asymmetric-padding branch from de4c132 to 2e17d78 Compare June 1, 2021 12:14
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Thank you 🎉

I made some small changes here and there and... I believe we can finally ship this! 🚢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Horizontal + vertical padding support
2 participants