Skip to content

Commit

Permalink
fix: Rework col-sort-button :last-child padding styles for performance (
Browse files Browse the repository at this point in the history
#5056) (#5060)

* Rework col-sort-button :last-child padding styles for performance

* Simplify selectors
  • Loading branch information
bearfriend authored Oct 9, 2024
1 parent 0038a25 commit 7d93505
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions components/table/table-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,14 @@ export const tableStyles = css`
.d2l-table th:has(d2l-table-col-sort-button:not(:only-child)) d2l-table-col-sort-button {
--d2l-table-col-sort-button-width: unset;
}
/* has at least one d2l-table-col-sort-button with [nosort], does not have d2l-table-col-sort-button without nosort */
.d2l-table > * > tr > :has(d2l-table-col-sort-button[nosort]:not(:only-child)):not(:has(d2l-table-col-sort-button:not([nosort]))) :last-child {
padding-inline-end: calc(0.6rem + 18px);
}
}
/* has at least one d2l-table-col-sort-button with [nosort], does not have d2l-table-col-sort-button without nosort */
.d2l-table th d2l-table-col-sort-button[nosort] ~ :last-child {
padding-inline-end: calc(0.6rem + 18px);
}
.d2l-table th d2l-table-col-sort-button:not([nosort]) ~ :last-child {
padding-inline-end: unset;
}
/* border radiuses */
Expand Down

0 comments on commit 7d93505

Please sign in to comment.