Skip to content

Commit

Permalink
fix(comp:table): tree table line doesn't appear normally (#1844)
Browse files Browse the repository at this point in the history
  • Loading branch information
sallerli1 committed Jan 30, 2024
1 parent 15daf1c commit 2405527
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
12 changes: 12 additions & 0 deletions packages/components/table/style/expandable.less
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,34 @@
& tr&-expanded-row {
& > td {
background-color: var(--ix-table-body-row-bg-color-expanded);
.@{table-prefix}-expandable-trigger-button {
background-color: var(--ix-table-body-row-bg-color-expanded);
}

> .@{table-prefix} {
margin: -4px 28px;
}
}
&:hover > td {
background-color: var(--ix-table-body-row-bg-color-expanded);
.@{table-prefix}-expandable-trigger-button {
background-color: var(--ix-table-body-row-bg-color-expanded);
}
}
}

& tr[class*=~'@{table-prefix}-row-level-'] {
& > td {
background-color: var(--ix-table-body-row-bg-color-expanded);
.@{table-prefix}-expandable-trigger-button {
background-color: var(--ix-table-body-row-bg-color-expanded);
}
}
&:hover > td {
background-color: var(--ix-table-body-row-bg-color-expanded);
.@{table-prefix}-expandable-trigger-button {
background-color: var(--ix-table-body-row-bg-color-expanded);
}
}
}
}
14 changes: 11 additions & 3 deletions packages/components/table/style/size.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.table-size( @font-size, @head-height, @padding-horizontal, @padding-vertical) {
.reset-font-size(@font-size);
font-size: @font-size;

@line-height: calc(@font-size + var(--ix-line-height-gutter));

line-height: @line-height;

&:not(.@{table-prefix}-borderless) {
> .@{header-prefix} {
Expand All @@ -12,7 +16,7 @@
font-size: calc(@font-size + 2px);
}
.@{table-prefix}-expandable-wrapper {
height: calc(100% + 7px); // cell height + padding
height: calc(100% + @padding-vertical * 2); // cell height + padding
margin-top: -1px; // cell border bottom
}

Expand All @@ -36,8 +40,12 @@

td.@{table-prefix}-cell,
.@{table-prefix}-alert-row > td,
.@{table-prefix}-expanded-row > td,
.@{table-prefix}-expanded-row > td {
height: calc(@padding-vertical * 2 + @line-height);
padding: @padding-vertical @padding-horizontal;
}
.@{table-prefix}-footer {
min-height: calc(@padding-vertical * 2 + @line-height);
padding: @padding-vertical @padding-horizontal;
}

Expand Down

0 comments on commit 2405527

Please sign in to comment.