From 7d9350507fb7a47e3b3cf5eda0ba9d88240355ec Mon Sep 17 00:00:00 2001 From: Danny Gleckler Date: Wed, 9 Oct 2024 11:07:49 -0400 Subject: [PATCH] fix: Rework col-sort-button :last-child padding styles for performance (#5056) (#5060) * Rework col-sort-button :last-child padding styles for performance * Simplify selectors --- components/table/table-wrapper.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/components/table/table-wrapper.js b/components/table/table-wrapper.js index ccbaceda041..f17c9449cee 100644 --- a/components/table/table-wrapper.js +++ b/components/table/table-wrapper.js @@ -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 */