Skip to content

Commit

Permalink
fix(DataTable): fix padding issue when only some headers are sortable (
Browse files Browse the repository at this point in the history
…#7888)

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

* style(DataTable): remove redundant selector

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
tw15egan and kodiakhq[bot] authored Feb 26, 2021
1 parent a987ca4 commit c7ea23a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
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 {
display: flex;
align-items: center;
justify-content: space-between;
Expand Down

0 comments on commit c7ea23a

Please sign in to comment.