Skip to content

Commit

Permalink
fixing some minor issues with row and column styling
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-c-woodard committed Nov 27, 2024
1 parent 6326162 commit 931ccb2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/blocks/table/children/row/backend-styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,19 @@ export default function BackendStyles(props) {

const css = new KadenceBlocksCSS();

css.set_selector(`.kb-table-container .kb-table tr.kb-table-row${uniqueID}`);
css.set_selector(
`.kb-table-container .kb-table tr.kb-table-row${uniqueID}, .kb-table-container .kb-table tr.kb-table-row${uniqueID} th, .kb-table-container .kb-table tr.kb-table-row${uniqueID} td`
);
if (previewMinHeight) {
css.add_property('height', previewMinHeight + minHeightType);
}
if (backgroundColor !== '') {
css.add_property('background-color', KadenceColorOutput(backgroundColor));
}

css.set_selector(`.kb-table-container .kb-table tr.kb-table-row${uniqueID}:hover`);
css.set_selector(
`.kb-table-container .kb-table tr.kb-table-row${uniqueID}:hover, .kb-table-container .kb-table tr.kb-table-row${uniqueID}:hover th, .kb-table-container .kb-table tr.kb-table-row${uniqueID}:hover td`
);
if (backgroundHoverColor !== '') {
css.add_property('background-color', KadenceColorOutput(backgroundHoverColor));
}
Expand Down
12 changes: 9 additions & 3 deletions src/blocks/table/components/backend-styles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ export default function BackendStyles(props) {
}

if (headerTypography[0].color) {
css.set_selector(`.kb-table${uniqueID} th .kadence-advancedheading-text`);
css.set_selector(`.kb-table${uniqueID} th`);
css.add_property('color', KadenceColorOutput(headerTypography[0].color));
}

Expand Down Expand Up @@ -182,7 +182,9 @@ export default function BackendStyles(props) {
if (columnBackgrounds) {
columnBackgrounds.forEach((background, index) => {
if (background) {
css.set_selector(`.kb-table${uniqueID} td:nth-child(${index + 1})`);
css.set_selector(
`.kb-table${uniqueID} td:nth-child(${index + 1}), .kb-table${uniqueID} th:nth-child(${index + 1})`
);
css.add_property('background-color', KadenceColorOutput(background));
}
});
Expand All @@ -191,7 +193,11 @@ export default function BackendStyles(props) {
if (columnBackgroundsHover) {
columnBackgroundsHover.forEach((background, index) => {
if (background) {
css.set_selector(`.kb-table${uniqueID} td:nth-child(${index + 1}):hover`);
css.set_selector(
`.kb-table${uniqueID} td:nth-child(${index + 1}):hover, .kb-table${uniqueID} th:nth-child(${
index + 1
}):hover`
);
css.add_property('background-color', KadenceColorOutput(background));
}
});
Expand Down

0 comments on commit 931ccb2

Please sign in to comment.