-
Notifications
You must be signed in to change notification settings - Fork 3.4k
flex-grow vs flex #2632
Comments
@robertmesserle - I like this. What are your thoughts? |
I like this too. I just ran into some buttons shrinking down to nothing because only one had flex in a row of 3. But I only wanted the one to essentially grow. I ended up just using @ThomasBurleson What do you think of keeping the |
My thought is to 'add' the On Thu, Apr 30, 2015 at 11:01 AM Ed Pelc notifications@github.com wrote:
|
@ThomasBurleson Sounds good to me |
+1. I added [flex-grow] to my own build the other day to provide this functionality. I've used it in a couple scenarios already. |
First of all, the argument about Also, there is no difference between Thus, the only property affected differently is
The end-result of both options is showcased in the following figure (Figure 6 from the spec):
IMO, when using the Also note, that the spec itself encourages the use of the
Considering all the above, I believe that the current implementation is the best approach. It just might be the case, that I am missing something, so please let me know :) |
You are right.
Option 1 is easier to explain but then what about items/widgets shrinking below their "natural" size problem when combined with flex-wrap: wrap (edit)? This is confusing: in the spec, 4 out of the 5 "most common flex values" use |
Again, using If you meant to suggest that the FWIW, I still believe that |
Again? please re-read my last comment: I'm only talking about Let me reformulate and simplify my 'new' thoughts: one advantage (huge in my opinion) of Here my "decision spreadsheet": https://docs.google.com/spreadsheets/d/1mWApG2YNVRSVCibfQBKyX7uQcr-qYBB2qbG9jSLIEGk/ |
I did and still... 😃 You seem to be under the impression that Your spreadsheet has a few errors; it's more like:
(1): I would argue that Special values that use/imply
Special values that use/imply
Based on the above, my personal impression is that (if you want flexibility) the "most common" case is I am not sure how this comes across, so I wanted to point out that I am very glad that such concerns are raised/discussed. I believe that Flexbox is a liberating spec and it will be great if |
I've omitted to mention in the context of Here your codepen with My original mistake when I wrote this issue was to believe that |
OK, I am totally confused now. So what is your suggetion ?
This was not mistake; this is a correct assumption:
Even with The only difference I see is between In order for this discrpancy to appear, one has to explicitly set Since But I would like to hear what you are suggesting, because (like I mentioned in the beginning) it is not clear to me anymore 😕 |
Unfortunately, I don't think we can get to this before 1.0 (unless, possibly, a PR appears). Contributions welcome but I am pushing this out past beta. |
Edit: my original mistake when I wrote this issue was to believe that
flex-shrink
in the context offlex-wrap: wrap
was responsible for the widgets to shrink below their "natural" size => it is in fact "controlled" (more of a side effect?) byflex-basis
.tl;dr attribute
flex-grow
is most probably what users want instead offlex
.ngMaterial defines the
flex
attribute:You "advertise" its use everywhere like it is the most common pattern. The item grows when space is available (good) and shrinks up to nothing if there is no space (not good). I believe this is not the most common use case.
A better approach is to not shrink below the "natural" item/widget size if space is lacking. (If I remember well, this is what GTK+, Qt and Java Swing do).
Demo: http://plnkr.co/edit/vjud32?p=preview
I propose to define
flex-grow
attribute and use it instead offlex
:I don't think it is worth to define
flex-shrink
attribute: I do not believe it is a common pattern.The text was updated successfully, but these errors were encountered: