Skip to content

Commit

Permalink
Table: Removed border-bottom for HeaderCell used in ExpandableRow (#3503
Browse files Browse the repository at this point in the history
)

* Use HeaderCell for name in expandable table example

* 🐛 Removed border-bottom for HeaderCell used inside ExpandableRow

---------

Co-authored-by: Ken <ken.aleksander@gmail.com>
  • Loading branch information
HalvorHaugan and KenAJoh authored Jan 17, 2025
1 parent 8b5bfb4 commit 54495a4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .changeset/wise-paws-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@navikt/ds-css": patch
---

Table: Removed border-bottom for HeaderCell used in ExpandableRow.
8 changes: 2 additions & 6 deletions @navikt/core/css/darkside/table.darkside.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,22 +149,18 @@
flex-shrink: 0;
}

.navds-table__expandable-row:not(.navds-table__expandable-row--open) .navds-table__data-cell {
.navds-table__expandable-row:not(.navds-table__expandable-row--open) :where(.navds-table__data-cell, .navds-table__header-cell) {
transition: border-bottom-color 150ms cubic-bezier(0.95, 0.05, 0.8, 0.04);
}

.navds-table__expandable-row.navds-table__expandable-row--clickable:not(.navds-table__expandable-row--expansion-disabled):hover {
cursor: pointer;
}

.navds-table__expandable-row--open .navds-table__data-cell {
.navds-table__expandable-row--open :where(.navds-table__data-cell, .navds-table__header-cell) {
border-bottom-color: transparent;
}

.navds-table__expandable-row--open .navds-table__header-cell {
border-color: var(--ax-border-default);
}

.navds-table__expandable-row--open .navds-table__toggle-expand-cell--open {
border-color: transparent;
}
Expand Down
8 changes: 2 additions & 6 deletions @navikt/core/css/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -156,22 +156,18 @@
flex-shrink: 0;
}

.navds-table__expandable-row:not(.navds-table__expandable-row--open) .navds-table__data-cell {
.navds-table__expandable-row:not(.navds-table__expandable-row--open) :where(.navds-table__data-cell, .navds-table__header-cell) {
transition: border-bottom-color 190ms cubic-bezier(0.6, 0.04, 0.98, 0.335);
}

.navds-table__expandable-row.navds-table__expandable-row--clickable:not(.navds-table__expandable-row--expansion-disabled):hover {
cursor: pointer;
}

.navds-table__expandable-row--open .navds-table__data-cell {
.navds-table__expandable-row--open :where(.navds-table__data-cell, .navds-table__header-cell) {
border-bottom-color: transparent;
}

.navds-table__expandable-row--open .navds-table__header-cell {
border-color: var(--ac-table-row-border, var(--a-border-default));
}

.navds-table__expandable-row--open .navds-table__toggle-expand-cell--open {
border-color: transparent;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ export const Expandable = () => {
togglePlacement="right"
defaultOpen
>
{columns.map(({ key }) => (
<Table.DataCell key={key}>{row[key]}</Table.DataCell>
))}
{columns.map(({ key }, index) =>
index === 0 ? (
<Table.HeaderCell key={key}>{row[key]}</Table.HeaderCell>
) : (
<Table.DataCell key={key}>{row[key]}</Table.DataCell>
),
)}
</Table.ExpandableRow>
))}
</Table.Body>
Expand Down
2 changes: 1 addition & 1 deletion aksel.nav.no/website/pages/eksempler/table/expandable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Example = () => {
key={i + fnr}
content="Innhold i ekspanderbar rad"
>
<Table.DataCell scope="row">{name}</Table.DataCell>
<Table.HeaderCell scope="row">{name}</Table.HeaderCell>
<Table.DataCell>{fnr}</Table.DataCell>
<Table.DataCell>{format(new Date(start))}</Table.DataCell>
</Table.ExpandableRow>
Expand Down

0 comments on commit 54495a4

Please sign in to comment.