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

Vertical flex layout will be supported ? #9208

Closed
wensonsmith opened this issue Sep 27, 2016 · 11 comments
Closed

Vertical flex layout will be supported ? #9208

wensonsmith opened this issue Sep 27, 2016 · 11 comments

Comments

@wensonsmith
Copy link

image

This is mobi.css framework, it support vertical flex layout , it's useful.

So any plan to support vertical flex layout ? thanks.

@kball
Copy link
Contributor

kball commented Sep 27, 2016

I definitely think we're only scratching the surface of what is possible with flexbox, but I'd like to get a better sense of what types of things we really want to enable with it. Its not clear to me what the value is in a "vertical columns" implementation like this, but if we can explain some possibilities and encapsulate it I'd be happy for us to do something here.

Can you highlight some examples of where you'd use this? Or what types of patterns you might want to wrap up in this? @wensonsmith and @DaSchTour

@ncoden @andycochran @brettsmason @zurbrandon Do you have any thoughts or ideas on what we could do with something here?

@brettsmason
Copy link
Contributor

So I'm not hugely familiar with flexbox as I dont use it day to day yet. However I cant see any harm in adding this so we fully embrace flexbox.

From looking over the specs and the code we already have, I would suggest a mixin of something like:

@mixin flex-direction($direction) {
    flex-direction: $direction;
}

It looks like the possible values are:

  • row (default): same as text direction
  • row-reverse: opposite to text direction
  • column: same as row but top to bottom
  • column-reverse: same as row-reverse top to bottom

Then we would need some utility classes generated from this for non-mixin folks.

@DaSchTour
Copy link
Contributor

DaSchTour commented Sep 28, 2016

One example of a usecase for vertical fexbox is my PR for flexbox cards #8722 that is hanging around since half a year. I heavily use this for elements with a fixed height header and footer and a flexible middle part to get equal height for all elements in a row without javascript.

@wensonsmith
Copy link
Author

wensonsmith commented Sep 28, 2016

All I want to do is make div element auto height.

For example :

image

This is my app structure, Header and Button is fixed height, Vertical flex can easy to make Scroll Part auto fit the left space. It's more complex to use % or other tricks.

Most Desktop web pages is left to right structure, But Mobile web pages is top to bottom structure, so vertical flex layout is useful to develop Mobile web pages.

Sorry for my English , hope you can understand, Thank you!

@kball
Copy link
Contributor

kball commented Sep 28, 2016

Ok, sounds good. @DaSchTour I'll take a look at the flexbox card PR again shortly, but I think this is looking for something a little more 'foundational' than that.

Would any of @wensonsmith, @DaSchTour, or @brettsmason like to take a pass on an implementation and submit it as a PR?

@markadrake
Copy link

It can also be used to produce a layout such as this quickly and effectively. This image shows essentially 3 flex containers. The initial container is horizontal and creates the two columns. The next flex box is in the right container, and it's vertical, and cuts it again in half for two rows. Then you place another flex container (having fun yet?) for the top right columns.

And then you can apply stacking classes to manipulate the structure when moving from a larger desktop screen all the way down to mobile and 100% stacked.

image

@kball
Copy link
Contributor

kball commented Oct 10, 2016

Ok, I'm definitely sold on the utility. Would happily accept a PR

@zurbrandon
Copy link
Contributor

This is basically what the apps grid produces, i know there are talks of adding that in @kball and that may cover this usecase.

@kball
Copy link
Contributor

kball commented Nov 2, 2016

Hey folks, I took a pass on this in #9324

Would love your feedback

@kball
Copy link
Contributor

kball commented Nov 15, 2016

This has been implemented in #9324! Let me know if you run into any challenges or find things that feel missing.

@kball kball closed this as completed Nov 15, 2016
@iamrobert
Copy link

Here's getting equal heights for headings:

https://codepen.io/iamrobert/pen/eyeyBB

I've looked at cards - but can't work out how to implement equal heights for headings without equalizer.

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

7 participants