I have a datatable in lwc. For one of the column I am setting the style class to - 'slds-icon-custom-custom9' which changes the text content of that column to white.When I hover cursor , text becomes invisible because 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 basic.css file, but it's 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


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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.