Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update GridTable's cardStyle #983

Merged
merged 4 commits into from
Dec 14, 2023
Merged

feat: Update GridTable's cardStyle #983

merged 4 commits into from
Dec 14, 2023

Conversation

bdow
Copy link
Contributor

@bdow bdow commented Dec 14, 2023

Adds 'GridStyle.nonHeaderRowCss' to directly apply styles to non-header row elements. Adds 'GridStyle.rowHoverCss' to apply hover styles to non-header row elements Updates cardStyle to take advantage of the new styles to provide a box-shadow and border color change when hovering over a row. Updates cardStyle to apply more styles directly on the row element rather than on the individual cells

Adds 'GridStyle.nonHeaderRowCss' to directly apply styles to non-header row elements.
Adds 'GridStyle.rowHoverCss' to apply hover styles to non-header row elements
Updates cardStyle to take advantage of the new styles to provide a box-shadow and border color change when hovering over a row.
Updates cardStyle to apply more styles directly on the row element rather than on the individual cells
@stephenh
Copy link
Contributor

If "rowHoverCss" means "non-header", which is cool, do we need the "nonHeader" prefix for nonHeaderRowCss? Could we align those to the same prefix-or-no-prefix?

@@ -437,7 +437,7 @@ function renderDiv<R extends Kinded>(
<div
css={{
...(style.betweenRowsCss ? Css.addIn(`& > div > *`, style.betweenRowsCss).$ : {}),
...(style.firstNonHeaderRowCss ? Css.addIn(`& > div:first-of-type > *`, style.firstNonHeaderRowCss).$ : {}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, it looks like we used to apply this to the cells, and now we're applying it directly to the row? That seems better, just following along.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, thats true. This is a relic of the display: contents days when we couldn't apply styles directly to rows.

@@ -39,7 +41,9 @@ export interface GridStyle {
/** Applied if there is a fallback/overflow message showing. */
firstRowMessageCss?: Properties;
/** Applied on hover if a row has a rowLink/onClick set. */
rowHoverColor?: Palette;
rowHoverColor?: Palette | "none";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if we should rename this old to "rowLinkHoverColor", at least that's what the jsdoc insinuates it is?

(Sorry, reviewing this piecemeal on mobile)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was only for link/onClick behavior before, though now it is used all the time. I'll update the docs in an follow up PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah cool, thanks!

@bdow bdow merged commit ee42c57 into main Dec 14, 2023
6 checks passed
@bdow bdow deleted the table-card-styles branch December 14, 2023 16:50
homebound-team-bot pushed a commit that referenced this pull request Dec 14, 2023
## [2.330.0](v2.329.0...v2.330.0) (2023-12-14)

### Features

* Update GridTable's cardStyle ([#983](#983)) ([ee42c57](ee42c57))
@homebound-team-bot
Copy link

🎉 This PR is included in version 2.330.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants