2

I have a datatable in LWC. For one of the columns, I am setting the style class to slds-icon-custom-custom9 which changes the text content of that column to white. When I hover the cursor over this column, the text becomes invisible because the background as well text is white.

Is there a way I can change the text content of a cell to be black when using slds-icon-custom-custom9? I tried using style through the basic.css file, but its style won't apply to the cell of the datatable.

If I don't use slds-icon-custom-custom9, how do I change the background color of the cell?

Playground link: https://developer.salesforce.com/docs/component-library/tools/playground/kPSqiPxWk/58/edit

1 Answer 1

4

Yes you can add another class for font color black like this

ele.AttributeName = 'slds-icon-custom-custom9 slds-text-color_default';

here is PG https://developer.salesforce.com/docs/component-library/tools/playground/kPSqiPxWk/62/edit

1
  • 1
    Thanks. It worked. However , if the column type is 'Url' it doesn't work. Any workaround around that? Commented May 6, 2020 at 12:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .