-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Flexbox - Growing and Shrinking lesson: update flex shorthand section for clarity with note on default values #29603
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
Closed
DanielKolocka
wants to merge
2
commits into
TheOdinProject:main
from
DanielKolocka:flex_shorthand_defaultValues
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nit: do we need this? the line above already mentions it?
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.
Hi Kevin, so when going through this, It wasn't very clear to me the values of the 3 flex properties when the shorthand was used.
Given flex: 1, we get grow and shrink set to 1, so I just assumed also that basis would be set to 1. However, basis because 0 rather than 1.
Adding this isn't critical, but could clear up some confusion.
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.
Essentially, it is unclear what the default value of flex-basis was.
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 for the explanation Daniel.
I think the way you have things laid out makes things very clear. Learners will be able to see the difference between the defaults on line 21, and what flex: 1 sets on line 25. The note feels redundant since line 25 already communicates that - does that make sense?
I think there could be value in explaining why it is changed to 0 however.
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.
Hey @DanielKolocka — just checking in. Are you still interested in finishing this up? I think we could get it merged if we either remove the note or replace it with an explanation of why the shorthand uses flex-basis: 0.