Add table bleed prop - #2790
Merged
Merged
Conversation
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.
The scenario
Tables are designed to sit inside surrounding page padding, so their first and last cells intentionally remove their outer padding. Inside a card, some layouts instead need full-width dividers while preserving the card gutter for cell content.
The problem
Achieving that composition currently requires pulling the table container through the parent padding and manually restoring padding on every first and last header and body cell. The required gutter also differs between default cards, small cards, and custom containers.
The solution
This adds a boolean
bleedprop toflux:table. Cards expose their size-aware horizontal gutter through an inherited--flux-bleedCSS variable, and bleeding tables use it to extend their container while restoring the same gutter on edge cells. Paginated tables keep pagination aligned to the gutter as well.The gutter defaults to
1.5rem. Default andsize="sm"cards provide their gutter automatically; custom containers can set the same variable to match their padding, for exampleclass="p-4 [--flux-bleed:1rem]".Related Flux Pro PR: https://github.com/livewire/flux-pro/pull/568
Docs PR: https://github.com/livewire/flux-docs/pull/210
Verification
composer validate --no-check-publishnpm run build; 2 tests passednpm run build; 426 tests passed, 8 skippedp-4container (16px): dividers reach the inner border and edge-cell content remains aligned