Add "slack" width constraint modes#865
Merged
Conversation
kpfefferle
reviewed
Feb 5, 2021
tests/dummy/app/pods/docs/guides/header/size-constraints/template.md
Outdated
Show resolved
Hide resolved
4a38a16 to
9496542
Compare
877dcd4 to
d4f7500
Compare
…/expand-table-beyond-max-width
twokul
approved these changes
Feb 9, 2021
Contributor
twokul
left a comment
There was a problem hiding this comment.
Noted a few things. LGTM otherwise! 🎉
11d530f to
5272398
Compare
Contributor
Author
|
Refactored to get rid of |
twokul
suggested changes
Feb 10, 2021
Contributor
twokul
left a comment
There was a problem hiding this comment.
The code has changed since my last review. Noted a few things ✍️
This reverts commit b5b52de.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds two width constraint modes:
eq-container-slack,gte-container-slack. These build on their non-"slack" counterparts by allocating excess container whitespace into an additional column that vanishes when it is no longer needed. This resembles behavior in applications like Excel and Google sheets.BONUS ADDITION:
initialFillModeparameter that is used exclusively in slack modes to perform the initial column layout. Values and default are the same asfillMode. Ineq-container-slackmode,fillModeandinitialFillModecan be set to different values. The former is used for enforcing the width constraint, while the latter is used only for initial sizing. See docs & tests for examples.Which constraint modes use which fill modes:

Advantages:
Notes:
lte-containerornonefillModehas no effect ingte-container-slackmode, but does still apply when enlarging columns beyond the container size ineq-container-slackmoderesizeModecan befluid, butstandard(shown below) provides a more consistent UXinitialFillModeshould be used with slack modes if a "responsive" initial layout is desiredeq-container-slack
gte-container-slack