Skip to content
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

fix(DataTable): fix padding issue when only some headers are sortable #7888

Merged
merged 3 commits into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,6 @@
background-color: $ui-03;
}

.#{$prefix}--data-table.#{$prefix}--data-table--sort th {
padding: 0;
}

.#{$prefix}--data-table.#{$prefix}--data-table--sort .#{$prefix}--table-sort {
padding-left: $spacing-05;
}

.#{$prefix}--data-table th:last-of-type {
// Do not use `position: relative`, as its behavior is undefined for many table elements: https://www.w3.org/TR/CSS21/visuren.html#propdef-position
position: static;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
// -------------------------------------
// Sortable table
// -------------------------------------
.#{$prefix}--data-table--sort th {
.#{$prefix}--data-table--sort th,
.#{$prefix}--data-table th[aria-sort] {
height: $layout-04;
padding: 0;
border-top: none;
border-bottom: none;
}
Expand All @@ -33,8 +35,8 @@
justify-content: space-between;
width: 100%;
min-height: 100%;
padding-left: $spacing-05;
color: $text-01;

font: inherit;
line-height: 1;
background-color: $ui-03;
Expand All @@ -56,10 +58,18 @@
opacity: 1;
}

// Override for when `isSortable` is set on `DataTable` as well as `TableHeader`
.#{$prefix}--data-table.#{$prefix}--data-table--sort
th
> .#{$prefix}--table-header-label {
padding-right: $spacing-05;
padding-left: $spacing-05;
}

// -------------------------------------
// Th > Button > Span (span required for flex bugs in Safari)
// -------------------------------------
.#{$prefix}--data-table--sort th .#{$prefix}--table-sort__flex {
th .#{$prefix}--table-sort__flex {
tw15egan marked this conversation as resolved.
Show resolved Hide resolved
display: flex;
align-items: center;
justify-content: space-between;
Expand Down