-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Changed uiModes Button to Flexbox #4360
Conversation
css/80_app.css
Outdated
.w4 { width:33.3333%; } | ||
.w5 { width:41.6666%; } | ||
.w6 { width:50.0000%; } | ||
.w7 { width:58.3333%; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the .wX
? I might be wrong but can't we substitute this with flex-grow
/ flex-shrink
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe flex-grow/flex-shrink only defines how much space to take in a given estate.
CSS grid helps a lot if we are using lots of widths
I thought we needed width minus the floats
but right now I am not using them anywhere. We can delete it. @kepta
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree we might not need this, but I think the idea is for places where you have several joined things, (like buttons) you want them to try to share equal width.
e.g. for OK/Cancel, they'd have 50% width each, even though those words have very different natural width.
I've found I still need to set flex items with a width in order to get them to layout correctly. flexbox-grow
is about how to distribute extra width to contained items, and flexbox-shrink
is about how to steal width from them (I think - I might be wrong too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, but I feel we can simulate the case of proportions %
with flex.
Suppose we want 2 guys to share 50:50
, we can use simply use default flex.
if 75:25
, flex-grow:3 and other to 1.
@tridip1931 @bhousel Is there a situation you guys can think where width%
can't be replaced ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @bhousel I also faced this issue while working in flexbox for keeping some widths, upon looking for answers in google, I found this article very helpful.
https://css-tricks.com/things-ive-learned-css-grid-layout/
TL;DR We should not depend entirely on flexbox for layout purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tridip1931 css-grid
is amazing, but we can't use it yet because of very low browser support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh ya. I will delete those widths. Also will figure out the flex-grow/shrink if I come across.
Do we use flex-grow anywhere in our code right now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we use flex-grow anywhere in our code right now?
It's part of the shorthand flex:
property. The keyboard shortcuts screen is probably the place I've most recently used it:
Lines 3419 to 3432 in d9b3b7b
.modal-shortcuts .shortcut-tab { | |
display: flex; | |
flex-flow: row wrap; | |
} | |
.modal-shortcuts .shortcut-column { | |
flex: 1 1 50%; | |
width: 50%; | |
} | |
.modal-shortcuts .shortcut-tab-tools .shortcut-column { | |
flex: 1 1 100%; | |
width: 100%; | |
} |
(also an example of a place where you need to set a width, so flex can start out knowing what it's supposed to do before growing and shrinking)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bhousel . Thats very helpful. 👍
closing as stale |
@kepta Can you review this.