fix(components): Adjust cell and headerCell padding in DataTable #2873
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.
BLOCKED; Design brainstorming
Motivations
Updates
DataTablecell padding to provide better visual alignment with the container edges. First and last cells/headerCells/pagination now have increased horizontal padding that scales with viewport size.Changes
Changed
Before
All cells had uniform horizontal padding of --space-base at all screen sizes.
After
Note:
The footer (
DataTable.Footer) is a semantic HTML container (<tfoot>→<tr>→<td>) that can hold different types of content. When you useDataTable.Paginationinside the footer, the pagination component applies its own responsive padding via the.paginationCSS class. However, when you put custom content directly in the footer (like the "Current balance" row in DoubleFooter), that content doesn't use the pagination component, so it doesn't get the padding automatically. We shouldn't add padding directly to the footer's<td>because that would cause double padding when pagination is used inside it. So the footer stays as a borderless container, pagination handles its own padding, and custom footer content needs inline padding to match.Testing
run Storybook, go to
Lists and Tables>DataTable>Web>ComposableYou can see that on screens medium + the padding on the left most edge and right most edge are 24px
On small screens that snaps to 16px
Note: "original"
DataTableis not affectedChanges can be
tested via Pre-release
In Atlantis we use Github's built in pull request reviews.