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

Default xs prop in Col component #72

Open
sstefoss opened this issue Aug 30, 2017 · 4 comments
Open

Default xs prop in Col component #72

sstefoss opened this issue Aug 30, 2017 · 4 comments

Comments

@sstefoss
Copy link

Hey, i was wondering why isn't xs={12} set as default prop in Col.

Makes more sense to define the first breakpoint that its value is different than "12".
For example instead of this

<Col xs={12} md={6}>

i could just write

<Col md={6}>

Because with no default breakpoint value i have to write xs={12} to all my components.

@aaronvanston
Copy link
Owner

aaronvanston commented Aug 31, 2017

Hi @sstefoss ,

This is something we can look into doing (setting a default to Col). Out of the box Flexa takes the view of implementing much of the CSS Flexbox API one-to-one with no extra "magic".

As a result the components have very little defaults set to them. This helps reserve expected behavior, if we start to add various values to start with it can conflict to what people are expecting.

If you're interested I'm happy to work with you on creating a pull request to build out this functionality and test it with real world examples?

@sstefoss
Copy link
Author

I understand. What if it was an optional property in theme? To set the default breakpoint values when nothing is specified.
I would be happy to contribute too.

@aaronvanston
Copy link
Owner

That could work!

I had been thinking for a bit about setting default props via the theme provider.

So this could work as you mentioned we could set default props via the theme:

flexa: {
   col: {
      xs: 12,
      sm: 6,
   },
},

We would need to check the theme provider for the props if they exist when creating the width. This is currently done for the gutters.

@seeliang
Copy link

@sstefoss agreed

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

No branches or pull requests

3 participants