Skip to content

Added theme.datatable.body.row.extend #7489

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

Merged
merged 3 commits into from
Jan 28, 2025

Conversation

jcfilben
Copy link
Collaborator

@jcfilben jcfilben commented Jan 27, 2025

What does this PR do?

Adds theme.datatable.body.row.extend so that styles can be added to rows within the DataTable body. This enhancement allows for changes like removing the bottom border of the last row in the body of the datatable so we don't get a double border when we have a footer or pagination.

This can be achieved with:

dataTable: {
  body: {
    row: {
      extend: `&:last-child td {
        border: none;
        }
        &:last-child th {
        border: none;
        }`,
    },
  },
},

Where should the reviewer start?

What testing has been done on this PR?

Added jest test and modified custom theme datatable story

How should this be manually tested?

Do Jest tests follow these best practices?

  • screen is used for querying.
  • The correct query is used. (Refer to this list of queries)
  • asFragment() is used for snapshot testing.

Any background context you want to provide?

What are the relevant issues?

Closes #7476

Screenshots (if appropriate)

Do the grommet docs need to be updated?

yes

Should this PR be mentioned in the release notes?

yes

Is this change backwards compatible or is it a breaking change?

backwards compatible

@jcfilben jcfilben requested review from britt6612 and taysea January 27, 2025 21:33
Copy link
Collaborator

@britt6612 britt6612 left a comment

Choose a reason for hiding this comment

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

LGTM

@britt6612 britt6612 requested a review from MikeKingdom January 28, 2025 18:15
Copy link
Collaborator

@MikeKingdom MikeKingdom left a comment

Choose a reason for hiding this comment

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

LGTM

@jcfilben jcfilben merged commit 7708707 into grommet:master Jan 28, 2025
14 checks passed
@jcfilben jcfilben deleted the datatable-last-border branch January 28, 2025 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DataTable -- enhance theme to allow overrides for last row of page
3 participants