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

[Feature Request]: Make DataTable slug styling opt-in #17303

Open
1 task done
wkeese opened this issue Aug 30, 2024 · 3 comments
Open
1 task done

[Feature Request]: Make DataTable slug styling opt-in #17303

wkeese opened this issue Aug 30, 2024 · 3 comments

Comments

@wkeese
Copy link
Contributor

wkeese commented Aug 30, 2024

The problem

DataTable (and @carbon/ibm-products' Datagrid) support adding slugs to column headers and rows. It's shown in Storybook as an "AI label".

However, we are using it to insert an info tooltip in the column headers:

For the AI label, Carbon inserts a blue gradient in the data cells, and the blue bar at the top:

aiLabel

However, we don't want that styling (since our info tooltip is unrelated to AI):

infoIcon info icon with tooltip

Since we don't want that styling, I need to override Carbon's styling. But this is not trivial, because DataTable has styling for selected rows, hovered rows, hovered + selected rows, child rows, etc. This is what worked for me but it's not complete:

// Override the top blue line and background gradient that Carbon applies to <th> and <td> with slugs (i.e.
// the headers and cells in columns where we have the (i) icon).  We don't want any special styling there.
th {
  background: themes.$layer-accent !important;
  box-shadow: none !important;
}
td {
  background: themes.$layer !important;
}
:global(.#{prefixes.$carbon}--data-table--selected) td {
  background: themes.$layer-selected !important;
}
tr:hover > td {
  background: themes.$layer-hover !important;
}
.#{prefixes.$carbon}--data-table--selected:hover > td {
  background: themes.$layer-selected-hover !important;
}

The solution

I'm wondering if you could make all the blue styling optional, i.e. opt-in, since it would be easier to enable rather than to have to override the Carbon styling. Something maybe like

<TableCell aiStyling>

Examples

No response

Application/PAL

IKC

Business priority

None

Available extra resources

No response

Code of Conduct

Copy link
Contributor

Thank you for submitting a feature request. Your proposal is open and will soon be triaged by the Carbon team.

If your proposal is accepted and the Carbon team has bandwidth they will take on the issue, or else request you or other volunteers from the community to work on this issue.

@ljcarot
Copy link
Member

ljcarot commented Sep 25, 2024

@wkeese To make a change to styling, I suggest you bring to up with Adam Cutler and/or Ramiro Galan. We are following a very specific AI implementation from their work across all product team. There aren't supposed to changes without review and approval by them. They do host a weekly call every Wednesday at 9am ET for designs to be presented. Perhaps your team's designer could attend that by reaching out to Adam. cc @oliviaflory @matthewgallo @elycheea

@wkeese
Copy link
Contributor Author

wkeese commented Sep 25, 2024

@ljcarot - But I'm not asking to change the styling. That's the opposite of what I want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Triage
Development

No branches or pull requests

2 participants