Skip to content

Commit 9e5c59b

Browse files
authored
fix(table-cell): Fix background css variable (#8439)
**Related Issue:** #8380 ## Summary Fixes a typo that caused this variable not to work, and removes an unused border variable from the initial Table PR that snuck through.
1 parent e199c08 commit 9e5c59b

File tree

2 files changed

+30
-5
lines changed

2 files changed

+30
-5
lines changed

packages/calcite-components/src/components/table-cell/table-cell.scss

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
* These properties can be overridden using the component's tag as selector.
55
*
66
* @prop --calcite-table-cell-background: Specifies the background color of the component.
7-
* @prop --calcite-table-cell-border-color: Specifies the border color of the component.
87
*/
98

109
:host {
11-
--calcite-internal-table-cell-background-internal: var(--calcite-table-cell-background, transparent);
12-
--calcite-internal-table-cell-border-color-internal: var(--calcite-table-cell-border-color, transparent);
10+
--calcite-internal-table-cell-background: var(--calcite-table-cell-background, transparent);
1311
@apply contents;
1412
}
1513

@@ -58,8 +56,7 @@ td {
5856
}
5957

6058
.selected-cell:not(.number-cell):not(.footer-cell) {
61-
--calcite-table-cell-background: var(--calcite-color-foreground-current);
62-
background: var(--calcite-color-foreground-current);
59+
--calcite-internal-table-cell-background: var(--calcite-color-foreground-current);
6360
}
6461

6562
.selection-cell.selected-cell {

packages/calcite-components/src/components/table/table.stories.ts

+28
Original file line numberDiff line numberDiff line change
@@ -956,6 +956,34 @@ export const localized_TestOnly = (): string => html`<calcite-table
956956
</calcite-table-row>
957957
</calcite-table>`;
958958

959+
export const tableCellCssBackgroundVariable_TestOnly = (): string =>
960+
html`<calcite-table zebra caption="Simple-zebra table" dir="rtl" selection-mode="multiple">
961+
<calcite-table-row slot="table-header">
962+
<calcite-table-header heading="Heading" description="Description"></calcite-table-header>
963+
<calcite-table-header heading="Heading" description="Description"></calcite-table-header>
964+
<calcite-table-header heading="Heading" description="Description"></calcite-table-header>
965+
<calcite-table-header heading="Heading" description="Description"></calcite-table-header>
966+
</calcite-table-row>
967+
<calcite-table-row>
968+
<calcite-table-cell style="--calcite-table-cell-background: rgba(20, 200, 50, 0.15)">cell</calcite-table-cell>
969+
<calcite-table-cell>cell</calcite-table-cell>
970+
<calcite-table-cell>cell</calcite-table-cell>
971+
<calcite-table-cell>cell</calcite-table-cell>
972+
</calcite-table-row>
973+
<calcite-table-row>
974+
<calcite-table-cell style="--calcite-table-cell-background: rgba(200, 50, 20, 0.15)">cell</calcite-table-cell>
975+
<calcite-table-cell>cell</calcite-table-cell>
976+
<calcite-table-cell style="--calcite-table-cell-background: rgba(20, 200, 50, 0.15)">cell</calcite-table-cell>
977+
<calcite-table-cell>cell</calcite-table-cell>
978+
</calcite-table-row>
979+
<calcite-table-row>
980+
<calcite-table-cell>cell</calcite-table-cell>
981+
<calcite-table-cell>cell</calcite-table-cell>
982+
<calcite-table-cell style="--calcite-table-cell-background: rgba(200, 50, 20, 0.15)">cell</calcite-table-cell>
983+
<calcite-table-cell>cell</calcite-table-cell>
984+
</calcite-table-row>
985+
</calcite-table>`;
986+
959987
export const darkModeRTL_TestOnly = (): string =>
960988
html`<calcite-table zebra caption="Simple-zebra table" dir="rtl">
961989
<calcite-table-row slot="table-header">

0 commit comments

Comments
 (0)