Skip to content

Commit

Permalink
fix(@clayui.com): add a sass function to fix table border-radius issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ilzamcmed committed Mar 10, 2022
1 parent 60eaf7a commit 8fe4b05
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/clay-css/src/scss/components/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ caption {
thead {
// Chrome 87 rendering issue. See https://github.com/liferay/clay/issues/3847.

border-top-left-radius: clay-enable-rounded(table-border-radius());
border-top-right-radius: clay-enable-rounded(table-border-radius());

@include clay-css($c-table-thead);

td,
Expand Down Expand Up @@ -96,6 +99,9 @@ caption {
tbody {
// Chrome 87 rendering issue. See https://github.com/liferay/clay/issues/3847.

border-bottom-left-radius: clay-enable-rounded(table-border-radius());
border-bottom-right-radius: clay-enable-rounded(table-border-radius());

@include clay-css($c-table-tbody);

td,
Expand Down Expand Up @@ -424,15 +430,15 @@ caption {
td:first-child,
.table-cell-start {
border-top-left-radius: clay-enable-rounded(
$table-list-border-radius
table-border-radius()
);
}

th:last-child,
td:last-child,
.table-cell-start {
border-top-right-radius: clay-enable-rounded(
$table-list-border-radius
table-border-radius()
);
}
}
Expand All @@ -456,15 +462,15 @@ caption {
td:first-child,
.table-cell-start {
border-bottom-left-radius: clay-enable-rounded(
$table-list-border-radius
table-border-radius()
);
}

th:last-child,
td:last-child,
.table-cell-end {
border-bottom-right-radius: clay-enable-rounded(
$table-list-border-radius
table-border-radius()
);
}
}
Expand Down
6 changes: 6 additions & 0 deletions packages/clay-css/src/scss/variables/_tables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ $table-list-border-y-width: 0.0625rem !default;

$table-list-border-width: $table-list-border-y-width $table-list-border-x-width !default;

@function table-border-radius() {
@return calc(
#{$table-list-border-radius} - min(#{$table-list-border-x-width}, #{$table-list-border-y-width})
);
}

$table-list-border-radius: $border-radius !default;
$table-list-color: null !default;
$table-list-font-size: null !default;
Expand Down

0 comments on commit 8fe4b05

Please sign in to comment.