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

More fluent API for margins #18

Closed
bassmartin opened this issue Nov 10, 2016 · 4 comments
Closed

More fluent API for margins #18

bassmartin opened this issue Nov 10, 2016 · 4 comments

Comments

@bassmartin
Copy link

It's great to have the possibility to set margins to be hidden on some screen sizes, but I think the withMargin should be more fluent, like the ResponsiveColumn visibility :

public ResponsiveRow withMargin(MarginSize size, boolean xs, boolean sm, boolean md, boolean lg)

That way you can have something like :
row.withMargin(MarginSize.NORMAL, false, false, true, true).withMargin(MarginSize.SMALL, true, true, false, false)

What do you think?

@JarekToro
Copy link
Owner

Great thinking I love it

@JarekToro
Copy link
Owner

After some thinking I think going with this may be the best option.
row.withMargin(Normal,Small,None,Small)

JarekToro added a commit that referenced this issue Nov 20, 2016
MarginType.None replaced the false input in the margin calls
@JarekToro
Copy link
Owner

The boolean at the end of the margin calls have been replaced. Use MarginType.None for the margin instead

JarekToro added a commit that referenced this issue Nov 20, 2016
@JarekToro
Copy link
Owner

 setMargin(MarginType.Normal, ResponsiveColumn.DisplaySize.XS);
 setMargin(MarginType.Small, ResponsiveColumn.DisplaySize.SM);
 setMargin(MarginType.None, ResponsiveColumn.DisplaySize.MD);

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

No branches or pull requests

2 participants